Landscape texture streaming

I was lookging at landscape streaming build code in ULandscapeComponent::GetStreamingRenderAssetInfo.

I noticed that the code simply consider all textures used by the attached material, ignoring that the attached material may be shared by all landscape components and that some of these textures may be not used thanks to shader optimizations when layer weights are 0.

We use a single material, shared on all components, so if a texture is really used just by 1 component in a corner of the landscape, it will be considered used by all components: so it will be resident.

I created a simple scene: a landscape with 2 components (C1 and C2), a material that samples 2 textures (modulated by 2 weights, T1 and T2). The first component C1 has T1=1 and T2=0. The second component C2 has T1=0 and T2=1.

[Attachment Removed]

Steps to Reproduce
Load map “untitled”, put a breakpoint in ULandscapeComponent::GetStreamingRenderAssetInfo, relaunch “Build Streaming”, look at Textures array produced by GetUsedTextures

[Attachment Removed]

Hi Marco,

This side of the material system only delineates which textures are “used” by a material based on platform and quality level, and that’s not unique to landscape materials sampling textures. The shader optimizations you mention are possible, but not guaranteed- a Landscape Layer Switch would be a surefire way to cut out texture samples.

Are you having issues with having all of those textures resident? It may be worth breaking up your landscape material into multiple separate instances with texture params so you can reduce texture residency.

[Attachment Removed]