Shader
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.
Common Shader Types
For implementation and parameter setting see the tutorial Local illumination - Shader.
RGBA Shader
simple shaders based on 4 values: red green blue and alpha (transparency)
Phong shader
A Phong shader represents a Phong-like reflector. Its bidirectional reflection/transmission distribution functions are as follows:
Lambert Shader
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.
GGX
A GGX (Trowbridge-Reitz) microfacet BRDF shader.
Ward
A shader implementing the anisotropic Ward (1992) reflectance model.
Switch Shader
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).
Algorithm Switch Shader
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.
Side Switch Shader
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.
SkyLight shaders
This sub group of shaders are also light sources and can be used with the Sky object
