Sign in to follow this  
hrun

vertex normals vs. face normals

Recommended Posts

Hi! Anyone here to help me with a drawing strategy? Consider a static scene mesh with vertex and face information given. When it comes to drawing (with lighting), vertex normals look much better for curved surfaces. But for walls and other edged things face normals do better (edges look like edges). How can I know about the correct normals just from the vertices and faces?? Thanks for your opinion.

Share this post


Link to post
Share on other sites
Generally real-time renderers do not use face normals for anything. Instead, in the case of seams, vertices are doubled so that one vertex can have two normals. For instance, a tetrahedron as rendered by your standard real-time renderer will have twelve vertices (3 vertices for each of 4 triangles, with no vertices shared).

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
Generally real-time renderers do not use face normals for anything. Instead, in the case of seams, vertices are doubled so that one vertex can have two normals. For instance, a tetrahedron as rendered by your standard real-time renderer will have twelve vertices (3 vertices for each of 4 triangles, with no vertices shared).


Good to know: I was thinking about the same thing, but I've found srange that I have to increase the vertices count in that manner, without being able to exploit shared vertices.
Using OGL in immediate mode it is easy to fix this: I set the normal for every vertex if the normals are per vertex or for every face if are per face, but using VBO that wont work...
If you say that duplicating vertices is the way to go, then let's to that way.

Share this post


Link to post
Share on other sites
You cannot exploit shared vertices in that maner because each unique normal must be part of a unique vertex structure. So if you want to have sharp edges betwine surfaces you have to duplicate vertices betwine those surfaces. This concept is mostly called smoothing groups where in a moothing group all adjicent triangles will share the same vertex and will be rendered as a smooth surface. I usualy create vertex structure like for example:

struct Vertex1 {
float3 pos;
float3 norm;
float2 uv;
};
struct Vertex2 {
float3 pos;
float3 norm;
float3 tan[2];
float2 uv;
};
struct Triangle {
unsigned int v[3];
};


This makes it easy to work with different vertex formats and is also a good setup for a hybrid GL/D3D renderer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this