Search code examples
three.jsglsl

what is cameraPosition in threejs GLSL?


I see some three.js shader code online which reads:

vCameraPosition = cameraPosition;

Where does cameraPosition come from, and where in the API can I learn about it?


Solution

  • Built-in uniforms and attributes of are defined in WebGLProgram. Check out the following doc page for more information.

    https://threejs.org/docs/#api/renderers/webgl/WebGLProgram