Computer graphics: handling multiple light sources

I'm writing this post because I've spent a week trying to figure this one out - and there isn't a one-size-fits all solution :) At least from the manhours perspective. So, after implementing simple lihgting in my toy game engine, I wanted to add more than 1 light. But since the light source coordinates are passed to the shader as uniform values, the number of lights was limited (to 1). There [Read More]

Tracing OpenGL errors (1282)

The infamous 1282 error in OpenGL stands for GL_INVALID_OPERATION, and can be pretty annoying. A friend once described it as "GL_GENERIC_FUCK_YOU_ERROR" since it really doesn't tell you anything except that you are somehow using OpenGL wrong. The simple method of debugging this is to, line by line, place something like printf( "%d\n", glGetError() ); and then compile, rerun, and eventually [Read More]