Configurable world fragment shader #1541
Labels
area: renderer
Concerns our graphics renderer
lang: c++
Done in C++ code
nice new thing ☺
A new feature that was not there before
The world shader is the shader program used for the world render stage, which is responsible for drawing units, buildings, ambience, and everything else that is displayed by a sprite. Making it configurable gives us some leeway in how these objects are rendered.
Our planned approach to configuration is to allow encoding of "commands" in the alpha channels of pixels in a texture. In short, every even alpha value can represent a "command", which means the pixel should be processed using custom shader code. Odd alpha values are drawn without any processing. This gives us 128 possible commands to use in the shader.
The shader code that runs when such a command is encountered should be configurable by modders, e.g. to draw special pixels like player color or outlines. The final world shader would be assembled from the code snippets for each command individual command. These snippets would probably be embedded in a simple switch statement in the GLSL code like this:
Tasks:
The text was updated successfully, but these errors were encountered: