I think I narrowed this issue down to bad UV coordinates being interpreted during the BasePassVertexShader execution applied to instancing. At this line in VertexFactoryGetInterpolantsVSToPS:
float2 LightMapCoordinateInput = LocalVF_VertexFetch_TexCoordBuffer[LocalVF_VertexFetch_Parameters[ 1 ] * (LocalVF_VertexFetch_Parameters[ 3 ] + Input.VertexId) + LocalVF_VertexFetch_Parameters[ 2 ]];
The issue, from what I can see, is LocalVF_VertexFetch_Parameters is not initialised in the buffers of the pass, and as a result it looks like it is using garbage UV values when sampling the Lightmap texture. The buffer is initialised for FLocalVertexFactoryUniformShaderParameters, but not for FInstancedStaticMeshVertexFactoryUniformShaderParameters. When altering the values passed in renderdoc, the sampling did change visually, but could never be fully corrected. Closest achieved was using "Input.InstanceId", but it was still not accurate.
The only other possibility I saw was MANUAL_VERTEX_FETCH forces the ISM to use this TexCoordBuffer, but if turned off, Input.LightMapCoordinate is used instead. Perhaps the latter is supposed to be used for instancing?
Download the licensee repro here - [Link Removed]
Open in engine, the ISM is a lot of white cubes.
Build + press PIE
Move forward until the mesh becomes visible -> mesh texture is corrupted.
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
What controls of umg have mouse wheel events in UE4.27?
How to implement springarm components to scale according to mouse position in spawn?
How to assign a value to a member of UMG's UMaterialInterface pointer type in C++?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-115870 in the post.
1 |
Component | UE - Graphics Features |
---|---|
Affects Versions | 4.23, 4.26.2 |
Target Fix | 5.3 |
Created | May 17, 2021 |
---|---|
Resolved | Jul 19, 2023 |
Updated | Aug 17, 2023 |