Assuming we need to implement some utilitary or special shader, that apply some transformation to the final color ro UVs. For example:
- Animation of non-transparent liquid. For example, lava.
- Global grid drawn on the surface of objects
- Make some object slightly semi-transparent (walls between character and camera in isometric games) or slightly shining (character, pointed by mouse)
…but at the same time use the power of existing general purpose shaders Lighting or PBRLighting.
The most obvious solution is to just copy *Lighting.jm3d, *Lighting.vert and *Lighting.frag and edit them to inject specific transformations you need.
Are there any non copy-n-paste way to reach similar results? For example create material that refer to some base general purpose material and defines callbacks that are injected in right places in runtime?