Merge remote-tracking branch 'origin/master' into 1.9

# Conflicts:
#	Source/Editor/Modules/ContentDatabaseModule.cs
#	Source/Editor/Surface/SurfaceUtils.cs
#	Source/Editor/Windows/Assets/MaterialInstanceWindow.cs
#	Source/Engine/Foliage/Foliage.cpp
#	Source/Engine/Graphics/Models/MeshBase.h
#	Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Textures.cpp
This commit is contained in:
Wojtek Figat
2024-09-12 13:38:20 +02:00
111 changed files with 1717 additions and 511 deletions

View File

@@ -187,7 +187,7 @@ public:
/// <summary>
/// Gets the list with physical materials used to define the terrain collider physical properties - each for terrain layer (layer index matches index in this array).
/// </summary>
API_PROPERTY(Attributes="EditorOrder(520), EditorDisplay(\"Collision\"), Collection(MinCount = 8, MaxCount = 8)")
API_PROPERTY(Attributes="EditorOrder(520), EditorDisplay(\"Collision\"), Collection(MinCount=8, MaxCount=8)")
FORCE_INLINE const Array<JsonAssetReference<PhysicalMaterial>, FixedAllocation<8>>& GetPhysicalMaterials() const
{
return _physicalMaterials;
@@ -199,6 +199,27 @@ public:
API_PROPERTY()
void SetPhysicalMaterials(const Array<JsonAssetReference<PhysicalMaterial>, FixedAllocation<8>>& value);
/// <summary>
/// Gets the physical material used to define the terrain collider physical properties.
/// [Deprecated on 16.02.2024, expires on 16.02.2026]
/// </summary>
API_PROPERTY(Attributes="HideInEditor, NoSerialize")
DEPRECATED("Use PhysicalMaterials instead.") FORCE_INLINE JsonAssetReference<PhysicalMaterial>& GetPhysicalMaterial()
{
return _physicalMaterials[0];
}
/// <summary>
/// Sets the physical materials used to define the terrain collider physical properties.
/// [Deprecated on 16.02.2024, expires on 16.02.2026]
/// </summary>
DEPRECATED("Use PhysicalMaterials instead.") API_PROPERTY()
void SetPhysicalMaterial(const JsonAssetReference<PhysicalMaterial>& value)
{
for (auto& e : _physicalMaterials)
e = value;
}
/// <summary>
/// Gets the terrain Level Of Detail count.
/// </summary>

View File

@@ -124,6 +124,10 @@ void TerrainChunk::Draw(const RenderContext& renderContext) const
}
drawCall.WorldDeterminantSign = RenderTools::GetWorldDeterminantSign(drawCall.World);
drawCall.PerInstanceRandom = _perInstanceRandom;
#if USE_EDITOR
if (renderContext.View.Mode == ViewMode::LightmapUVsDensity)
drawCall.Surface.LODDitherFactor = 1.0f; // See LightmapUVsDensityMaterialShader
#endif
// Add half-texel offset for heightmap sampling in vertex shader
//const float lodHeightmapSize = Math::Max(1, drawCall.TerrainData.Heightmap->Width() >> lod);
@@ -181,6 +185,10 @@ void TerrainChunk::Draw(const RenderContext& renderContext, MaterialBase* materi
}
drawCall.WorldDeterminantSign = RenderTools::GetWorldDeterminantSign(drawCall.World);
drawCall.PerInstanceRandom = _perInstanceRandom;
#if USE_EDITOR
if (renderContext.View.Mode == ViewMode::LightmapUVsDensity)
drawCall.Surface.LODDitherFactor = 1.0f; // See LightmapUVsDensityMaterialShader
#endif
// Add half-texel offset for heightmap sampling in vertex shader
//const float lodHeightmapSize = Math::Max(1, drawCall.TerrainData.Heightmap->Width() >> lod);