Ver código fonte

Added shading language differences to gles2 doc (#2237)

Clay John 6 anos atrás
pai
commit
d0eacac884

+ 80 - 0
tutorials/misc/gles2_gles3_differences.rst

@@ -115,3 +115,83 @@ Blend shapes
 ------------
 ------------
 
 
 Blend shapes are not supported in GLES2.
 Blend shapes are not supported in GLES2.
+
+Shading language
+----------------
+
+GLES3 provides many built-in functions that GLES2 does not. Below is a list of functions 
+that are not available or are have limited support in GLES2.
+
+For a complete list of built-in GLSL functions see the :ref:`Shading Language doc <doc_shading_language>`.
+
++------------------------------------------------------------------------+--------------------------------------------------+
+| Function                                                               | Note                                             |
++========================================================================+==================================================+
+| vec_type **sinh** ( vec_type )                                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **cosh** ( vec_type )                                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **tanh** ( vec_type )                                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **asinh** ( vec_type )                                        |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **acosh** ( vec_type )                                        |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **atanh** ( vec_type )                                        |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **round** ( vec_type )                                        |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **roundEven** ( vec_type )                                    |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **trunc** ( vec_type )                                        |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **modf** ( vec_type x, out vec_type i )                       |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_bool_type **isnan** ( vec_type )                                   |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_bool_type **isinf** ( vec_type )                                   |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_int_type **floatBitsToInt** ( vec_type )                           |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_uint_type **floatBitsToUint** ( vec_type )                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **intBitsToFloat** ( vec_int_type )                           |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **uintBitsToFloat** ( vec_uint_type )                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| mat_type **outerProduct** ( vec_type, vec_type )                       |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| mat_type **transpose** ( mat_type )                                    |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| float **determinant** ( mat_type )                                     |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| mat_type **inverse** ( mat_type )                                      |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| ivec2 **textureSize** ( sampler2D_type s, int lod )                    |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| ivec2 **textureSize** ( samplerCube s, int lod )                       |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **texture** ( sampler2D_type s, vec2 uv [, float bias] )     | **bias** not available in vertex shader          |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **texture** ( samplerCube s, vec3 uv [, float bias] )        | **bias** not available in vertex shader          |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureProj** ( sampler2D_type s, vec3 uv [, float bias] ) | **bias** not available in vertex shader          |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureProj** ( sampler2D_type s, vec4 uv [, float bias] ) | **bias** not available in vertex shader          |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureLod** ( sampler2D_type s, vec2 uv, float lod )      | Only available in vertex shader on some hardware |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureLod** ( samplerCube s, vec3 uv, float lod )         | Only available in vertex shader on some hardware |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureProjLod** ( sampler2D_type s, vec3 uv, float lod )  | Only available in vertex shader                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **textureProjLod** ( sampler2D_type s, vec4 uv, float lod )  | Only available in vertex shader                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec4_type **texelFetch** ( sampler2D_type s, ivec2 uv, int lod )       |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **dFdx** ( vec_type )                                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **dFdy** ( vec_type )                                         |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+
+| vec_type **fwidth** ( vec_type )                                       |                                                  |
++------------------------------------------------------------------------+--------------------------------------------------+

+ 4 - 1
tutorials/shading/shading_reference/shading_language.rst

@@ -424,9 +424,12 @@ Uniforms can also be assigned default values:
 Built-in functions
 Built-in functions
 ------------------
 ------------------
 
 
-A large number of built-in functions are supported, conforming mostly to GLSL ES 3.0.
+A large number of built-in functions are supported, conforming 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.
 When vec_type (float), vec_int_type, vec_uint_type, vec_bool_type nomenclature is used, it can be scalar or vector.
 
 
+.. note:: For a list of the functions that are not available in the GLES2 backend, please see the 
+          :ref:`Differences between GLES2 and GLES3 doc <doc_gles2_gles3_differences>`. 
+
 +-----------------------------------------------------------------------------------------------+------------------------------------------------+
 +-----------------------------------------------------------------------------------------------+------------------------------------------------+
 | Function                                                                                      | Description                                    |
 | Function                                                                                      | Description                                    |
 +===============================================================================================+================================================+
 +===============================================================================================+================================================+