|
@@ -11,79 +11,79 @@ write vertex, fragment, and light processor functions to affect how objects are
|
|
Render modes
|
|
Render modes
|
|
^^^^^^^^^^^^
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| Render mode | Description |
|
|
|
|
-+===============================+========================================================================+
|
|
|
|
-| **blend_mix** | Mix blend mode (alpha is transparency), default. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **blend_add** | Additive blend mode. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **blend_sub** | Subtractive blend mode. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **blend_mul** | Multiplicative blend mode. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **depth_draw_opaque** | Only draw depth for opaque geometry (not transparent). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **depth_draw_always** | Always draw depth (opaque and transparent). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **depth_draw_never** | Never draw depth. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **depth_prepass_alpha** | Do opaque depth pre-pass for transparent geometry. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **depth_test_disabled** | Disable depth testing. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **sss_mode_skin** | |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **cull_back** | Cull back-faces (default). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **cull_front** | Cull front-faces. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **cull_disabled** | Culling disabled (double sided). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **wireframe** | Geometry draws using lines. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **diffuse_lambert** | Lambert shading for diffuse (default). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **diffuse_lambert_wrap** | Lambert wrapping (roughness dependent) for diffuse. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **diffuse_burley** | Burley (Disney PBS) for diffuse. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **diffuse_toon** | Toon shading for diffuse. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **specular_schlick_ggx** | Schlick-GGX for specular (default). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **specular_blinn** | Blinn for specular (compatibility). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **specular_phong** | Phong for specular (compatibility). |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **specular_toon** | Toon for specular. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **specular_disabled** | Disable specular. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **skip_vertex_transform** | VERTEX/NORMAL/etc. need to be transformed manually in vertex function. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **world_vertex_coords** | VERTEX/NORMAL/etc. are modified in world coordinates instead of local. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **ensure_correct_normals** | Use when non-uniform scale is applied to mesh. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **shadows_disabled** | Disable computing shadows in shader. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **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_lighting** | Use vertex-based lighting. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **particle_trails** | Enables the trails when used on particles geometry. |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **alpha_to_coverage** | |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
-| **alpha_to_coverage_and_one** | |
|
|
|
|
-+-------------------------------+------------------------------------------------------------------------+
|
|
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| Render mode | Description |
|
|
|
|
++===============================+======================================================================================================+
|
|
|
|
+| **blend_mix** | Mix blend mode (alpha is transparency), default. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **blend_add** | Additive blend mode. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **blend_sub** | Subtractive blend mode. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **blend_mul** | Multiplicative blend mode. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **depth_draw_opaque** | Only draw depth for opaque geometry (not transparent). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **depth_draw_always** | Always draw depth (opaque and transparent). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **depth_draw_never** | Never draw depth. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **depth_prepass_alpha** | Do opaque depth pre-pass for transparent geometry. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **depth_test_disabled** | Disable depth testing. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **sss_mode_skin** | Subsurface Scattering mode for skin. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **cull_back** | Cull back-faces (default). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **cull_front** | Cull front-faces. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **cull_disabled** | Culling disabled (double sided). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **unshaded** | Result is just albedo. No lighting/shading happens in material. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **wireframe** | Geometry draws using lines. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **diffuse_lambert** | Lambert shading for diffuse (default). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **diffuse_lambert_wrap** | Lambert wrapping (roughness dependent) for diffuse. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **diffuse_burley** | Burley (Disney PBS) for diffuse. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **diffuse_toon** | Toon shading for diffuse. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **specular_schlick_ggx** | Schlick-GGX for specular (default). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **specular_blinn** | Blinn for specular (compatibility). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **specular_phong** | Phong for specular (compatibility). |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **specular_toon** | Toon for specular. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **specular_disabled** | Disable specular. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **skip_vertex_transform** | VERTEX/NORMAL/etc. need to be transformed manually in vertex function. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **world_vertex_coords** | VERTEX/NORMAL/etc. are modified in world coordinates instead of local. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **ensure_correct_normals** | Use when non-uniform scale is applied to mesh. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **shadows_disabled** | Disable computing shadows in shader. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **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_lighting** | Use vertex-based lighting. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **particle_trails** | Enables the trails when used on particles geometry. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **alpha_to_coverage** | Alpha antialiasing mode, see `here <https://github.com/godotengine/godot/pull/40364>`_ for more. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
+| **alpha_to_coverage_and_one** | Alpha antialiasing mode, see `here <https://github.com/godotengine/godot/pull/40364>`_ for more. |
|
|
|
|
++-------------------------------+------------------------------------------------------------------------------------------------------+
|
|
|
|
|
|
Built-ins
|
|
Built-ins
|
|
^^^^^^^^^
|
|
^^^^^^^^^
|
|
@@ -178,11 +178,16 @@ shader, this value can be used as desired.
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
| in vec4 **INSTANCE_CUSTOM** | Instance custom data (for particles, mostly). |
|
|
| in vec4 **INSTANCE_CUSTOM** | Instance custom data (for particles, mostly). |
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
-| in int **VIEW_INDEX** | |
|
|
|
|
|
|
+| in int **VIEW_INDEX** | The view that we are rendering. |
|
|
|
|
+| | ``VIEW_MONO_LEFT`` (``0``) for Mono (not multiview) or |
|
|
|
|
+| | left eye, ``VIEW_RIGHT`` (``1``) for right eye. |
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
-| in int **VIEW_MONO_LEFT** | |
|
|
|
|
|
|
+| in int **VIEW_MONO_LEFT** | Constant for Mono or left eye, always ``0``. |
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
-| in int **VIEW_RIGHT** | |
|
|
|
|
|
|
+| in int **VIEW_RIGHT** | Constant for right eye, always ``1``. |
|
|
|
|
++----------------------------------------+--------------------------------------------------------+
|
|
|
|
+| in vec3 **EYE_OFFSET** | Position offset for the eye being rendered. |
|
|
|
|
+| | Only applicable for multiview rendering. |
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
| inout vec3 **VERTEX** | Vertex in local coordinates. |
|
|
| inout vec3 **VERTEX** | Vertex in local coordinates. |
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------+
|
|
@@ -285,11 +290,15 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| in vec3 **VERTEX** | Vertex that comes from vertex function (default, in view space). |
|
|
| in vec3 **VERTEX** | Vertex that comes from vertex function (default, in view space). |
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in int **VIEW_INDEX** | |
|
|
|
|
|
|
+| in int **VIEW_INDEX** | The view that we are rendering. |
|
|
|
|
+| | ``VIEW_MONO_LEFT`` (``0``) for Mono (not multiview) or |
|
|
|
|
+| | left eye, ``VIEW_RIGHT`` (``1``) for right eye. |
|
|
|
|
++----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
|
|
+| in int **VIEW_MONO_LEFT** | Constant for Mono or left eye, always ``0``. |
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in int **VIEW_MONO_LEFT** | |
|
|
|
|
|
|
+| in int **VIEW_RIGHT** | Constant for right eye, always ``1``. |
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
-| in int **VIEW_RIGHT** | |
|
|
|
|
|
|
+| in vec3 **EYE_OFFSET** | Position offset for the eye being rendered. Only applicable for multiview rendering. |
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
| sampler2D **SCREEN_TEXTURE** | Removed in Godot 4. Use a ``sampler2D`` with ``hint_screen_texture`` instead. |
|
|
| sampler2D **SCREEN_TEXTURE** | Removed in Godot 4. Use a ``sampler2D`` with ``hint_screen_texture`` instead. |
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
+----------------------------------------+--------------------------------------------------------------------------------------------------+
|
|
@@ -464,7 +473,7 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_
|
|
for more information and ways to avoid issues.
|
|
for more information and ways to avoid issues.
|
|
|
|
|
|
Transparent materials also cannot cast shadows or appear in
|
|
Transparent materials also cannot cast shadows or appear in
|
|
- ``SCREEN_TEXTURE`` and ``DEPTH_TEXTURE``. This in turn prevents those
|
|
|
|
|
|
+ ``hint_screen_texture`` and ``hint_depth_texture`` uniforms. This in turn prevents those
|
|
materials from appearing in screen-space reflections or refraction.
|
|
materials from appearing in screen-space reflections or refraction.
|
|
:ref:`SDFGI <doc_using_sdfgi>` sharp reflections are not visible on transparent
|
|
:ref:`SDFGI <doc_using_sdfgi>` sharp reflections are not visible on transparent
|
|
materials (only rough reflections are visible on transparent materials).
|
|
materials (only rough reflections are visible on transparent materials).
|