|
@@ -9,7 +9,7 @@ Introduction
|
|
Godot uses a shading language very similar to GLSL ES 3.0. Most datatypes and functions are supported,
|
|
Godot uses a shading language very similar to GLSL ES 3.0. Most datatypes and functions are supported,
|
|
and the remaining will likely be added over time.
|
|
and the remaining will likely be added over time.
|
|
|
|
|
|
-Unlike the shader language in Godot 2.x, this implementaiton is much closer to the original.
|
|
|
|
|
|
+Unlike the shader language in Godot 2.x, this implementation is much closer to the original.
|
|
|
|
|
|
Shader Types
|
|
Shader Types
|
|
------------
|
|
------------
|
|
@@ -60,9 +60,9 @@ Most GLSL ES 3.0 datatypes are supported. Following is the list:
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
| **bvec4** | Four component vector of booleans. |
|
|
| **bvec4** | Four component vector of booleans. |
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
-| **int** | Signed scalar integer |
|
|
|
|
|
|
+| **int** | Signed scalar integer. |
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
-| **ivec2** | Two component vector of signed integers |
|
|
|
|
|
|
+| **ivec2** | Two component vector of signed integers. |
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
| **ivec3** | Three component vector of signed integers. |
|
|
| **ivec3** | Three component vector of signed integers. |
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
+-----------------+---------------------------------------------------------------------------+
|
|
@@ -103,7 +103,7 @@ Most GLSL ES 3.0 datatypes are supported. Following is the list:
|
|
Casting
|
|
Casting
|
|
~~~~~~~
|
|
~~~~~~~
|
|
|
|
|
|
-Just like GLSL ES 3.0, implicit castling is not allowed between scalars and vectors of the same size but different type.
|
|
|
|
|
|
+Just like GLSL ES 3.0, implicit casting is not allowed between scalars and vectors of the same size but different type.
|
|
Casting of types of different size is also not allowed. Conversion must be done explicitly via constructors.
|
|
Casting of types of different size is also not allowed. Conversion must be done explicitly via constructors.
|
|
|
|
|
|
Example:
|
|
Example:
|
|
@@ -126,7 +126,7 @@ Members
|
|
~~~~~~~
|
|
~~~~~~~
|
|
|
|
|
|
Individual scalar members of vector types are accessed via the "x", "y", "z" and "w" members. Alternatively, using "r", "g", "b" and "a" also works and is equivalent.
|
|
Individual scalar members of vector types are accessed via the "x", "y", "z" and "w" members. Alternatively, using "r", "g", "b" and "a" also works and is equivalent.
|
|
-Use whathever fits best for your use case.
|
|
|
|
|
|
+Use whatever fits best for your use case.
|
|
|
|
|
|
For matrices, use [idx] indexing syntax to access each vector.
|
|
For matrices, use [idx] indexing syntax to access each vector.
|
|
|
|
|
|
@@ -152,6 +152,7 @@ It is possible to obtain any combination of them in any order, as long as the re
|
|
This is easier shown than explained:
|
|
This is easier shown than explained:
|
|
|
|
|
|
.. code-block:: glsl
|
|
.. code-block:: glsl
|
|
|
|
+
|
|
vec4 a = vec4(0.0, 1.0, 2.0, 3.0);
|
|
vec4 a = vec4(0.0, 1.0, 2.0, 3.0);
|
|
vec3 b = a.rgb; // Creates a vec3 with vec4 components
|
|
vec3 b = a.rgb; // Creates a vec3 with vec4 components
|
|
vec3 b = a.aaa; // Also valid, creates a vec3 and fills it with "a".
|
|
vec3 b = a.aaa; // Also valid, creates a vec3 and fills it with "a".
|
|
@@ -174,9 +175,9 @@ It is possible to add precision modifiers to datatypes, use them for uniforms, v
|
|
Using lower precision for some operations can speed up the math involved (at the cost of, of course, less precision).
|
|
Using lower precision for some operations can speed up the math involved (at the cost of, of course, less precision).
|
|
This is rarely needed in the vertex shader (where full precision is needed most of the time), but often needed in the fragment one.
|
|
This is rarely needed in the vertex shader (where full precision is needed most of the time), but often needed in the fragment one.
|
|
|
|
|
|
-Keep in mind that some architectures (mainly mobile) benefit a lot on this, but are also restricted (conversion between precisions has a cost).
|
|
|
|
|
|
+Keep in mind that some architectures (mainly mobile) benefit a lot from this, but are also restricted (conversion between precisions has a cost).
|
|
Please read the relevant documentation on the target architecture to find out more. In all honesty though, mobile drivers are really buggy
|
|
Please read the relevant documentation on the target architecture to find out more. In all honesty though, mobile drivers are really buggy
|
|
-so just stay out of trouble and make simple shaders without specifying precission unless you *really* need to.
|
|
|
|
|
|
+so just stay out of trouble and make simple shaders without specifying precision unless you *really* need to.
|
|
|
|
|
|
Operators:
|
|
Operators:
|
|
----------
|
|
----------
|
|
@@ -186,7 +187,7 @@ Godot shading language supports the same set of operators as GLSL ES 3.0. Below
|
|
+-------------+-----------------------+--------------------+
|
|
+-------------+-----------------------+--------------------+
|
|
| Precedence | Class | Operator |
|
|
| Precedence | Class | Operator |
|
|
+-------------+-----------------------+--------------------+
|
|
+-------------+-----------------------+--------------------+
|
|
-| 1 (highest) | parenthical grouping | **()** |
|
|
|
|
|
|
+| 1 (highest) | parenthetical grouping| **()** |
|
|
+-------------+-----------------------+--------------------+
|
|
+-------------+-----------------------+--------------------+
|
|
| 2 | unary | **+, -, !, ~** |
|
|
| 2 | unary | **+, -, !, ~** |
|
|
+-------------+-----------------------+--------------------+
|
|
+-------------+-----------------------+--------------------+
|
|
@@ -286,7 +287,7 @@ Processor Functions
|
|
|
|
|
|
Depending on shader type, processor functions may be available to optionally override.
|
|
Depending on shader type, processor functions may be available to optionally override.
|
|
For "spatial" and "canvas_item", it is possible to override "vertex", "fragment" and "light".
|
|
For "spatial" and "canvas_item", it is possible to override "vertex", "fragment" and "light".
|
|
-For "particles", only "vertex" can be overriden.
|
|
|
|
|
|
+For "particles", only "vertex" can be overridden.
|
|
|
|
|
|
Vertex Processor
|
|
Vertex Processor
|
|
~~~~~~~~~~~~~~~~~
|
|
~~~~~~~~~~~~~~~~~
|
|
@@ -309,7 +310,7 @@ vertex functions are not that commonly used.
|
|
Fragment Processor
|
|
Fragment Processor
|
|
~~~~~~~~~~~~~~~~~~
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
-The "fragent" processor is used to set up the Godot material parameters per pixel. This code
|
|
|
|
|
|
+The "fragment" processor is used to set up the Godot material parameters per pixel. This code
|
|
runs on every visible pixel the object or primitive is drawn to.
|
|
runs on every visible pixel the object or primitive is drawn to.
|
|
|
|
|
|
.. code-block:: glsl
|
|
.. code-block:: glsl
|
|
@@ -361,7 +362,7 @@ Uniforms
|
|
|
|
|
|
Passing values to shaders is possible. These are global to the whole shader and called *uniforms*.
|
|
Passing values to shaders is possible. These are global to the whole shader and called *uniforms*.
|
|
When a shader is later assigned to a material, the uniforms will appear as editable parameters on it.
|
|
When a shader is later assigned to a material, the uniforms will appear as editable parameters on it.
|
|
-Uniforms can't be written from within the shadr.
|
|
|
|
|
|
+Uniforms can't be written from within the shader.
|
|
|
|
|
|
.. code-block:: glsl
|
|
.. code-block:: glsl
|
|
|
|
|
|
@@ -379,7 +380,7 @@ to make the compiler understand what the uniform is used for.
|
|
shader_type spatial;
|
|
shader_type spatial;
|
|
|
|
|
|
uniform vec4 color : hint_color;
|
|
uniform vec4 color : hint_color;
|
|
- uniform float amonut : hint_range(0,1);
|
|
|
|
|
|
+ uniform float amount : hint_range(0,1);
|
|
|
|
|
|
|
|
|
|
Full list of hints below:
|
|
Full list of hints below:
|
|
@@ -424,8 +425,8 @@ Uniforms can also be assigned default values:
|
|
Built-in Functions
|
|
Built-in Functions
|
|
------------------
|
|
------------------
|
|
|
|
|
|
-A large amount of built-in functions is supported, confirming mostly to GLSL ES 3.0.
|
|
|
|
-When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type, nomenclature is used, it can be scalar or vcetor.
|
|
|
|
|
|
+A large number of built-in functions are supported, conforming mostly to GLSL ES 3.0.
|
|
|
|
+When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type nomenclature is used, it can be scalar or vector.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -485,7 +486,7 @@ When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type, nomenclature
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| vec\_type **min** ( vec\_type,vec\_type ) | Minimum |
|
|
| vec\_type **min** ( vec\_type,vec\_type ) | Minimum |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec\_type **min** ( vec\_type,vec\_type ) | Maximum |
|
|
|
|
|
|
+| vec\_type **max** ( vec\_type,vec\_type ) | Maximum |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| vec\_type **clamp** ( vec\_type value,vec\_type min, vec\_type max ) | Clamp to Min-Max |
|
|
| vec\_type **clamp** ( vec\_type value,vec\_type min, vec\_type max ) | Clamp to Min-Max |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
@@ -539,13 +540,13 @@ When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type, nomenclature
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| vec\_bool_type **greaterThan** ( vec_scalar_type ) | Bool vector cmp on > int/uint/float vectors |
|
|
| vec\_bool_type **greaterThan** ( vec_scalar_type ) | Bool vector cmp on > int/uint/float vectors |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec\_bool_type **lessThanEqual** ( vec_scalar_type ) | Bool vector cmp on <=int/uint/float vectors |
|
|
|
|
|
|
+| vec\_bool_type **lessThanEqual** ( vec_scalar_type ) | Bool vector cmp on <= int/uint/float vectors|
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec\_bool_type **greaterThanEqual** ( vec_scalar_type ) | Bool vector cmp on >=int/uint/float vectors |
|
|
|
|
|
|
+| vec\_bool_type **greaterThanEqual** ( vec_scalar_type ) | Bool vector cmp on >= int/uint/float vectors|
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec\_bool_type **equal** ( vec_scalar_type ) | Bool vector cmp on ==int/uint/float vectors |
|
|
|
|
|
|
+| vec\_bool_type **equal** ( vec_scalar_type ) | Bool vector cmp on == int/uint/float vectors|
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec\_bool_type **notEqual** ( vec_scalar_type ) | Bool vector cmp on !=int/uint/float vectors |
|
|
|
|
|
|
+| vec\_bool_type **notEqual** ( vec_scalar_type ) | Bool vector cmp on != int/uint/float vectors|
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| bool **any** ( vec_bool_type ) | Any component is true |
|
|
| bool **any** ( vec_bool_type ) | Any component is true |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
@@ -559,7 +560,7 @@ When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type, nomenclature
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| vec4_type **texture** ( sampler2D_type s, vec2 uv [, float bias]) | Perform a 2D texture read |
|
|
| vec4_type **texture** ( sampler2D_type s, vec2 uv [, float bias]) | Perform a 2D texture read |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
-| vec4 **texture** ( samplerCube s, vec3 uv [, float bias]) | Perform a Cube texture read |
|
|
|
|
|
|
+| vec4_type **texture** ( samplerCube s, vec3 uv [, float bias]) | Perform a Cube texture read |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
| vec4_type **textureProj** ( sampler2d_type s, vec3 uv [, float bias]) | Perform a texture read with projection |
|
|
| vec4_type **textureProj** ( sampler2d_type s, vec3 uv [, float bias]) | Perform a texture read with projection |
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
+-----------------------------------------------------------------------+---------------------------------------------+
|
|
@@ -588,7 +589,7 @@ Shader Types In-Depth
|
|
Spatial
|
|
Spatial
|
|
~~~~~~~
|
|
~~~~~~~
|
|
|
|
|
|
-Accepted render modes and build-ins for "shader_type spatial;".
|
|
|
|
|
|
+Accepted render modes and built-ins for "shader_type spatial;".
|
|
|
|
|
|
Render Modes
|
|
Render Modes
|
|
^^^^^^^^^^^^
|
|
^^^^^^^^^^^^
|
|
@@ -604,7 +605,7 @@ Render Modes
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **blend_mul** | Multiplicative blend mode. |
|
|
| **blend_mul** | Multiplicative blend mode. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **depth_draw_opaque** | Only draw depth for opaque geometry (not trasparent). |
|
|
|
|
|
|
+| **depth_draw_opaque** | Only draw depth for opaque geometry (not transparent). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **depth_draw_always** | Always draw depth (opaque and transparent). |
|
|
| **depth_draw_always** | Always draw depth (opaque and transparent). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
@@ -618,31 +619,31 @@ Render Modes
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **cull_back** | Cull back-faces (default). |
|
|
| **cull_back** | Cull back-faces (default). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **cull_disabled** | Culling disabled (double sided) |
|
|
|
|
|
|
+| **cull_disabled** | Culling disabled (double sided). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **diffuse_lambert** | Lambert shading for diffuse (default) |
|
|
|
|
|
|
+| **diffuse_lambert** | Lambert shading for diffuse (default). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **diffuse_lambert_wrap** | Lambert wrapping (roughness dependent) for diffuse. |
|
|
| **diffuse_lambert_wrap** | Lambert wrapping (roughness dependent) for diffuse. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **diffuse_oren_nayar** | Oren nayar for diffuse. |
|
|
|
|
|
|
+| **diffuse_oren_nayar** | Oren Nayar for diffuse. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **diffuse_burley** | Burley (Disney PBS) for diffuse. |
|
|
| **diffuse_burley** | Burley (Disney PBS) for diffuse. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **diffuse toon** | Toon shading for diffuse. |
|
|
| **diffuse toon** | Toon shading for diffuse. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **specular_schlick_ggx** | Schick-GGX for specular (default) |
|
|
|
|
|
|
+| **specular_schlick_ggx** | Schlick-GGX for specular (default). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **specular_blinn** | Blinn for specular (compatibility) |
|
|
|
|
|
|
+| **specular_blinn** | Blinn for specular (compatibility). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **specular_phong** | Phong for specular (compatibility) |
|
|
|
|
|
|
+| **specular_phong** | Phong for specular (compatibility). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **specular_toon** | Toon for specular. |
|
|
| **specular_toon** | Toon for specular. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **skip_vertex_transform** | VERTEX/NORMAL/etc need to be transformed manually in VS. |
|
|
| **skip_vertex_transform** | VERTEX/NORMAL/etc need to be transformed manually in VS. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **world_vertex_coords** | VERTEX/NORMAL/etc are modified in world coordinates instead of local |
|
|
|
|
|
|
+| **world_vertex_coords** | VERTEX/NORMAL/etc are modified in world coordinates instead of local.|
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **vertex_lighting** | Use vertex-based lighting. |
|
|
| **vertex_lighting** | Use vertex-based lighting. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
@@ -658,11 +659,11 @@ Vertex Built-Ins
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
| mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
-| mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
|
|
|
|
+| mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
| mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
-| mat4 **MODELVIEW_MATRIX** | Model space to view space transform (use if possible) |
|
|
|
|
|
|
+| mat4 **MODELVIEW_MATRIX** | Model space to view space transform (use if possible).|
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| mat4 **INV_PROJECTION_MATRIX** | Clip space to view space transform. |
|
|
| mat4 **INV_PROJECTION_MATRIX** | Clip space to view space transform. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
@@ -670,7 +671,7 @@ Vertex Built-Ins
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
| vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
-| vec3 **VERTEX** | Vertex in local coords (see doc below) |
|
|
|
|
|
|
+| vec3 **VERTEX** | Vertex in local coords (see doc below). |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| vec3 **NORMAL** | Normal in local coords. |
|
|
| vec3 **NORMAL** | Normal in local coords. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
@@ -688,7 +689,7 @@ Vertex Built-Ins
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| int **INSTANCE_ID** | Instance ID for instancing. |
|
|
| int **INSTANCE_ID** | Instance ID for instancing. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
-| vec4 **INSTANCE_CUSTOM** | Instance custom data (for particles, mostly) |
|
|
|
|
|
|
+| vec4 **INSTANCE_CUSTOM** | Instance custom data (for particles, mostly). |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
| float **ROUGHNESS** | Roughness for vertex lighting. |
|
|
| float **ROUGHNESS** | Roughness for vertex lighting. |
|
|
+----------------------------------+-------------------------------------------------------+
|
|
+----------------------------------+-------------------------------------------------------+
|
|
@@ -739,7 +740,7 @@ Fragment Built-Ins
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
| in mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
|
|
|
|
+| in mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
| in mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
@@ -749,7 +750,7 @@ Fragment Built-Ins
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
| vec2 **VIEWPORT_SIZE** | Size of viewport (in pixels). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| vec3 **VERTEX** | Vertex that comes from vertex function, in view space. |
|
|
|
|
|
|
+| vec3 **VERTEX** | Vertex that comes from vertex function, in view space. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in vec4 **FRAGCOORD** | Fragment cordinate, pixel adjusted. |
|
|
| in vec4 **FRAGCOORD** | Fragment cordinate, pixel adjusted. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
@@ -763,27 +764,27 @@ Fragment Built-Ins
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out vec3 **NORMALMAP** | Output this if reading normal from a texture instead of NORMAL. |
|
|
| out vec3 **NORMALMAP** | Output this if reading normal from a texture instead of NORMAL. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **NORMALMAP_DEPTH** | Depth from variable avobe. Defaults to 1.0. |
|
|
|
|
|
|
+| out float **NORMALMAP_DEPTH** | Depth from variable above. Defaults to 1.0. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in vec2 **UV** | UV that comes from vertex frunction. |
|
|
|
|
|
|
+| in vec2 **UV** | UV that comes from vertex function. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in vec2 **UV2** | UV2 that coems from vertex function. |
|
|
| in vec2 **UV2** | UV2 that coems from vertex function. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in vec4 **COLOR** | COLOR that comes from vertex function. |
|
|
| in vec4 **COLOR** | COLOR that comes from vertex function. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out vec3 **ALBEDO** | Albedo (default white) |
|
|
|
|
|
|
+| out vec3 **ALBEDO** | Albedo (default white). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out float **ALPHA** | Alpha (0..1), if written to the material will go to transparent pipeline. |
|
|
| out float **ALPHA** | Alpha (0..1), if written to the material will go to transparent pipeline. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **METALLIC** | Metallic (0..1) |
|
|
|
|
|
|
+| out float **METALLIC** | Metallic (0..1). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out float **SPECULAR** | Specular. Defaults to 0.5, best to not modify unless you want to change IOR. |
|
|
| out float **SPECULAR** | Specular. Defaults to 0.5, best to not modify unless you want to change IOR. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **ROUGHNESS** | Roughness (0..1) |
|
|
|
|
|
|
+| out float **ROUGHNESS** | Roughness (0..1). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **RIM** | Rim (0..1) |
|
|
|
|
|
|
+| out float **RIM** | Rim (0..1). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **RIM_TINT** | Rim Tint, goes from 0 (white) to 1 (albedo) |
|
|
|
|
|
|
+| out float **RIM_TINT** | Rim Tint, goes from 0 (white) to 1 (albedo). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out float **CLEARCOAT** | Small added specular blob. |
|
|
| out float **CLEARCOAT** | Small added specular blob. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
@@ -793,19 +794,19 @@ Fragment Built-Ins
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out float **ANISOTROPY_FLOW** | Distortion direction, use with flowmaps. |
|
|
| out float **ANISOTROPY_FLOW** | Distortion direction, use with flowmaps. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **SSS_STRENGTH** | Strength of Subsurface Scattering (default 0) |
|
|
|
|
|
|
+| out float **SSS_STRENGTH** | Strength of Subsurface Scattering (default 0). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out vec3 **TRANSMISSION** | Transmission mask (default 0,0,0). |
|
|
| out vec3 **TRANSMISSION** | Transmission mask (default 0,0,0). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| out foat **AO** | Ambient Occlusion (pre-baked). |
|
|
| out foat **AO** | Ambient Occlusion (pre-baked). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out float **AO_LIGHT_AFFECT** | How much AO affects lights (0..1. defalt 0, none) |
|
|
|
|
|
|
+| out float **AO_LIGHT_AFFECT** | How much AO affects lights (0..1. default 0, none). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| out vec3 **EMISSION** | Emission color (can go over 1,1,1 for HDR) |
|
|
|
|
|
|
+| out vec3 **EMISSION** | Emission color (can go over 1,1,1 for HDR). |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in sampler2D **SCREEN_TEXTURE** | Built-in Texture for reading from the screen. Mipmaps contain increasingly blurred copies. |
|
|
| in sampler2D **SCREEN_TEXTURE** | Built-in Texture for reading from the screen. Mipmaps contain increasingly blurred copies. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in sampler2D **DEPTH_TEXTURE** | Built-in Textue for reading depth from the screen. Must convert to linear using INV_PROJECTION. |
|
|
|
|
|
|
+| in sampler2D **DEPTH_TEXTURE** | Built-in Texture for reading depth from the screen. Must convert to linear using INV_PROJECTION. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in vec2 **SCREEN_UV** | Screen UV coordinate for current pixel. |
|
|
| in vec2 **SCREEN_UV** | Screen UV coordinate for current pixel. |
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------+--------------------------------------------------------------------------------------------------+
|
|
@@ -822,46 +823,46 @@ Values marked as "in" are read-only. Values marked as "out" are for optional wri
|
|
Light Built-Ins
|
|
Light Built-Ins
|
|
^^^^^^^^^^^^^^^
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| Built-in | Description |
|
|
|
|
-+==================================+==========================================+
|
|
|
|
-| in mat4 **WORLD_MATRIX** | Model space to world space transform. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| 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 **NORMAL** | Normal vector. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **VIEW** | View vector. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **LIGHT** | Light Vector. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **LIGHT_COLOR** | Color of light multipled by energy. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **ATTENUATION** | Attenuation based on distance or shadow. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **ALBEDO** | Base albedo. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in vec3 **TRANSMISSION** | Transmission mask. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| in float **ROUGHNESS** | Roughness. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| out vec3 **DIFFUSE_LIGHT** | Diffuse light result. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-| out vec3 **SPECULAR_LIGHT** | Specular light result. |
|
|
|
|
-+----------------------------------+------------------------------------------+
|
|
|
|
-
|
|
|
|
-Writing light shaders is completely optional. Unlike other game engines, they dont affect
|
|
|
|
-performacne or force a specific pipeline.
|
|
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| Built-in | Description |
|
|
|
|
++===================================+==========================================+
|
|
|
|
+| in mat4 **WORLD_MATRIX** | Model space to world space transform. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in mat4 **INV_CAMERA_MATRIX** | World space to view space transform. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in mat4 **PROJECTION_MATRIX** | View space to clip space transform. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in mat4 **CAMERA_MATRIX** | View space to world space transform. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| 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 **NORMAL** | Normal vector. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **VIEW** | View vector. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **LIGHT** | Light Vector. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **LIGHT_COLOR** | Color of light multiplied by energy. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **ATTENUATION** | Attenuation based on distance or shadow. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **ALBEDO** | Base albedo. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in vec3 **TRANSMISSION** | Transmission mask. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| in float **ROUGHNESS** | Roughness. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| out vec3 **DIFFUSE_LIGHT** | Diffuse light result. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+| out vec3 **SPECULAR_LIGHT** | Specular light result. |
|
|
|
|
++-----------------------------------+------------------------------------------+
|
|
|
|
+
|
|
|
|
+Writing light shaders is completely optional. Unlike other game engines, they don't affect
|
|
|
|
+performance or force a specific pipeline.
|
|
|
|
|
|
To write a light shader, simply make sure to assign something to DIFFUSE_LIGHT or SPECULAR_LIGHT.
|
|
To write a light shader, simply make sure to assign something to DIFFUSE_LIGHT or SPECULAR_LIGHT.
|
|
Assigning nothing means no light is processed.
|
|
Assigning nothing means no light is processed.
|
|
@@ -870,7 +871,7 @@ Assigning nothing means no light is processed.
|
|
Canvas Item
|
|
Canvas Item
|
|
~~~~~~~~~~~~
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
-Accepted render modes and build-ins for "shader_type canvas_item;".
|
|
|
|
|
|
+Accepted render modes and built-ins for "shader_type canvas_item;".
|
|
|
|
|
|
Render Modes
|
|
Render Modes
|
|
^^^^^^^^^^^^
|
|
^^^^^^^^^^^^
|
|
@@ -882,7 +883,7 @@ Render Modes
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **blend_add** | Additive blend mode. |
|
|
| **blend_add** | Additive blend mode. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **blend_sub** | Substractive blend mode. |
|
|
|
|
|
|
+| **blend_sub** | Subtractive blend mode. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **blend_mul** | Multiplicative blend mode. |
|
|
| **blend_mul** | Multiplicative blend mode. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
@@ -890,7 +891,7 @@ Render Modes
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
-| **light_only** | Only draw for light pass (when multipass is used) |
|
|
|
|
|
|
+| **light_only** | Only draw for light pass (when multipass is used). |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
| **skip_vertex_transform** | VERTEX/NORMAL/etc need to be transformed manually in VS. |
|
|
| **skip_vertex_transform** | VERTEX/NORMAL/etc need to be transformed manually in VS. |
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
+---------------------------------+----------------------------------------------------------------------+
|
|
@@ -903,7 +904,7 @@ Vertex Built-Ins
|
|
+================================+================================================================+
|
|
+================================+================================================================+
|
|
| in mat4 **WORLD_MATRIX** | Image to World transform. |
|
|
| in mat4 **WORLD_MATRIX** | Image to World transform. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
-| in mat4 **EXTRA_MATRIX** | Extra transform |
|
|
|
|
|
|
+| in mat4 **EXTRA_MATRIX** | Extra transform. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
| in mat4 **PROJECTION_MATRIX** | World to view transform. |
|
|
| in mat4 **PROJECTION_MATRIX** | World to view transform. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
@@ -915,7 +916,7 @@ Vertex Built-Ins
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
| inout vec2 **VERTEX** | Vertex in image space. |
|
|
| inout vec2 **VERTEX** | Vertex in image space. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
-| inout vec2 **UV** | UV |
|
|
|
|
|
|
+| inout vec2 **UV** | UV. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
| inout vec4 **COLOR** | Color from vertex primitive. |
|
|
| inout vec4 **COLOR** | Color from vertex primitive. |
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
+--------------------------------+----------------------------------------------------------------+
|
|
@@ -953,12 +954,12 @@ This allows to easily adjust the shader to a particle system using default parti
|
|
shader, this value can be used as desired.
|
|
shader, this value can be used as desired.
|
|
|
|
|
|
Fragment Built-Ins
|
|
Fragment Built-Ins
|
|
-^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
+^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
+----------------------------------+------------------------------------------------------------+
|
|
+----------------------------------+------------------------------------------------------------+
|
|
| Built-In | Description |
|
|
| Built-In | Description |
|
|
+==================================+============================================================+
|
|
+==================================+============================================================+
|
|
-| in vec4 **FRAGCOORD** | Fragment cordinate, pixel adjusted. |
|
|
|
|
|
|
+| in vec4 **FRAGCOORD** | Fragment coordinate, pixel adjusted. |
|
|
+----------------------------------+------------------------------------------------------------+
|
|
+----------------------------------+------------------------------------------------------------+
|
|
| out vec3 **NORMAL** | Normal, writable. |
|
|
| out vec3 **NORMAL** | Normal, writable. |
|
|
+----------------------------------+------------------------------------------------------------+
|
|
+----------------------------------+------------------------------------------------------------+
|
|
@@ -993,44 +994,44 @@ Light Built-Ins
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
| Built-In | Description |
|
|
| Built-In | Description |
|
|
+=====================================+===============================================================================+
|
|
+=====================================+===============================================================================+
|
|
-| in vec4 **POSITION** | Screen Position |
|
|
|
|
|
|
+| in vec4 **POSITION** | Screen Position. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec3 **NORMAL** | Input Normal |
|
|
|
|
|
|
+| in vec3 **NORMAL** | Input Normal. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec2 **UV** | UV |
|
|
|
|
|
|
+| in vec2 **UV** | UV. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec4 **COLOR** | Input Color |
|
|
|
|
|
|
+| in vec4 **COLOR** | Input Color. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in sampler2D **TEXTURE** | Current texture in use for CanvasItem |
|
|
|
|
|
|
+| in sampler2D **TEXTURE** | Current texture in use for CanvasItem. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec2 **TEXTURE_PIXEL_SIZE** | Pixel size for current 2D texture |
|
|
|
|
|
|
+| in vec2 **TEXTURE_PIXEL_SIZE** | Pixel size for current 2D texture. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec2 **SCREEN_UV** | Screen Texture Coordinate (for using with texscreen) |
|
|
|
|
|
|
+| in vec2 **SCREEN_UV** | Screen Texture Coordinate (for using with texscreen). |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec2 **POINT_COORD** | Current UV for Point Sprite |
|
|
|
|
|
|
+| in vec2 **POINT_COORD** | Current UV for Point Sprite. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in float **TIME** | Time (in seconds) |
|
|
|
|
|
|
+| in float **TIME** | Time (in seconds). |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
| vec2 **LIGHT\_VEC** | Vector from light to fragment, can be modified to alter shadow computation. |
|
|
| vec2 **LIGHT\_VEC** | Vector from light to fragment, can be modified to alter shadow computation. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in float **LIGHT\_HEIGHT** | Height of Light |
|
|
|
|
|
|
+| in float **LIGHT\_HEIGHT** | Height of Light. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in color **LIGHT\_COLOR** | Color of Light |
|
|
|
|
|
|
+| in color **LIGHT\_COLOR** | Color of Light. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in color **LIGHT\_SHADOW\_COLOR** | Color of Light shadow |
|
|
|
|
|
|
+| in color **LIGHT\_SHADOW\_COLOR** | Color of Light shadow. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec2 **LIGHT\_UV** | UV for light image |
|
|
|
|
|
|
+| in vec2 **LIGHT\_UV** | UV for light image. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| in vec4 **SHADOW** | Light shadow color override |
|
|
|
|
|
|
+| in vec4 **SHADOW** | Light shadow color override. |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
-| out vec4 **LIGHT** | Light Output (shader is ignored if this is not used) |
|
|
|
|
|
|
+| out vec4 **LIGHT** | Light Output (shader is ignored if this is not used). |
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
+-------------------------------------+-------------------------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
Particles
|
|
Particles
|
|
~~~~~~~~~
|
|
~~~~~~~~~
|
|
|
|
|
|
-Accepted render modes and build-ins for "shader_type particles;".
|
|
|
|
|
|
+Accepted render modes and built-ins for "shader_type particles;".
|
|
|
|
|
|
Render Modes
|
|
Render Modes
|
|
^^^^^^^^^^^^
|
|
^^^^^^^^^^^^
|
|
@@ -1053,7 +1054,7 @@ Vertex Built-Ins
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
| inout vec3 **VELOCITY** | Particle velocity, can be modified. |
|
|
| inout vec3 **VELOCITY** | Particle velocity, can be modified. |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
-| out float **MASS** | Particle mass, use for attractors (default 1) |
|
|
|
|
|
|
+| out float **MASS** | Particle mass, use for attractors (default 1). |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
| inout bool **ACTIVE** | Particle is active, can be set to false. |
|
|
| inout bool **ACTIVE** | Particle is active, can be set to false. |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
@@ -1071,7 +1072,7 @@ Vertex Built-Ins
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
| in int **INDEX** | Particle index (from total particles). |
|
|
| in int **INDEX** | Particle index (from total particles). |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
-| in mat4 **EMISSION_TRANSFORM** | Emitter transform (used for non-local systems) |
|
|
|
|
|
|
+| in mat4 **EMISSION_TRANSFORM** | Emitter transform (used for non-local systems). |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
| in uint **RANDOM_SEED** | Random seed used as base for random. |
|
|
| in uint **RANDOM_SEED** | Random seed used as base for random. |
|
|
+---------------------------------+-----------------------------------------------------------+
|
|
+---------------------------------+-----------------------------------------------------------+
|