Constant | Type | Stage | Description |
---|---|---|---|
VIEWPORT_SIZE | in vec2 | V | Size of viewport (in pixels). |
VIEW_MATRIX | in mat4 | V | World space to view space transform. |
INV_VIEW_MATRIX | in mat4 | V | View space to world space transform. |
MAIN_CAM_INV_VIEW_MATRIX | in mat4 | V | View space to world space transform of camera used to draw the current viewport. |
INV_PROJECTION_MATRIX | in mat4 | V | Clip space to view space transform. |
NODE_POSITION_WORLD | in vec3 | V | Node world space position. |
NODE_POSITION_VIEW | in vec3 | V | Node view space position. |
CAMERA_POSITION_WORLD | in vec3 | V | Camera world space position. |
CAMERA_DIRECTION_WORLD | in vec3 | V | Camera world space direction. |
CAMERA_VISIBLE_LAYERS | in uint | V | Cull layers of the camera rendering the current pass. |
OUTPUT_IS_SRGB | in bool | V | true when output is in sRGB color space (this is true in the Compatibility renderer, false in Forward+ and Forward Mobile). |
INSTANCE_ID | in int | V | Instance ID for instancing. |
INSTANCE_CUSTOM | in vec4 | V | Instance custom data (for particles, mostly). |
VIEW_INDEX | in int | V | The view that we are rendering. VIEW_MONO_LEFT (0) for Mono (not multiview) or left eye, VIEW_RIGHT (1) for right eye. |
VIEW_MONO_LEFT | in int | V | Constant for Mono or left eye, always 0. |
VIEW_RIGHT | in int | V | Constant for right eye, always 1. |
EYE_OFFSET | in vec3 | V | Position offset for the eye being rendered. Only applicable for multiview rendering. |
VERTEX | inout vec3 | V | Vertex in local coordinates. |
VERTEX_ID | in int | V | The index of the current vertex in the vertex buffer. |
NORMAL | inout vec3 | V | Normal in local coordinates. |
TANGENT | inout vec3 | V | Tangent in local coordinates. |
BINORMAL | inout vec3 | V | Binormal in local coordinates. |
POSITION | out vec4 | V | If written to, overrides final vertex position. |
UV | inout vec2 | V | UV main channel. |
UV2 | inout vec2 | V | UV secondary channel. |
COLOR | inout vec4 | V | Color from vertices. |
ROUGHNESS | out float | V | Roughness for vertex lighting. |
POINT_SIZE | inout float | V | Point size for point rendering. |
MODELVIEW_MATRIX | inout mat4 | V | Model space to view space transform (use if possible). |
MODELVIEW_NORMAL_MATRIX | inout mat3 | V | |
MODEL_MATRIX | in mat4 | V | Model space to world space transform. |
MODEL_NORMAL_MATRIX | in mat3 | V | |
PROJECTION_MATRIX | inout mat4 | V | View space to clip space transform. |
BONE_INDICES | in uvec4 | V | |
BONE_WEIGHTS | in vec4 | V | |
CUSTOM0 | in vec4 | V | Custom value from vertex primitive. When using extra UVs, xy is UV3 and zw is UV4. |
CUSTOM1 | in vec4 | V | Custom value from vertex primitive. When using extra UVs, xy is UV5 and zw is UV6. |
CUSTOM2 | in vec4 | V | Custom value from vertex primitive. When using extra UVs, xy is UV7 and zw is UV8. |
CUSTOM3 | in vec4 | V | Custom value from vertex primitive. |
VIEWPORT_SIZE | in vec2 | F | Size of viewport (in pixels). |
FRAGCOORD | in vec4 | F | Coordinate of pixel center in screen space. xy specifies position in window. Origin is lower left. z specifies fragment depth. It is also used as the output value for the fragment depth unless DEPTH is written to. |
FRONT_FACING | in bool | F | true if current face is front facing. |
VIEW | in vec3 | F | Normalized vector from fragment position to camera (in view space). This is the same for both perspective and orthogonal cameras. |
UV | in vec2 | F | UV that comes from vertex function. |
UV2 | in vec2 | F | UV2 that comes from vertex function. |
COLOR | in vec4 | F | COLOR that comes from vertex function. |
POINT_COORD | in vec2 | F | Point Coordinate for drawing points with POINT_SIZE. |
OUTPUT_IS_SRGB | in bool | F | true when output is in sRGB color space (this is true in the Compatibility renderer, false in Forward+ and Forward Mobile). |
MODEL_MATRIX | in mat4 | F | Model space to world space transform. |
MODEL_NORMAL_MATRIX | in mat3 | F | |
VIEW_MATRIX | in mat4 | F | World space to view space transform. |
INV_VIEW_MATRIX | in mat4 | F | View space to world space transform. |
PROJECTION_MATRIX | in mat4 | F | View space to clip space transform. |
INV_PROJECTION_MATRIX | in mat4 | F | Clip space to view space transform. |
NODE_POSITION_WORLD | in vec3 | F | Node position, in world space. |
NODE_POSITION_VIEW | in vec3 | F | Node position, in view space. |
CAMERA_POSITION_WORLD | in vec3 | F | Camera position, in world space. |
CAMERA_DIRECTION_WORLD | in vec3 | F | Camera direction, in world space. |
CAMERA_VISIBLE_LAYERS | in uint | F | Cull layers of the camera rendering the current pass. |
VERTEX | in vec3 | F | Vertex that comes from vertex function (default, in view space). |
LIGHT_VERTEX | inout vec3 | F | A writable version of VERTEX that can be used to alter light and shadows. Writing to this will not change the position of the fragment. |
VIEW_INDEX | in int | F | The view that we are rendering. VIEW_MONO_LEFT (0) for Mono (not multiview) or left eye, VIEW_RIGHT (1) for right eye. |
VIEW_MONO_LEFT | in int | F | Constant for Mono or left eye, always 0. |
VIEW_RIGHT | in int | F | Constant for right eye, always 1. |
EYE_OFFSET | in vec3 | F | Position offset for the eye being rendered. Only applicable for multiview rendering. |
SCREEN_UV | in vec2 | F | Screen UV coordinate for current pixel. |
DEPTH | out float | F | Custom depth value (0..1). If DEPTH is being written to in any shader branch, then you are responsible for setting the DEPTH for all other branches. Otherwise, the graphics API will leave them uninitialized. |
NORMAL | inout vec3 | F | Normal that comes from vertex function (default, in view space). |
TANGENT | inout vec3 | F | Tangent that comes from vertex function. |
BINORMAL | inout vec3 | F | Binormal that comes from vertex function. |
NORMAL_MAP | out vec3 | F | Set normal here if reading normal from a texture instead of NORMAL. |
NORMAL_MAP_DEPTH | out float | F | Depth from variable above. Defaults to 1.0. |
ALBEDO | out vec3 | F | Albedo (default white). |
ALPHA | out float | F | Alpha (0..1); if read from or written to, the material will go to the transparent pipeline. |
ALPHA_SCISSOR_THRESHOLD | out float | F | If written to, values below a certain amount of alpha are discarded. |
ALPHA_HASH_SCALE | out float | F | |
ALPHA_ANTIALIASING_EDGE | out float | F | |
ALPHA_TEXTURE_COORDINATE | out vec2 | F | |
METALLIC | out float | F | Metallic (0..1). |
SPECULAR | out float | F | Specular. Defaults to 0.5, best not to modify unless you want to change IOR. |
ROUGHNESS | out float | F | Roughness (0..1). |
RIM | out float | F | Rim (0..1). If used, Godot calculates rim lighting. |
RIM_TINT | out float | F | Rim Tint, goes from 0 (white) to 1 (albedo). If used, Godot calculates rim lighting. |
CLEARCOAT | out float | F | Small added specular blob. If used, Godot calculates Clearcoat. |
CLEARCOAT_GLOSS | out float | F | Gloss of Clearcoat. If used, Godot calculates Clearcoat. |
ANISOTROPY | out float | F | For distorting the specular blob according to tangent space. |
ANISOTROPY_FLOW | out vec2 | F | Distortion direction, use with flowmaps. |
SSS_STRENGTH | out float | F | Strength of Subsurface Scattering. If used, Subsurface Scattering will be applied to object. |
SSS_TRANSMITTANCE_COLOR | out vec4 | F | |
SSS_TRANSMITTANCE_DEPTH | out float | F | |
SSS_TRANSMITTANCE_BOOST | out float | F | |
BACKLIGHT | inout vec3 | F | |
AO | out float | F | Strength of Ambient Occlusion. For use with pre-baked AO. |
AO_LIGHT_AFFECT | out float | F | How much AO affects lights (0..1; default 0). |
EMISSION | out vec3 | F | Emission color (can go over 1,1,1 for HDR). |
FOG | out vec4 | F | If written to, blends final pixel color with FOG.rgb based on FOG.a. |
RADIANCE | out vec4 | F | If written to, blends environment map radiance with RADIANCE.rgb based on RADIANCE.a. |
IRRADIANCE | out vec4 | F | If written to, blends environment map IRRADIANCE with IRRADIANCE.rgb based on IRRADIANCE.a. |
VIEWPORT_SIZE | in vec2 | L | Size of viewport (in pixels). |
FRAGCOORD | in vec4 | L | Coordinate of pixel center in screen space. xy specifies position in window, specifies fragment depth if DEPTH is not used. Origin is lower-left. |
MODEL_MATRIX | in mat4 | L | Model space to world space transform. |
INV_VIEW_MATRIX | in mat4 | L | View space to world space transform. |
VIEW_MATRIX | in mat4 | L | World space to view space transform. |
PROJECTION_MATRIX | in mat4 | L | View space to clip space transform. |
INV_PROJECTION_MATRIX | in mat4 | L | Clip space to view space transform. |
NORMAL | in vec3 | L | Normal vector, in view space. |
UV | in vec2 | L | UV that comes from vertex function. |
UV2 | in vec2 | L | UV2 that comes from vertex function. |
VIEW | in vec3 | L | View vector, in view space. |
LIGHT | in vec3 | L | Light Vector, in view space. |
LIGHT_COLOR | in vec3 | L | Color of light multiplied by energy * PI. The PI multiplication is present because physically-based lighting models include a division by PI. |
SPECULAR_AMOUNT | in float | L | 2.0 * light_specular property for OmniLight3D and SpotLight3D. 1.0 for DirectionalLight3D. |
LIGHT_IS_DIRECTIONAL | in bool | L | true if this pass is a DirectionalLight3D. |
ATTENUATION | in float | L | Attenuation based on distance or shadow. |
ALBEDO | in vec3 | L | Base albedo. |
BACKLIGHT | in vec3 | L | |
METALLIC | in float | L | Metallic. |
ROUGHNESS | in float | L | Roughness. |
OUTPUT_IS_SRGB | in bool | L | true when output is in sRGB color space (this is true in the Compatibility renderer, false in Forward+ and Forward Mobile). |
DIFFUSE_LIGHT | out vec3 | L | Diffuse light result. |
SPECULAR_LIGHT | out vec3 | L | Specular light result. |
ALPHA | out float | L | Alpha (0..1); if written to, the material will go to the transparent pipeline. |