Description

Texture Collections can contain virtual textures. There is no way to inform TextureObjectFromCollection that the texture is virtual, only that it is a Texture2D.

This texture object is then sampled using Texture2DSample, even when the sampler is set to VirtualColor.

It would seem expected that either this is not a valid configuration, and the user should be warned, or that this is a valid configuration, and the texture should use the virtual texturing system.

Steps to Reproduce

After enabling Bindless Resources, attempt to utilise the texture collection data asset with a virtual texture.

Callstack

Texture2D Local1 = TextureFromCollection_Texture2D(Material.TextureCollection_0, 0.00000000);
MaterialFloat2 Local2 = Parameters.TexCoords[0].xy;
MaterialFloat4 Local3 = ProcessMaterialVirtualColorTextureLookup(Texture2DSample(Local1,View.MaterialTextureBilinearWrapedSampler,DERIV_BASE_VALUE(Local2)));
MaterialFloat3 Local4 = CustomExpression0(Parameters,Local3.r);
MaterialFloat Local5 = MaterialStoreTexCoordScale(Parameters, DERIV_BASE_VALUE(Local2), 1);
VTPageTableResult Local6 = TextureLoadVirtualPageTable(VIRTUALTEXTURE_PAGETABLE_0, VTPageTableUniform_Unpack(VIRTUALTEXTURE_PAGETABLE_UNIFORM_0), DERIV_BASE_VALUE(Local2), VTADDRESSMODE_CLAMP, VTADDRESSMODE_CLAMP, View.MaterialTextureMipBias, Parameters.SvPosition.xy, 0U + LIGHTMAP_VT_ENABLED, Parameters.VirtualTextureFeedback);
MaterialFloat4 Local7 = ProcessMaterialVirtualColorTextureLookup(TextureVirtualSample(Material.VirtualTexturePhysical_0, GetMaterialSharedSampler(Material.VirtualTexturePhysical_0Sampler, View.SharedBilinearClampedSampler), Local6, 0, VTUniform_Unpack(Material.VTPackedUniform[0])));
MaterialFloat Local8 = MaterialStoreVTSampleInfo(Parameters.TexCoordScalesParams, Local6, 0, 1);
MaterialFloat Local9 = MaterialStoreTexSample(Parameters, Local7, 1);

Have Comments or More Details?

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

0
Login to Vote

Unresolved
CreatedNov 28, 2024
UpdatedNov 29, 2024
View Jira Issue