Where are built-in GLSL variables documented?

glsl

#1

Hi,

three.js includes predefined GLSL variables such as cameraPosition but can’t find an official document.

Where is it?


#2

Right here:

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


#3

Oh, don’t know why I was missing… Thanks anyway


#4

I think you were missing it because you can write shaders and use them wi ShaderMaterial but never even be aware of this class. ShaderMaterial might be a better place to document that.


#5

Yes, it might be and can be reason why I was missing, but I was searching in three.js document page. In three.js document page, it uses simple search box that looks up just titles of pages. So when I search “cameraPosition” which is one of keywords in the page content but never appear in titles, I got no result found.

If you search on Google, you can find it though.