RujiK
Member
I'm trying to implement a bare-bones diffuse style lighting for a 3d model. (Lighting that is calculated by the angle of the triangle face vs the angle of the light ray)
I have found many tutorials for this, but so far all of them involve baking your normals into your vertex buffer. Unfortunately, my 3d model is going to be heavily animated by the vertex shader, so baking the normals won't really work (I think?) since the triangles will be moving and turning.
So, I guess my specific question is: Can you calculate the normal, and thus the lighting, of a vertex inside the vertex shader?
Thank you for your time.
I have found many tutorials for this, but so far all of them involve baking your normals into your vertex buffer. Unfortunately, my 3d model is going to be heavily animated by the vertex shader, so baking the normals won't really work (I think?) since the triangles will be moving and turning.
So, I guess my specific question is: Can you calculate the normal, and thus the lighting, of a vertex inside the vertex shader?
Thank you for your time.