Original Post
Allright, after much painstaking trouble, I came up with an algorithm to calculate normals in linear time for my heightmap renderer.
The effect is ... decent ... but altogether, incorrect, it seems:
Notice the checker-board artifacts. Even though the triangles themselves seem to be pointing in the correct direction / have the right shaded color, an outline appears in some situations ... particularly on steep hills, like this one.
The algorithm is as follows:
I have triangles ordered in an array (this is rendered with triangle lists) ... For each vertex in each triangle, I access all the triangles in the list which touch it using some fancy array manipulation, take the average, normalize, etc. Sounds right to me ...
Any opinions?
Appreciate it,
- Ben
Notice the checker-board artifacts. Even though the triangles themselves seem to be pointing in the correct direction / have the right shaded color, an outline appears in some situations ... particularly on steep hills, like this one.
The algorithm is as follows:
I have triangles ordered in an array (this is rendered with triangle lists) ... For each vertex in each triangle, I access all the triangles in the list which touch it using some fancy array manipulation, take the average, normalize, etc. Sounds right to me ...
Any opinions?
Appreciate it,
- Ben
