This comes from this UDN : [Link Removed]

It occurs with this setup : 

[Image Removed]

, where Set Material Attributes expressions act as inputs to the Landscape Layer Blend material expression.

But it doesn't occur in this configuration : 

[Image Removed]

, where colors are input to the Landscape Layer Blend material expression and the resulting color is input into a Set Material Attributes node. 


In the former case, the generated shader contains this : 

float3 GetMaterialWorldPositionOffsetRaw(FMaterialVertexParameters Parameters)
    float2 Local9 = Parameters.TexCoords[3].xy;
    float4 Local10 = Texture2DSampleLevel(Material.Texture2D_0,GetMaterialSharedSampler(Material.Texture2D_0Sampler,View.LandscapeWeightmapSampler), Local9 ,0.00000000);
    float Local11 = dot(Local10,Material.PreshaderBuffer[1]);
    float3 Local12 = lerp(((float3)0.00000000),float3(0.00000000,0.00000000,0.00000000),Local11);
    return Local12;;

, which matches what the Landscape Layer Blend expression does : sampling the weightmap with the View.LandscapeWeightmapSampler, and then masking the result with some channel mask coming from a material param to only retain the channel that corresponds to the weightmap, and finally, lerping 2 values (0 and 0, here!) with the sampled weight as the blend factor. 


Steps to Reproduce

Use the attached project, open the map there and inspect the generated shaders in RenderDoc (using r.DumpShaderDebugInfo=1, r.Shaders.Optimize=0 and r.Shaders.Symbols=1 and running with -dx11 helps!)

The Basepass shader for the landscape materials with paint on it have a custom WPO, even though the landscape material used doesn't actually affect WPO. 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-205432 in the post.

Login to Vote

ComponentUE - Rendering Architecture - Materials
Affects Versions5.3
Target Fix5.5
CreatedJan 31, 2024
UpdatedFeb 22, 2024
View Jira Issue