I tried to do the following:
TShaderMapRef<FCustomVS> CustomVS(globalShaderMap);
TShaderMapRef<FCustomPS> CustomPS(globalShaderMap);
static FGlobalBoundShaderState shaderState;
SetGlobalBoundShaderState(RHICmdList, ERHIFeatureLevel::SM5, shaderState, GCustomVertexDeclaration.Declaration, *CustomVS, *CustomPS);
FMatrix localToWorld = GetLocalToWorld();
FMatrix worldToScreen = View->ViewMatrices.ViewMatrix * View->ViewMatrices.ProjMatrix;
const uint32_t nbTriangles = meshBuffer.Indices.Num() / 3;
const uint32_t nbVertices = meshBuffer.Vertices.Num();
const uint32_t vSize = sizeof(FCustomVertex);
const uint32_t iSize = sizeof(int32);
const void* iBuffer = meshBuffer.Vertices.GetData();
const void* vBuffer = meshBuffer.Indices.GetData();
CustomVS->SetParameters(RHICmdList, localToWorld * worldToScreen);
DrawIndexedPrimitiveUP(RHICmdList, PT_TriangleList, nbTriangles, 0, nbVertices, iBuffer, iSize, vBuffer, vSize);
It renders nothing - I don’t see the mesh at all. The pixel shader simply outputs yellow, and the vertex shader just transform position from world to screen:
float4x4 worldToScreen;
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT o;
o.position = mul(float4(input.position, 1), worldToScreen);
return o;
}
I’ve tested that in a render command enqueued in the TickComponent of the component containing the geometry, or in the DrawDynamicElements of its associated PrimitiveSceneProxy (but not both at the same time). No difference, nothing rendered
At this point I don’t understand. Any help from a dev ?
Thanks !