Capítulo 798 de 859
TSL exposes the shader stage's implicit inputs (vertex position/normal, camera matrices, screen coordinates, time, material properties) as ready-made node constants you reference by name instead of declaring varyings/uniforms by hand.
transformedNormalView/transformedNormalWorld are post-normal-mapping.Position / geometry pipeline
| Node | Type | Space |
|---|---|---|
positionGeometry | vec3 | Raw geometry attribute, pre-skinning/morph |
positionLocal | vec3 | Local (object) space, post-skinning/morph |
positionPrevious | vec3 | Previous frame's local position (motion vectors) |
positionWorld | vec3 | World space |
positionWorldDirection | vec3 | Normalized world-space direction from camera |
positionView | vec3 | View (camera) space |
positionViewDirection | vec3 | Normalized view-space direction |
Normal / tangent pipeline
| Node | Notes |
|---|---|
normalGeometry, normalLocal, normalView, normalWorld | Raw normal at each space, pre-normal-map |
normalFlat | Face-flat normal (derivative-based) |
transformedNormalView, transformedNormalWorld | Post-normal-map, what lighting should actually use |
tangentGeometry, tangentLocal, tangentView, tangentWorld | Tangent vectors, mirror the normal set |
bitangentGeometry/Local/View/World | Bitangent vectors |
Camera / model uniforms
| Node | Description |
|---|---|
cameraPosition, cameraNear, cameraFar | Camera transform/frustum |
cameraViewMatrix, cameraProjectionMatrix(Inverse), cameraWorldMatrix, cameraNormalMatrix | Camera matrices |
modelPosition, modelScale, modelDirection, modelRadius | Current object's transform |
modelViewMatrix, modelWorldMatrix, modelWorldMatrixInverse, modelNormalMatrix | Model transform matrices |
modelViewProjection | Combined MVP, as a varying |
Screen / viewport (fragment stage)
| Node | Description |
|---|---|
screenUV, screenCoordinate, screenSize, screenDPR | Full-canvas screen-space helpers |
viewportUV, viewportCoordinate, viewportSize, viewport | Current viewport (may differ from screen with multiple viewports) |
viewportLinearDepth | Linear (non-projective) fragment depth |
Time / frame
| Node | Description |
|---|---|
time | Seconds since start, auto-updated |
deltaTime | Seconds since last frame |
frameId | Integer frame counter |
Compute-only builtins: instanceIndex, vertexIndex, drawIndex, workgroupId, localId, globalId, subgroupIndex, subgroupSize, numWorkgroups — used inside compute shaders (WebGPURenderer compute passes), not classic vertex/fragment materials.
normalView/normalWorld for lighting instead of the transformed* variants: you'll get pre-normal-map shading, which looks flat wherever a normal map is applied.instanceIndex, workgroupId, etc.) work in a regular material: they're only valid inside a compute shader context.<thing><Space> (position / normal / tangent × Geometry / Local / View / World) — learn the pattern once, it covers dozens of builtins.transformed* variants for lighting-relevant normals (they account for normal mapping); use the plain *View/*World variants when you need the un-perturbed geometric normal.time/deltaTime/frameId remove the need to manually create and update a uniform(0) clock every frame.workgroupId, globalId, atomics) only make sense inside WebGPURenderer compute passes, not standard material shaders.Fn()/operators.positionView/normalView).colorNode/normalNode/positionNode etc. as the attachment points for graphs built from these inputs.