# per pixel normals

This topic is 3635 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I assume that normals are computed from the given vertices. Suppose v1,v2 and v3 are the vertices, then normals of the vertices are calculated by taking the cross products of the edge vectors.i.e cross_product((v1-v2),(v2-v3)) for vertex v2 and so on. Then where is the necessity for computing per pixels normals.

##### Share on other sites
First assumption is usualy incorrect in practice.

The vertex normals are usualy the weighted average of the face normals of each face which shares a vertex.

Per-pixel normals are usualy from an interpolation across the polygon of those averaged vertex normals.

##### Share on other sites
Quote:
 Then where is the necessity for computing per pixels normals.

To make it short: for better looking, more physically correct shading of curved surfaces.

What you describe is called flat shading since you'd get the same normal for all 3 vertices (they all lie in the same plane).
Per pixel normals are - like Rockoon1 said - interpolated across the polygon to provide for smoother shading (no hard edges as with flat shading). For correct results you'd also have to adjust the length of the interpolation results.

1. 1
2. 2
3. 3
Rutin
17
4. 4
5. 5
JoeJ
13

• 9
• 14
• 10
• 25
• 9
• ### Forum Statistics

• Total Topics
632645
• Total Posts
3007628
• ### Who's Online (See full list)

There are no registered users currently online

×