## Exhausting list of all the built-it uniforms avaiable in Jitter shaders

Nov 08 2020 | 11:40 am

Hi everyone,

once in a while, looking inside jitter shaders, I discover some new GL3 built-in uniforms never saw before. Sometimes, they provide the answer to problems I didn't know how to address before. I looked inside the jitter documetation, but I didn't find an exhausting list of all the avaiables built-in uniforms. I know many of them can be found in the GLSL documentation out there, but i'd love to have a comprehensive list of what Max and GLSL can offer to let the user build their own shaders. Here there are the uniforms i met so far and what i understood about them:

[EDIT]

MATRICES:
type="mat4" state="MODELVIEW_PROJECTION_MATRIX" == P * V * M
type="mat4" state="PREV_MODELVIEW_PROJECTION_MATRIX" == the previous frames modelview-projection matrix
type="mat4" state="VIEW_PROJECTION_MATRIX == P * V
type="mat4" state="MODELVIEW_MATRIX" == V * M
type="mat4" state="VIEW_MATRIX" == V
type="mat4" state="WORLD_MATRIX" == transforms into world coordinates
type="mat4" state="PROJECTION_MATRIX" == P
type="mat4" state="CAM_PROJECTION_MATRIX" == (gl3 only) Provides the current rendering cameras projection matrix; in most cases is equivalent to PROJECTION_MATRIX except in cases where a full-screen quad is rendering, e.g. in a jit.gl.slab/pix (or jit.gl.pass)
type="mat3" state="NORMAL_MATRIX" == it orients the normals in eye space
type="mat4" state="TEXTURE0_MATRIX" == Transforms normalized texture coordinates into rect coordinates

CAMERA:
type="float" state="FAR_CLIP" == Camera far clipping distance
type="float" state="NEAR_CLIP" == Camera near clipping distance
type="vec3" state="FAR_CORNER" == far corner of the view frustum
type="vec3" state="CAMERA_POSITION" == camera position in world space
type="vec3" state="CAMERA_DIRECTION" == camera direction in world space
type="vec2" state="VIEWPORT" == the pixel size of rendering window
type="vec2" state="INVERSE_VIEWPORT" == the inverse of the viewport dims

LIGHT:
type="mat4" state="LIGHT_VIEWPROJ_MATRIX0-7" == scene seen from the light position???
type="float" state="LIGHT_RANGE0-7 " == distance reached by the light
type="vec3" state="LIGHT0-7_POSITION" == position on the light
type="vec3" state="LIGHT0-7_DIRECTION" == direction of the light
type="vec4" state="LIGHT0-7_AMBIENT" == ambient light color
type="vec4" state="LIGHT0-7_DIFFUSE" == diffuse light color
type="vec4" state="LIGHT0-7_SPECULAR" == specular reflection color
type="float" state="LIGHT0-7_CUTOFF" == the spotlight cutoff in degrees (=spotlight angle)
type="float" state="LIGHT0-7_EXPONENT" == exponent implied in the reflected light calculation

MATERIAL:
type="vec4" state="DIFFUSE" == material diffuse color
type="vec4" state="AMBIENT" == material ambient color
type="vec4" state="SPECULAR" == material specular color
type="vec4" state="EMISSION" == mterial emission color
state="FRONT_MATERIAL" == gives the values from the @mat_X attributes of the 3Dobj to which the shader is attached.
VERTEX:
type="vec3" state="POSITION" == XYZ Position
type="vec4" state="COLOR" == RGBA Color
type="vec3" state="NORMAL" == Normal vectors
type="vec3" state="TANGENT" == Tangent vectors
type="vec3" state="BITANGENT" == Bitangent vectors
type="vec3" state="VERTEX_ATTR" == Custom vertex attribute
type="vec3" state="VERTEX_ATTRn" == (where "n" is an integer number) Nth custom vertex attribute
type="float" state="EDGEFLAG" == unused, ignore

TEXTURES:
type="vec2" state="TEXDIM0" == XY Dimension of texture 0 type="vec2" state="TEXCOORD" == XY texture coordinates

These are the built-in uniforms i know. I ignore the meaning of some entries in this list and I guess I'm still missing some of them. Could you please integrate the list with the uniforms you know? I will edit this first post adding the entries you provide, so to keep everything compact.
It would be very usefull if an analogue list were done with built-it variables.

Hope this could be usefull to you as much as it is to me.
Thank you very much!