I was previously creating 4 vertices for each face with 6 indexes, so if i wanted to draw a cube floating in mid air, i will need to draw the same vertexes 3 times!!!... and if i had 4 block on a 2x2 layout, the center vertex will be drawn 4 times!!, not to mention other layouts that ended up with a single vertex drawn up to 6 times!!, so this was not acceptable, and I entered the obscure optimization path to meet my goal, and I had to meet rendering goal, performance goal, and generation time goal, as this cannot take 2 minutes to load or it wont work either.
A couple days later the goal is met, but then i tried to apply normals at my vertexes.. and there was a ... holy crap moment, when the final rendering came out.... first holy crap was looking at the landscape which was rather nice, had my 60 fps, ran in under 45 secs which is not bad for so many cubes (~34 Million).
The optimization I did was, never repeat a single vertex (not entirely true but, at least 90% of the vertexes are unique, the other 10% are the ones on the edges of the sections that since they have their own vertexbuffer they must be repeated)
but since this change i can no longer set the normals to either up, left, right and so on, since a vertex now belong to several faces, so I sum up all the normals reading the faces the vertex belongs too and after that i normalize the result, this gives me this odd look.
Is there any way to do normals by face instead of by vertex? Something that can be calculated in the pixel shader other than the vertex shader maybe?








