ソースを参照

Merge pull request #5416 from Chaosus/fix_shader_bugs2

Yuri Roubinsky 3 年 前
コミット
38782c0cb9

+ 18 - 18
tutorials/shaders/shader_reference/canvas_item_shader.rst

@@ -144,24 +144,6 @@ is usually:
 | inout float **POINT_SIZE**     | Point size for point drawing.                     |
 +--------------------------------+---------------------------------------------------+
 
-SDF functions
-^^^^^^^^^^^^^
-
-There are some functions implemented to support a SDF (Signed Distance Field) feature.
-They are available for Fragment and Light functions of CanvasItem shader.
-
-+-----------------------------------------------+----------------------------------------+
-| Function                                      | Description                            |
-+===============================================+========================================+
-| float **texture_sdf** (vec2 sdf_pos)          | Performs an SDF texture lookup.        |
-+-----------------------------------------------+----------------------------------------+
-| vec2 **texture_sdf_normal** (vec2 sdf_pos)    | Performs an SDF normal texture lookup. |
-+-----------------------------------------------+----------------------------------------+
-| vec2 **sdf_to_screen_uv** (vec2 sdf_pos)      | Converts a SDF to screen UV.           |
-+-----------------------------------------------+----------------------------------------+
-| vec2 **screen_uv_to_sdf** (vec2 uv)           | Converts screen UV to a SDF.           |
-+-----------------------------------------------+----------------------------------------+
-
 Fragment built-ins
 ^^^^^^^^^^^^^^^^^^
 
@@ -280,3 +262,21 @@ When the shader is on a light pass, the ``AT_LIGHT_PASS`` variable will be ``tru
 +--------------------------------+------------------------------------------------------------------------------+
 | out vec4 **SHADOW_MODULATE**   |                                                                              |
 +--------------------------------+------------------------------------------------------------------------------+
+
+SDF functions
+^^^^^^^^^^^^^
+
+There are a few additional functions implemented to support an SDF (Signed Distance Field) feature.
+They are available for Fragment and Light functions of CanvasItem shader.
+
++-----------------------------------------------+----------------------------------------+
+| Function                                      | Description                            |
++===============================================+========================================+
+| float **texture_sdf** (vec2 sdf_pos)          | Performs an SDF texture lookup.        |
++-----------------------------------------------+----------------------------------------+
+| vec2 **texture_sdf_normal** (vec2 sdf_pos)    | Performs an SDF normal texture lookup. |
++-----------------------------------------------+----------------------------------------+
+| vec2 **sdf_to_screen_uv** (vec2 sdf_pos)      | Converts a SDF to screen UV.           |
++-----------------------------------------------+----------------------------------------+
+| vec2 **screen_uv_to_sdf** (vec2 uv)           | Converts screen UV to a SDF.           |
++-----------------------------------------------+----------------------------------------+

+ 3 - 1
tutorials/shaders/shader_reference/particle_shader.rst

@@ -31,7 +31,7 @@ Render modes
 +=================================+======================================================================+
 | **keep_data**                   | Do not clear previous data on restart.                               |
 +---------------------------------+----------------------------------------------------------------------+
-| **disable_force**               | Disable attractor force. (Not currently implemented in 3.1)          |
+| **disable_force**               | Disable attractor force.                                             |
 +---------------------------------+----------------------------------------------------------------------+
 | **disable_velocity**            | Ignore **VELOCITY** value.                                           |
 +---------------------------------+----------------------------------------------------------------------+
@@ -122,6 +122,8 @@ Process built-ins
 +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
 | Built-in                           | Description                                                                                                                             |
 +====================================+=========================================================================================================================================+
+| in bool **RESTART**                | ``true`` if the current process frame is first for the particle.                                                                        |
++------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
 | in uint **FLAG_EMIT_POSITION**     | A flag for using on the last argument of ``emit_subparticle`` function to assign a position to a new particle's transform.              |
 +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
 | in uint **FLAG_EMIT_ROT_SCALE**    | A flag for using on the last argument of ``emit_subparticle`` function to assign the rotation and scale to a new particle's transform.  |

+ 1 - 1
tutorials/shaders/shader_reference/sky_shader.rst

@@ -122,7 +122,7 @@ There are 4 ``LIGHTX`` lights, accessed as ``LIGHT0``, ``LIGHT1``, ``LIGHT2``, a
 +---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
 | in vec3 **POSITION**            | Camera position in world space                                                                                           |
 +---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
-| SamplerCube **RADIANCE**        | Radiance cubemap. Can only be read from during background pass. Check ``!AT_CUBEMAP_PASS`` before using.                 |
+| samplerCube **RADIANCE**        | Radiance cubemap. Can only be read from during background pass. Check ``!AT_CUBEMAP_PASS`` before using.                 |
 +---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
 | in bool **AT_HALF_RES_PASS**    | Currently rendering to half resolution pass.                                                                             |
 +---------------------------------+--------------------------------------------------------------------------------------------------------------------------+

+ 12 - 2
tutorials/shaders/shader_reference/spatial_shader.rst

@@ -169,6 +169,12 @@ shader, this value can be used as desired.
 +----------------------------------------+--------------------------------------------------------+
 | in vec4 **INSTANCE_CUSTOM**            | Instance custom data (for particles, mostly).          |
 +----------------------------------------+--------------------------------------------------------+
+| in int **VIEW_INDEX**                  |                                                        |
++----------------------------------------+--------------------------------------------------------+
+| in int **VIEW_MONO_LEFT**              |                                                        |
++----------------------------------------+--------------------------------------------------------+
+| in int **VIEW_RIGHT**                  |                                                        |
++----------------------------------------+--------------------------------------------------------+
 | inout vec3 **VERTEX**                  | Vertex in local coordinates.                           |
 +----------------------------------------+--------------------------------------------------------+
 | inout vec3 **NORMAL**                  | Normal in local coordinates.                           |
@@ -255,6 +261,12 @@ 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 int **VIEW_INDEX**                     |                                                                                                  |
++-------------------------------------------+--------------------------------------------------------------------------------------------------+
+| in int **VIEW_MONO_LEFT**                 |                                                                                                  |
++-------------------------------------------+--------------------------------------------------------------------------------------------------+
+| in int **VIEW_RIGHT**                     |                                                                                                  |
++-------------------------------------------+--------------------------------------------------------------------------------------------------+
 | sampler2D **SCREEN_TEXTURE**              | Built-in Texture for reading from the screen. Mipmaps contain increasingly blurred copies.       |
 +-------------------------------------------+--------------------------------------------------------------------------------------------------+
 | in vec2 **SCREEN_UV**                     | Screen UV coordinate for current pixel.                                                          |
@@ -311,8 +323,6 @@ these properties, and if you don't write to them, Godot will optimize away the c
 +-------------------------------------------+--------------------------------------------------------------------------------------------------+
 | out float **SSS_TRANSMITTANCE_DEPTH**     |                                                                                                  |
 +-------------------------------------------+--------------------------------------------------------------------------------------------------+
-| out float **SSS_TRANSMITTANCE_CURVE**     |                                                                                                  |
-+-------------------------------------------+--------------------------------------------------------------------------------------------------+
 | out float **SSS_TRANSMITTANCE_BOOST**     |                                                                                                  |
 +-------------------------------------------+--------------------------------------------------------------------------------------------------+
 | inout vec3 **BACKLIGHT**                  |                                                                                                  |