yes. For every vertex normal, you average each poly normal that uses that vertex

Please log in or register to post a reply.

@anubis

faster ways ??? preferably you precalculate this once…

What if you have a animated model…would you store the normals for every frame in the file or pre-calculate them for every frame at runtime?

Thanks for the help. :) I will pre-calculate them for the terrain…and probably for the models. I am still not sure what the best way to do it for the animated models. :huh:

recalculate or transform.. depends on how you animate it..

there are very fast algos for generating normals for terrain, and so for deformable terrain recalculation is easy (and you can do “local recalc” instead of recalc everything..)

there is a very fast general algorithm to calc normals wich is O( A+B ) where A is the amount of faces, and B is the amount of vertices..

most the time you don’t animate your meshes randomly. if you have keyframes, you can interpolate normals as well (but don’t use linear interpolation directly! ..)

if you do skinning, you can transform the normals by the skinning-matrices as well.. you just have to know how to:D

hope that gives some ideas.. i can write down the structure of the algo as well.. isn’t it somewhere yet in those forums? ..

thanks..i got it working. :)

here are the results:

before:

[img]http://www.vision-software.org/garoudexample2.JPG[/img]

after:

[img]http://www.vision-software.org/garoudexample.JPG[/img]

- Upcoming Multiplatform Game Program...
- Our first game - looking for feedbacks
- Network Emulation Tool
- Trouble with accessing GLSL array
- Fiction
- Game Programming Patterns: Bytecode
- Interactive WebGL Water Demo
- Skeletal Animation Tutorial with GP...
- Unreal Engine 4
- Microsoft xbox one selling poorly

Ok i have a patch of terrain. Right now i just calculate the normals for every polygon. Is what i am wondering is what methods there are for garoud shading. If i am not mistaken…is what you do is average the normals of all the polygons that are in contact with the polygon. Are there any faster ways of doing this? Or am i doing it wrong? :huh: