Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Diffuse light shader with indexed primitives

$
0
0

@SomeGuy wrote:

I need to use a triangle's normal in a vertex shader using vs_3_0 & ps_3_0.
To save memory, I do not want every vertices to host the normal ( 3x same value per triangle + 3 new vertices per triangles)
Therefore, since I cannot access other vertices in the VS, I see 2 options :

1- Have a "normal buffer" and use the primitive's ID to get the proper normal.
2- Ask Monogame community how normal people do that.

I have tried to do the first option, but I cannot find which semantics are available and SV_PrimitiveID returns 0; Where can I find HLSL version documentation other than microsoft docs ?

How I declared it:
uint primitiveNb : SV_VertexID;

Also, using a "normal buffer" means calculating the normals on CPU and updating for every transformation; Can I move the code to GPU ?

Please share any Monogame Shader/ HLSL Documentation I could use in the future !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles