Archived

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

Newbie Question: Index buffers and light

This topic is 5744 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

Hello all, I am trying to make a terrain generater type program using a height map and an index buffer. So far i''ve created a very simple version of it that creates a big square coordinate system in a vertex buffer and then references those in my index buffer. This i''ve gotten to work very well. My problem is that now id like to introduce light. Does anyone have any creative ideas they''d like to share about using index buffers and normals? The only things i can come up with are the following: 1) get rid of the index buffer and just make a huge vertex buffer so that each polygon can have its own normal. 2) just give each of the vertices a normal that is generated based on the vertices around it So that each polygon could potentially have a different normal at each vertex. Would that work? It would be cool if i could store normals in my index buffer or if i could give each vertex multiple normals. But i don''t think either of those are possible... Please let me know what you think. Thanks

Share this post


Link to post
Share on other sites
Both of your methods work. The second would cause every sharp edge to be shaded as if it were soft. So if you have a spike in the terrain it would be shaded softly. Now if this isn''t a problem for the kind of terrain your making, I''d say go for it. Index buffers are easier on the bandwidth

Always remember, you''''re unique. Just like everyone else.

Share this post


Link to post
Share on other sites
I tried implimenting my second method today and so far it works for what im doing.. i don''t think that ill be working with a lot of sharp edges. Thanks very much for your insight Greven

Share this post


Link to post
Share on other sites