Registers a callback to customize how color components are combined in the fragment shader. This hook can be used inside baseMaterialShader().modify() and similar shader modify() calls to control the final color output of a material. The callback receives an object with the following properties:
baseColor: a three-component vector representing the base color (red, green, blue).diffuse: a single number representing the diffuse reflection.ambientColor: a three-component vector representing the ambient color.ambient: a single number representing the ambient reflection.specularColor: a three-component vector representing the specular color.specular: a single number representing the specular reflection.emissive: a three-component vector representing the emissive color.opacity: a single number representing the opacity.
The callback should return a vector with four components (red, green, blue, alpha) for the final color.
This hook is available in:
Examples
Syntax
combineColors(callback)
Parameters
Related References
combineColors
Registers a callback to customize how color components are combined in the fragment shader.
getCameraInputs
Registers a callback to adjust vertex properties after the model has been transformed by the camera, but before projection, in the vertex shader.
getColor
Registers a callback to set the final color for each pixel in a filter shader.
getFinalColor
Registers a callback to change the final color of each pixel after all lighting and mixing is done in the fragment shader.