The root of this issue is that FLocalVertexFactory is doing manual vertex fetch in the shader. In HLSL, this relies on SV_VertexId. In GLSL, it's gl_VertexId. HLSL does not include the base vertex index and SV_VertexId always starts at zero. GLSL, on the other hand, does include the base vertex index.
As a result, this works correctly in OpenGL / Vulkan, and incorrectly on DirectX.
Run attached project and notice the four triangles in the upper left corner. All four triangles should have unique vertex colors; instead, the second column of triangles mirrors the first. This is because the second column of triangles is using a BaseVertexIndex != 0.[Link Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-74848 in the post.
0 |
Component | UE - Rendering Architecture - RHI |
---|---|
Affects Versions | 4.22 |
Target Fix | 4.23 |
Created | May 20, 2019 |
---|---|
Resolved | May 21, 2019 |
Updated | Jul 30, 2019 |