uniformCubeTexture
A specialized node for passing a 360-degree environment map (CubeTexture) from JavaScript to the shader, fundamental for reflections, refractions, and skyboxes.
Core Advantages
Greatly simplifies the implementation of advanced environmental effects. It abstracts away the underlying samplerCube declaration and binding, allowing developers to use THREE.CubeTexture objects directly in the node graph to easily create reflections, refractions, and Image-Based Lighting (IBL).
Common Uses
Creating a skybox as the scene's 360-degree background.
Providing environment reflection data for metallic or mirror-like materials.
Simulating refraction effects for transparent materials like glass or water.
How to adjust
Adjust by changing the sampling direction vector in the node graph. For instance, use `reflectView` for perfect mirror reflections, add noise to `reflectView` to simulate bumpy surfaces, or use `normalWorld` as the sampling direction to achieve a MatCap (Material Capture) effect.
Code Examples
1// In JS: const envMapNode = uniformCubeTexture( myCubeTexture );
2
3// In TSL, sample using the reflection vector for a mirror effect
4material.colorNode = envMapNode.sample( reflectView );