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]

Project Euler - Problem 12

I couldn't find a short and reasonable explanation for this problem. That is why I'm writing this simple article which is essentially distilled from a bunch of stackexchange answers. I won't give you the solution, but rather point you in the right direction. This was the first problem that I spent more than 20 minutes on. I assume that most people (myself included) tried brute-forcing our way through this, just [Read More]

Google SoC 2018. diary: Ep 8 - Its over

GSoC 2018. is over. It was a bumpy ride. But before I share my overall thoughts and experiences, let me update you with the project. The project page at GSoC website can be found here. Here goes the summary of the project (copypasta of my official project submission): Proposal pdf 1. Project goals (taken from proposal) Although GNUstep has an implementation of both AppKit and CoreAnimation, they are not integrated. [Read More]

Google SoC 2018. diary: Ep 7 - Making it draw

This week I've been mostly trying to draw the actual NSView contents into the attached CALayer, and have it rendered via CARenderer. Last week I had a proof that this is possible using the work from previous phases - I’ve managed to draw some custom graphics into a CALayer, which is then drawn into a NSView-managed OpenGL context using a CARenderer. You can read that report here. The concept [Read More]