best way to update normals?

Blitz3D Forums/Blitz3D Programming/best way to update normals?

aCiD2(Posted 2004) [#1]
hey, im trying to build a water system for my game, the main stuff is sorted out and working nicely. However, update normals is completely to slow to be any use with big meshs. Are there any faster ways? Ive noticed SSwift has wrote some for the code archives, are these faster or slower sswift?


Beaker(Posted 2004) [#2]
The Blitz ones (UpdateNormals) are very fast (relatively), but not very good, but you might be able to optimise your own (or sswifts) using what you know about your data - precalcing or otherwise.


aCiD2(Posted 2004) [#3]
ok, how hard would it be to create a dll in c++ to do a better job than blitz?


TeraBit(Posted 2004) [#4]
Unlikely since it would need access to the blitz system to do it. I'd go with sswift's code and see if it works fast enough for what you want.

Sswift said that his code was faster I believe, because it respects the triangle connections and so doesn't have to smooth out the face normals of each triangle at each vertex, whereas the inbuilt blitz one does.


Craig H. Nisbet(Posted 2004) [#5]
I have to admit, I've never really understood the whole updating normals thing. What's the purpose of it?


WolRon(Posted 2004) [#6]
To set the nurmals of the faces of your mesh to point outward.
It averages out where each normal points based on the directions that the faces that touch that normal are pointing
For the most part, it smooths out most objects (which may or may not be what you want).


Ice9(Posted 2004) [#7]
It's for lighting. Each vertex has a normal and each
triangle has three vertices and so three normals. since
blitz uses vertex lighting it lights the mesh based on
the normal. If you flipped all the normals the mesh would
bit lit backwards. Shaded areas would be lit and vis versa.