back-face culling
This is an old article from 2011. I was a kid. I learned a lot since then,
so please do think twice when taking advice from me as a kid.
I recently found a tutorial on back-face culling. It means telling OpenGL not to draw invisible faces (faces on the back side ;) ) of a mesh, which does speed up the rendering a lot.
I was looking for something like this after I increased the height of the world in Mineshooter from 4 to 10 and suddenly had to render about 130.000 blocks instead of 25.000 and therefore got a major performance problem.
So I found that enabling back-face culling in OpenGL is very easy. Just write the following lines where you initialize OpenGL:
glEnable(GL_CULL_FACE); //Enable face-culling glCullFace(GL_BACK); //Cull back-faces. You could also cull front-faces glFrontFace(GL_CCW); //drawing counter-clockwise... (GL_CW for Clockwise...)
That helped a lot. But before applying shaders I am going to optimize the world a bit.
This post was imported from tumblr