Registers a callback to modify the properties of each fragment (pixel) before the final color is calculated in the fragment shader. This hook can be used inside baseMaterialShader().modify() and similar shader modify() calls to adjust per-pixel data before lighting/mixing.
The callback receives an Inputs object. Available fields depend on the shader:
normal: a three-component vector representing the surface normal.texCoord: a two-component vector representing the texture coordinates (u, v).ambientLight: a three-component vector representing the ambient light color.ambientMaterial: a three-component vector representing the material's ambient color.specularMaterial: a three-component vector representing the material's specular color.emissiveMaterial: a three-component vector representing the material's emissive color.color: a four-component vector representing the base color (red, green, blue, alpha).shininess: a number controlling specular highlights.metalness: a number controlling the metalness factor.
color: a four-component vector representing the stroke color (red, green, blue, alpha).tangent: a two-component vector representing the stroke tangent.center: a two-component vector representing the cap/join center.position: a two-component vector representing the current fragment position.strokeWeight: a number representing the stroke weight in pixels.
Return the modified object to update the fragment.
This hook is available in:
Examples
Syntax
getPixelInputs(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.