mjendruk / mammut

Highspeed-Gravity Racer for Game Programmig Course at HPI
Other
4 stars 0 forks source link

Enable Back Face Culling #52

Closed mjendruk closed 10 years ago

mjendruk commented 10 years ago

This will improve the performance. Necessary steps:

    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
    glFrontFace(GL_CCW);
karyon commented 10 years ago

while i don't object to implementing this, i think this may not yield visible performance improvements, as this will save us drawing about 1k triangles and the geometry pass needs about 0.7ms on my machine...

why is the lighting of the cave correct (as in: similar to the cuboid's lighting) if its normals are wrong?

karyon commented 10 years ago

for reference, the geometry pass does need more than 0.7ms, this was based on a faulty perfcounter.

the lighting is correct as the normals are correct, the "clockwiseness" of the triangles' vertices aren't, though. the cuboids work as expected as their vertices and normals come from glow's unit cube

karyon commented 10 years ago

i fixed the triangle orientation. when enabling culling, i get this:

culling-missing-faces

all other cuboids look fine. i guess you ruled out negative scaling factors, so the only possibilities i can think of is that the faces are too close to each other or the cube's normal gets too small through scaling?

mjendruk commented 10 years ago

hm when I enable back face culling on the current develop the geometry pass takes 0.5 ms less. and i don't see this problem.

karyon commented 10 years ago

okay, that's... cool?

although it's only 0.1ms here, we should still enable it, what do you think we should do about the screenshot?

mjendruk commented 10 years ago

when did this occur?

karyon commented 10 years ago

when using windows and then starting the game, it's right at the beginning :) i'll show you tomorrow

karyon commented 10 years ago

you enabled it, right? i propose to close this and ensure a minimum width of cuboids in leveldesign