domenica 3 gennaio 2016

Day 113: Independent lights

Today I moved all three lights shaders to the game, so the user can create its own.
The data are then sent automatically to the shader in the deferred renderer class.
This took an enormous amout of time, due to endless copy and paste and syntactic adjustments, but it was not a very hard job.
Now all the info about a light are stored in the light class as before. You can for example set a specular color, and it will be automatically sent in the deferred class. But this is not what I want, because it is exacly as before.
The idea is to remove this "static" data from the lights, so that the user will only use the ones in his custom shader. Only a few of them, which are absolutely important for the existence of the light itself, will be left there, like the position for instance.
Tomorrow I'll do that, and it should be trivial, since the big part of the refactoring was done today.

After that I will adapt the last shaders to work with the simple renderer (like the skybox or the blit program).
The sprite and font batch should probably be refactored as well to handle multiple shaders, and the font itself is so badly written that it cannot even support stuff like the rotation....but honestly I don't really care about 2D, it was just a fast improvement to the engine finalized to the shell creation, so I'll probably ignore them.

Nessun commento:

Posta un commento