Archived

This topic is now archived and is closed to further replies.

Cg and Normals

This topic is 5020 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites