Cg and Normals

Started by
1 comment, last by okidata 20 years, 1 month ago
Are normals interpotated by the rasterizer automatically once you send them as a parameter to you vertex program? Second question you have a NxN array of verticies on a flat plane parallel to the xz plane. using per vertex lighting you have one normal/vertex if the NxN array is altered by a vertex prgram lets say some variation of a sin & cos function I assume the Normals are not do I have to calculate the normals per vertex on the gpu? Please no "why are you" answers I have a reason for what I am doing please just info relevant to my questions. Thank you in advanced Okidata
Suki-yaki hot saki soup.... you sock it to me I''ll sock it to you!...
Advertisement
You must pass normals to your vertex program and they must be stored in your vertex program output struct.

Normals are not affected by vertex (aswell as color and texcoord and such) changes so you will have to update them manually (not sure what the best way is though).
quote:Original post by okidata
Second question
you have a NxN array of verticies on a flat plane parallel to the xz plane. using per vertex lighting you have one normal/vertex

if the NxN array is altered by a vertex prgram lets say some variation of a sin & cos function I assume the Normals are not
do I have to calculate the normals per vertex on the gpu?

If your function (for vetices) can be derived, then this derivation can be used to modify normals. If not, you can''t calculate normals in VP in general.

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement