cubeTextureBase
Low-level factory function for creating a CubeTextureNode; exposed TSL name is "cubeTexture". Supports 1–4 arguments: value(CubeTexture) required; uvNode(vec3) optional; levelNode(int) optional; biasNode(float) optional.
Core Advantages
Unifies overloads and parameter order, directly controls sampling direction, LOD, and MIP bias; consistent with the public function name "cubeTexture" for easier migration and discovery.
Common Uses
Sample an environment map using reflection/refraction direction
Lock LOD to get blurrier/clearer reflections
Use bias to fine-tune automatic LOD selection
How to adjust
Adjust uvNode to change the sampling direction; increase levelNode to choose higher MIP levels for a blurrier result; bias acts as an additional offset to fine-tune the platform's default MIP selection.
Code Examples
1// 1) Basic: sample along reflection direction
2const dir = reflect( positionViewDirection.negate(), normalWorld );
3const c0 = cubeTexture( envMap, dir );
4
5// 2) Fixed LOD (blurrier)
6const c1 = cubeTexture( envMap, dir, int( 4 ) );
7
8// 3) Fixed LOD with additional bias
9const c2 = cubeTexture( envMap, dir, int( 3 ), float( 0.75 ) );