Browse Source

Merge pull request #393 from RandomShaper/patch-7

Document new AT_LIGHT_PASS builtin
Rémi Verschelde 8 years ago
parent
commit
3aa2d5846e
1 changed files with 35 additions and 31 deletions
  1. 35 31
      learning/features/shading/shading_language.rst

+ 35 - 31
learning/features/shading/shading_language.rst

@@ -377,41 +377,45 @@ CanvasItem (2D) - VertexShader
 +-----------------------------------+--------------------------------------------------------------------------------------------+
 +-----------------------------------+--------------------------------------------------------------------------------------------+
 | const float *TIME*                | Time (in seconds)                                                                          |
 | const float *TIME*                | Time (in seconds)                                                                          |
 +-----------------------------------+--------------------------------------------------------------------------------------------+
 +-----------------------------------+--------------------------------------------------------------------------------------------+
+| const bool *AT_LIGHT_PASS*        | Whether the shader is being run for a lighting pass (happens per affecting light)          |
++-----------------------------------+--------------------------------------------------------------------------------------------+
 
 
 CanvasItem (2D) - FragmentShader
 CanvasItem (2D) - FragmentShader
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
-+-------------------------------------+------------------------------------------------------------------------------+
-| Variable                            | Description                                                                  |
-+=====================================+==============================================================================+
-| const vec4 *SRC\_COLOR*             | Vertex color                                                                 |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const vec4 *POSITION*               | Screen Position                                                              |
-+-------------------------------------+------------------------------------------------------------------------------+
-| vec2 *UV*                           | UV                                                                           |
-+-------------------------------------+------------------------------------------------------------------------------+
-| out color *COLOR*                   | Output Color                                                                 |
-+-------------------------------------+------------------------------------------------------------------------------+
-| out vec3 *NORMAL*                   | Optional Normal (used for 2D Lighting)                                       |
-+-------------------------------------+------------------------------------------------------------------------------+
-| out vec3 *NORMALMAP*                | Optional Normal in standard normalmap format (flipped y and Z from 0 to 1)   |
-+-------------------------------------+------------------------------------------------------------------------------+
-| out float *NORMALMAP\_DEPTH*        | Depth option for above normalmap output, default value is 1.0                |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const texture *TEXTURE*             | Current texture in use for CanvasItem                                        |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const vec2 *TEXTURE\_PIXEL\_SIZE*   | Pixel size for current 2D texture                                            |
-+-------------------------------------+------------------------------------------------------------------------------+
-| in vec4 *VAR1*                      | Varying 1 Output                                                             |
-+-------------------------------------+------------------------------------------------------------------------------+
-| in vec4 *VAR2*                      | Varying 2 Output                                                             |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const vec2 *SCREEN\_UV*             | Screen Texture Coordinate (for using with texscreen)                         |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const vec2 *POINT\_COORD*           | Current UV for Point Sprite                                                  |
-+-------------------------------------+------------------------------------------------------------------------------+
-| const float *TIME*                  | Time (in seconds)                                                            |
-+-------------------------------------+------------------------------------------------------------------------------+
++-------------------------------------+------------------------------------------------------------------------------------+
+| Variable                            | Description                                                                        |
++=====================================+====================================================================================+
+| const vec4 *SRC\_COLOR*             | Vertex color                                                                       |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const vec4 *POSITION*               | Screen Position                                                                    |
++-------------------------------------+------------------------------------------------------------------------------------+
+| vec2 *UV*                           | UV                                                                                 |
++-------------------------------------+------------------------------------------------------------------------------------+
+| out color *COLOR*                   | Output Color                                                                       |
++-------------------------------------+------------------------------------------------------------------------------------+
+| out vec3 *NORMAL*                   | Optional Normal (used for 2D Lighting)                                             |
++-------------------------------------+------------------------------------------------------------------------------------+
+| out vec3 *NORMALMAP*                | Optional Normal in standard normalmap format (flipped y and Z from 0 to 1)         |
++-------------------------------------+------------------------------------------------------------------------------------+
+| out float *NORMALMAP\_DEPTH*        | Depth option for above normalmap output, default value is 1.0                      |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const texture *TEXTURE*             | Current texture in use for CanvasItem                                              |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const vec2 *TEXTURE\_PIXEL\_SIZE*   | Pixel size for current 2D texture                                                  |
++-------------------------------------+------------------------------------------------------------------------------------+
+| in vec4 *VAR1*                      | Varying 1 Output                                                                   |
++-------------------------------------+------------------------------------------------------------------------------------+
+| in vec4 *VAR2*                      | Varying 2 Output                                                                   |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const vec2 *SCREEN\_UV*             | Screen Texture Coordinate (for using with texscreen)                               |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const vec2 *POINT\_COORD*           | Current UV for Point Sprite                                                        |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const float *TIME*                  | Time (in seconds)                                                                  |
++-------------------------------------+------------------------------------------------------------------------------------+
+| const bool *AT_LIGHT_PASS*          | Whether the shader is being run for a lighting pass (happens per affecting light)  |
++-------------------------------------+------------------------------------------------------------------------------------+
 
 
 CanvasItem (2D) - LightShader
 CanvasItem (2D) - LightShader
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~