Filter shaders
A filter shader returns a spectrum as a function of shading parameters (UV coordinates, world-space position and normal, etc...). For instance, it may describe the spectral color of a diffuse material, and this color may vary across the object's surface.
Filter shader types
Constant
This filter shader returns a constant value, it does not depend on any parameter (wavelength or shading parameters)
Children nodes
none
Parameters
- value
- real
- The constant filter shader value
Uniform
This filter shader returns spectrum and does not depend on shading parameters
Children nodes
spectrum
- Spectrum : The uniform spectrum value
Parameters
none
Texture
This filter shader gets a RGB value from a texture at shading UV coordinates, and convert it to spectral values using the same algorithm as the RGB spectrum
An optional correction curve is applied to the raw RGB values, similar to a brightness/contrast/gamma adjustment:
- The value is first applied a gamma curve, controlled by the greypt parameter. The grey value (0.5) is mapped to greypt, hence setting greypt to 0.5 disables this correction
- Then, the value is scaled by the scale parameter
- And finally, offset is added to the value
In other words:
- Black(0) is mapped to the offset parameter
- White(1) is mapped to offset+scale
- Grey(0.5) is mapped to offset+scale*greypt
Children nodes
image
- Image : The image to use as a texture
Parameters
- greypt
- real
- The non-linear grey point adjustment, between 0.25 and 0.9
- scale
- rgb
- RGB value scaling, or contrast adjustment
- offset
- rgb
- RGB value offset, or brightness adjustment
- uvscale
- real
- The UV coordinates scaling factor. Scales the texture spatially over the geometry
Environment ground matte
This advanced filter shader computes the diffuse albedo of a horizontal lambertian surface, so that it has the same radiance as a ground point in the environment map. It assumes that envmap pixels below the horizon correspond to an horizontal, flat and diffuse ground.
This filter shader is very useful for rendering shadows cast over an envmap ground.
Children nodes
image
- Image : The envmap image
Parameters
- up
- vec3
- The direction where the top of the envmap (zenith) is oriented in space. Should be orthogonal to front
- front
- vec3
- The direction where the center of the envmap is oriented in space. Should be orthogonal to up
- center
- vec3
- The camera position for projecting the environment on the geometry.
- rgbmax
- vec3
- Clamps the calculated RGB albedo values by this setting