|
@@ -72,10 +72,6 @@ Render modes
|
|
|
+---------------------------------+-----------------------------------------------------------------------+
|
|
|
| **ambient_light_disabled** | Disable contribution from ambient light and radiance map. |
|
|
|
+---------------------------------+-----------------------------------------------------------------------+
|
|
|
-| **shadow_to_opacity** | Lighting modifies the alpha so shadowed areas are opaque and |
|
|
|
-| | non-shadowed areas are transparent. Useful for overlaying shadows onto|
|
|
|
-| | a camera feed in AR. |
|
|
|
-+---------------------------------+-----------------------------------------------------------------------+
|
|
|
|
|
|
Vertex built-ins
|
|
|
^^^^^^^^^^^^^^^^
|
|
@@ -124,10 +120,6 @@ shader, this value can be used as desired.
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| Built-in | Description |
|
|
|
+======================================+=======================================================+
|
|
|
-| in float **TIME** | Elapsed total time in seconds. |
|
|
|
-+--------------------------------------+-------------------------------------------------------+
|
|
|
-| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
-+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout mat4 **WORLD_MATRIX** | Model space to world space transform. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| in mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
@@ -140,9 +132,11 @@ shader, this value can be used as desired.
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout mat4 **INV_PROJECTION_MATRIX** | Clip space to view space transform. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
-| inout vec3 **VERTEX** | Vertex in local coordinates. |
|
|
|
+| in float **TIME** | Elapsed total time in seconds. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
-| out vec4 **POSITION** | If written to, overrides final vertex position. |
|
|
|
+| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
++--------------------------------------+-------------------------------------------------------+
|
|
|
+| inout vec3 **VERTEX** | Vertex in local coordinates. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout vec3 **NORMAL** | Normal in local coordinates. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
@@ -150,23 +144,25 @@ shader, this value can be used as desired.
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout vec3 **BINORMAL** | Binormal in local coordinates. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
-| out float **ROUGHNESS** | Roughness for vertex lighting. |
|
|
|
-+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout vec2 **UV** | UV main channel. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout vec2 **UV2** | UV secondary channel. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
-| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB color space |
|
|
|
-| | (true in GLES2, false in GLES3). |
|
|
|
-+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout vec4 **COLOR** | Color from vertices. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| inout float **POINT_SIZE** | Point size for point rendering. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
+| out vec4 **POSITION** | If written to, overrides final vertex position. |
|
|
|
++--------------------------------------+-------------------------------------------------------+
|
|
|
| in int **INSTANCE_ID** | Instance ID for instancing. |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
| in vec4 **INSTANCE_CUSTOM** | Instance custom data (for particles, mostly). |
|
|
|
+--------------------------------------+-------------------------------------------------------+
|
|
|
+| out float **ROUGHNESS** | Roughness for vertex lighting. |
|
|
|
++--------------------------------------+-------------------------------------------------------+
|
|
|
+| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB color space |
|
|
|
+| | (true in GLES2, false in GLES3). |
|
|
|
++--------------------------------------+-------------------------------------------------------+
|
|
|
|
|
|
Fragment built-ins
|
|
|
^^^^^^^^^^^^^^^^^^
|
|
@@ -178,11 +174,7 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| Built-in | Description |
|
|
|
+===================================+==================================================================================================+
|
|
|
-| in float **TIME** | Elapsed total time in seconds. |
|
|
|
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
-| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
-| in vec4 **FRAGCOORD** | Coordinate of pixel center in screen space. ``xy`` specifies position in window, ``z`` |
|
|
|
+| in vec4 **FRAGCOORD** | Coordinate of pixel center. In screen space. ``xy`` specifies position in window, ``z`` |
|
|
|
| | specifies fragment depth if ``DEPTH`` is not used. Origin is lower-left. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in mat4 **WORLD_MATRIX** | Model space to world space transform. |
|
|
@@ -195,6 +187,10 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in mat4 **INV_PROJECTION_MATRIX** | Clip space to view space transform. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+| in float **TIME** | Elapsed total time in seconds. |
|
|
|
++-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
++-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in vec3 **VERTEX** | Vertex that comes from vertex function (default, in view space). |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in vec3 **VIEW** | Vector from camera to fragment position (in view space). |
|
|
@@ -215,16 +211,12 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in vec2 **UV2** | UV2 that comes from vertex function. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
-| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB color space (true in GLES2, false in GLES3). |
|
|
|
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in vec4 **COLOR** | COLOR that comes from vertex function. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out vec3 **ALBEDO** | Albedo (default white). |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out float **ALPHA** | Alpha (0..1); if written to, the material will go to the transparent pipeline. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
-| out float **ALPHA_SCISSOR** | If written to, values below a certain amount of alpha are discarded. |
|
|
|
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out float **METALLIC** | Metallic (0..1). |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out float **SPECULAR** | Specular. Defaults to 0.5, best not to modify unless you want to change IOR. |
|
|
@@ -247,12 +239,12 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out vec3 **TRANSMISSION** | Transmission mask (default 0,0,0). Allows light to pass through object. Only applied if used. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
-| out vec3 **EMISSION** | Emission color (can go over 1,1,1 for HDR). |
|
|
|
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out float **AO** | Strength of Ambient Occlusion. For use with pre-baked AO. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| out float **AO_LIGHT_AFFECT** | How much AO affects lights (0..1; default 0). |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+| out vec3 **EMISSION** | Emission color (can go over 1,1,1 for HDR). |
|
|
|
++-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| sampler2D **SCREEN_TEXTURE** | Built-in Texture for reading from the screen. Mipmaps contain increasingly blurred copies. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| sampler2D **DEPTH_TEXTURE** | Built-in Texture for reading depth from the screen. Must convert to linear using INV_PROJECTION. |
|
|
@@ -263,6 +255,11 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
| in vec2 **POINT_COORD** | Point Coordinate for drawing points with POINT_SIZE. |
|
|
|
+-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+| out float **ALPHA_SCISSOR** | If written to, values below a certain amount of alpha are discarded. |
|
|
|
++-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB color space (true in GLES2, false in GLES3). |
|
|
|
++-----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
+
|
|
|
|
|
|
Light built-ins
|
|
|
^^^^^^^^^^^^^^^
|
|
@@ -291,12 +288,8 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| Built-in | Description |
|
|
|
+===================================+=============================================+
|
|
|
-| in float **TIME** | Elapsed total time in seconds. |
|
|
|
-+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
-+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec4 **FRAGCOORD** | Coordinate of pixel center in screen space. |
|
|
|
-| | ``xy`` specifies position in window, ``z`` |
|
|
|
+| in vec4 **FRAGCOORD** | Coordinate of pixel center. In screen space.|
|
|
|
+| | ``xy`` specifies position in window, ``z`` |
|
|
|
| | specifies fragment depth if ``DEPTH`` is |
|
|
|
| | not used. Origin is lower-left. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
@@ -310,33 +303,30 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| in mat4 **INV_PROJECTION_MATRIX** | Clip space to view space transform. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec3 **NORMAL** | Normal vector, in view space. |
|
|
|
+| in float **TIME** | Elapsed total time in seconds. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec2 **UV** | UV that comes from vertex function. |
|
|
|
+| in vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec2 **UV2** | UV2 that comes from vertex function. |
|
|
|
+| in vec3 **NORMAL** | Normal vector, in view space. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| in vec3 **VIEW** | View vector, in view space. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| in vec3 **LIGHT** | Light Vector, in view space. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec3 **ATTENUATION** | Attenuation based on distance or shadow. |
|
|
|
+| in vec3 **LIGHT_COLOR** | Color of light multiplied by energy. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB |
|
|
|
-| | color space (true in GLES2, false in GLES3).|
|
|
|
+| in vec3 **ATTENUATION** | Attenuation based on distance or shadow. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| in vec3 **ALBEDO** | Base albedo. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec3 **LIGHT_COLOR** | Color of light multiplied by energy. |
|
|
|
-+-----------------------------------+---------------------------------------------+
|
|
|
-| out float **ALPHA** | Alpha (0..1); if written to, the material |
|
|
|
-| | will go to the transparent pipeline. |
|
|
|
+| in vec3 **TRANSMISSION** | Transmission mask. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| in float **ROUGHNESS** | Roughness. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
-| in vec3 **TRANSMISSION** | Transmission mask from fragment function. |
|
|
|
-+-----------------------------------+---------------------------------------------+
|
|
|
| out vec3 **DIFFUSE_LIGHT** | Diffuse light result. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
| out vec3 **SPECULAR_LIGHT** | Specular light result. |
|
|
|
+-----------------------------------+---------------------------------------------+
|
|
|
+| in bool **OUTPUT_IS_SRGB** | True when calculations happen in sRGB |
|
|
|
+| | color space (true in GLES2, false in GLES3).|
|
|
|
++-----------------------------------+---------------------------------------------+
|