A shader is a component that implements a *local illumination model* in GroIMP, defining how light interacts with the surface of an object. The local illumination model is the theoretical framework that describes how incoming light is absorbed, reflected, or transmitted by surfaces at a local point. A shader is the concrete implementation of this model, encoded as an object or class in GroIMP that controls these optical properties for rendering and simulation purposes.
It specifies the optical properties such as absorption, reflection, transmission, and the scattering behavior of light rays on that surface.
For implementation and parameter setting see the tutorial Local illumination - Shader.
simple shaders based on 4 values: red green blue and alpha (transparency)
A Phong shader represents a Phong-like reflector. Its bidirectional reflection/transmission distribution functions are as follows:
Lambertian reflection (Lambert, 1760) is a widely used model for diffuse reflection. It assumes an ideal diffusely reflecting surface, where the apparent brightness remains constant regardless of the observer’s viewing angle. Consequently, the reflected radiant intensity follows Lambert's cosine law.
A GGX (Trowbridge-Reitz) microfacet BRDF shader.
A shader implementing the anisotropic Ward (1992) reflectance model.
This abstract base class defines a shader which switches between a set of actual shaders based on the shading environment and ray direction. This can be used, e.g., to use different shaders for front and back side (SideSwitchShader), or to use different shaders depending on the algorithm (raytracer or light model) (AlgorithmSwitchShader).
The AlgorithmSwitchShader allows the definition of different shaders used for different purposes depending on the actual used algorithm, namely raytracing, visualization, light modelling. The the two defined constructor of the AlgorithmSwitchShader class ether allow to define a different shader for visualization, raytracing, and radiation (light modelling), or just for visualization, and radiation.
The SideSwitchShader allows to two use different Shades for a planar object as parallelograms or triangulated mash surfaces etc. The SideSwitchShader(Shader frontShader, Shader backShader) expects two input shader, where as the frontShader will define the upper side shader, where as the backShader will be applied to the downside of the object.
This sub group of shaders are also light sources and can be used with the Sky object