Improving the shaders

Godot 3 has a built-in normal mapping shader for 2D sprites. It works, but doesn’t really offer anything outside standard normal mapping. I want more.

This slideshow requires JavaScript.

My new shader adds separate diffuse, specular and ambient occlusion lifted from Blender. The difference is subtle, yet it makes parts of the ship stand out more. The challenge was not the shader itself (which is relatively basic), but a bug in Godot 3.0.2 (stable at this time) which broke all lighting-related 2D shaders. Fortunately, current master (development branch of 3.1) has this issue fixed, but this required extra step of setting up environment and building Godot from sources. It also means that I can’t release ΔV before 3.1 goes stable, as this issue will likely affect exports, and I don’t really feel comfortable with building production software on top of unstable engine.

Leave a Reply