Trying to call a pixel shader using the buffers from FStaticMeshVertexBuffers and FDynamicMeshIndexBuffer32

Hello I am having an issue when trying to use the UV vertex buffer and the tangent buffer inside the FStaticMeshVertexBuffers, but it seems the position vertex buffer is ok,


As you can see in the SetStreamSource I am triyng to bind it, at the slot 1, the vertex declaration I have is also matching that.

My vertex shader is way to simple for now, I am using a delta value to interpolate between the WP and the UV positions

Here is a little video that shows the problem, I am also using the resources to render a custom mesh, you see behind on the UE viewport, not sure what I am doing wrong at this point,
2024-05-19 12-49-17.mkv (2.8 MB)

Here I am solving my own issues again, I forgot unreal automatically pack UVs for saving resources, on my application I need the full precisions, then before initializating the render resource I am doing this:

Just to complete my own response, binding the normal was a bit more difficult but following the same logic of the UV I managed to successfully bind the Tangent Vertex buffer

once you create the FStaticMeshVertexBuffer you should bind it like this:

The index should simply match your declaration like this:

The 2 in this case means the buffer goes in the StreamSource 2, and I realize unreal uses this FPackedRGBA16N to pack the TangentX and the TangentZ on half16 a.k.a int16, that is only when you use SetUseHighPrecisionTangentBasis to true ine the StaticMeshVertexBuffer, othewise they are truly pack and I did not bother to know how to unpack since I need full precision anyway on my case.

And finally on your vertex shader they can be accessed like this:

I hope this help someone else.