Multiple shader rendering

After further work I was able to get the rendering handler to support more complex configurations. This allowed me to re-enable the old diffuse shader for each camera, while having the background shader only enabled for the main camera. Shaders are not hardcoded directly anymore in the rendering handler, they are created separately before being registered to it. The rendering flow also is now cleaner, with separate sections responsible for the various rendering steps keeping performance in mind (rendering all cameras using a shader, before moving to the next shader, these kind of things…).

Animated gif showing the background rendering behind the old game rendering - Things are working once more!

New rendering with backgroundshader, main view only

Good to be back! (Except that collision bug...)

Time spent for this Time spent so far
25 h 95 h

The background image is using a sphere image projected onto a single texture. To make it run, we calculate each fragments’ position on the texture before displaying it on screen. This gives the impression to the user that he is in the middle of this ocean image. This is simple, but has the issue that the image loses fidelity when looking directly up or down. However, since this is not a common occurence in the current game, it is good enough for now.

Additionally, (but less visually), I have added a clang-format file to enforce better code consistency throughout the project. This required a fair amount of moving things around, but the end result is cleaner code. This was a bit dangerous though as it makes me want to do further code refactoring…


See also