Contents:
Castle Game Engine defines a few nodes that allow to use shaders to define effects on 3D shapes, textures and lights.
You basically provide small pieces of shading language code
(OpenGL Shading Language, GLSL) that
will be seamlessly integrated with the engine internal shaders (and with each other).
This allows to create graphic effects using
the powerful shader languages.
Contrary to the traditional approach of using shaders (using ComposedShader
nodes,
see shader component support),
this new system allows to create the effects more easily. There is no need
to replicate existing functionality (e.g. you don't have to reimplement existing lighting or texturing operations
in your shaders, if you don't want to modify them).
Moreover, your shader effects automatically cooperate with each other and with standard
rendering features, hence why we call this feature compositing shaders.
For engine developers using Pascal:
The most important example is Using Shader Effects to implement rendering effects that enhance the standard rendering (examples/viewport_and_scenes/shader_effects). It shows applying shader effects on shapes.
See also Shader Effects On Texture (examples/viewport_and_scenes/shader_effects_on_texture). This focuses on applying the effects on textures. As always, follow the README of the example to know all the details.
The example models are available inside
our demo models.
Download them, and look inside the subdirectory compositing_shaders
there.
Also the water
subdirectory contains water implementation
using our effects.
You can open the example models with any of our engine tools, like Castle Model Viewer.
The specification of these effects is an extension of the X3D standard. We have two independent implementations of this concept now:
If you have any questions, please ask on Castle Game Engine forum or Discord.
The original description of this idea was Michalis Kamburelis' Ph.D. thesis. (Although never formally defended, due to lack of time.)
I was also presenting it on Theory and Practice of Computer Graphics 2011 conference and at seminar at Institure of Computer Science, Wrocław.
So I have some additional content about this idea, that may be useful -- but be careful, as it was not updated in the last years. While the idea and syntax remained unchanged, some advised PLUG names have changed.