Jump to content
  • Advertisement
Sign in to follow this  
Hunter_Ex

Calc Normals

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

whats a fast way of calcualtion normals for 300 000 vertices at game creation i know i can turn my terrain into a mesh then fix the normals with the dx command and then copy it back to the vbuffer but thats sounds like it will also take some time?? or if u know a good method of calculation smooth normals cheers hunter_ex

Share this post


Link to post
Share on other sites
Advertisement
Calculating unsmoothed normals is a quick process, but smoothed ones require that you know adjacency information so you can average normals from multiple triangles. Unfortunately, I do not know of an easier way to do this but maybe someone else can direct you.

If I were you in this situation, I would structure you mesh into triangles with pointers to vertices, and vertices with multiple pointers back to their respective triangles. I would first calculate the normal of each triangle and store these vectors. Then I would iterate through each vertex and for each triangle that it belongs to and average the normals from the triangles.

... out of curiosity, for what purpose do you need to calculate the normals at startup? There is no possible way you can precalculate these normals?

Share this post


Link to post
Share on other sites
You can always use nvidia nvmeshmender - im nopt 100% sure but it can also compute normals and its api indipenmdent.

But still i think it would be reasonable to turn that map into mesh, com0pute adjecency and then normals. You dont have to retrive those vertices after that and copy to your vbuffer, since you can use mesh vbuffer with LockVertexBuffer(..)

Share this post


Link to post
Share on other sites
before i made my own functions for generation adjaecny and normals but they wne pretty slow : /

so maybe the best i can do is using the dx compute normals and try to store them

in a text file..


hey i need some more help
can someone explain what the D3DXCreateNormalMap "the functions might be named slight other" but i hope what functions i mean : )

what does it do what can i use it for??

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!