Download

Draw Primitive Adding TextureCoords and Other Information.

Hey I am messing around with global shaders like this: https://www.unrealengine.com/en-US/blog/how-to-add-global-shaders-to-ue4.

I was wondering how we add uvs and other information when using DrawPrimitiveUP function? Do I have to add something to the command list?

Thanks

Never mind.
Found this example in some source code for a post process.



// Generate the vertices used
FScreenVertex Vertices[4];

Vertices[0].Position.X = MaxX;
Vertices[0].Position.Y = MinY;
Vertices[0].UV.X = MaxU;
Vertices[0].UV.Y = MinV;

Vertices[1].Position.X = MaxX;
Vertices[1].Position.Y = MaxY;
Vertices[1].UV.X = MaxU;
Vertices[1].UV.Y = MaxV;

Vertices[2].Position.X = MinX;
Vertices[2].Position.Y = MinY;
Vertices[2].UV.X = MinU;
Vertices[2].UV.Y = MinV;

Vertices[3].Position.X = MinX;
Vertices[3].Position.Y = MaxY;
Vertices[3].UV.X = MinU;
Vertices[3].UV.Y = MaxV;

DrawPrimitiveUP(RHICmdList, PT_TriangleStrip, 2, Vertices, sizeof(Vertices[0]));