output
Represents the final color output of the fragment shader, serving as the destination for all color calculations and determining the final color of each pixel on the screen.
Core Advantages
It provides a standardized output channel, abstracting low-level GLSL variables (like `gl_FragColor`) into a unified `material.colorNode` property, and seamlessly integrates with the Three.js rendering pipeline (e.g., tone mapping, color space conversion), greatly simplifying development.
Common Uses
Carrying the final color of a material after all lighting and texture calculations.
Outputting the filtered color in a post-processing pass.
For debugging, by directly outputting intermediate data like normals or UVs to visualize shader state.
How to adjust
The `output` node itself is not adjustable; its visual effect is entirely determined by the node assigned to `material.colorNode`. For instance, assigning a `texture()` node displays a texture; assigning `normalWorld` visualizes normals for debugging; and assigning a dynamic `timer()` node can create animated effects.
Code Examples
1// Assign a node to material.colorNode; TSL connects this to the final 'output'.
2// Here, we visualize UV coordinates for debugging purposes.
3material.colorNode = vec4( uv(), 0, 1 );