15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_non_square_matrices 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_non_square_matrices 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Nuno Subtil, NVIDIA (nsubtil 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Nuno Subtil 165bd8deadSopenharmony_ci Mark Adams 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Shipping on Tegra. 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: September 19, 2013 255bd8deadSopenharmony_ci Author revision: 3 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL ES Extension #160 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci The OpenGL ES Shading Language (GLSL ES) is required. OpenGL ES 345bd8deadSopenharmony_ci 2.0 is required. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci This extension is written against the OpenGL ES 2.0.25 375bd8deadSopenharmony_ci specification and version 1.0.17 of the OpenGL ES Shading Language 385bd8deadSopenharmony_ci specification. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci EXT_separate_shader_objects interacts with this extension. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciOverview 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci This extension adds support for non-square matrix variables in GLSL shaders. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNew Procedures and Functions 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci void UniformMatrix2x3fvNV(int location, sizei count, 495bd8deadSopenharmony_ci boolean transpose, const float *value); 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci void UniformMatrix3x2fvNV(int location, sizei count, 525bd8deadSopenharmony_ci boolean transpose, const float *value); 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci void UniformMatrix2x4fvNV(int location, sizei count, 555bd8deadSopenharmony_ci boolean transpose, const float *value); 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci void UniformMatrix4x2fvNV(int location, sizei count, 585bd8deadSopenharmony_ci boolean transpose, const float *value); 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci void UniformMatrix3x4fvNV(int location, sizei count, 615bd8deadSopenharmony_ci boolean transpose, const float *value); 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci void UniformMatrix4x3fvNV(int location, sizei count, 645bd8deadSopenharmony_ci boolean transpose, const float *value); 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciNew Types 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci None. 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ciNew Tokens 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci Returned by GetActiveAttrib and GetActiveUniform: 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci FLOAT_MAT2x3_NV 0x8B65 755bd8deadSopenharmony_ci FLOAT_MAT2x4_NV 0x8B66 765bd8deadSopenharmony_ci FLOAT_MAT3x2_NV 0x8B67 775bd8deadSopenharmony_ci FLOAT_MAT3x4_NV 0x8B68 785bd8deadSopenharmony_ci FLOAT_MAT4x2_NV 0x8B69 795bd8deadSopenharmony_ci FLOAT_MAT4x3_NV 0x8B6A 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciOpenGL ES 2.0 Specification Updates 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ciAdditions to Chapter 2 - OpenGL ES Operation 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci Section 2.7 - Current Vertex State 865bd8deadSopenharmony_ci Replace the first sentence of the third paragraph with 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci The VertexAttrib* commands can also be used to load attributes 895bd8deadSopenharmony_ci declared as any matrix type in a vertex shader. 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Section 2.10.4 - Shader Variables 925bd8deadSopenharmony_ci Amend the second, third and fourth sentences of the second 935bd8deadSopenharmony_ci paragraph under "Vertex Attributes": 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci When an attribute variable is declared as a mat2, mat3x2 or mat4x2, ... 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci When an attribute variable is declared as a mat2x3, mat3 or mat4x3, ... 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci When an attribute variable is declared as a mat2x4, mat3x4 or mat4, ... 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci Replace the last sentence of the 4th paragraph on page 33: 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci The type returned can be any of FLOAT, FLOAT_VEC2, FLOAT_VEC3, 1045bd8deadSopenharmony_ci FLOAT_VEC4, FLOAT_MAT2, FLOAT_MAT3, FLOAT_MAT4, FLOAT_MAT2x3_NV, 1055bd8deadSopenharmony_ci FLOAT_MAT2x4_NV, FLOAT_MAT3x2_NV, FLOAT_MAT3x4_NV, FLOAT_MAT4x2_NV 1065bd8deadSopenharmony_ci or FLOAT_MAT4x3_NV. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci Replace the last sentence on page 36: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci The type returned can be any of FLOAT, FLOAT_VEC2, FLOAT_VEC3, 1115bd8deadSopenharmony_ci FLOAT_VEC4, INT, INT_VEC2, INT_VEC3, INT_VEC4, BOOL, BOOL_VEC2, 1125bd8deadSopenharmony_ci BOOL_VEC3, BOOL_VEC4, FLOAT_MAT2, FLOAT_MAT3, FLOAT_MAT4, 1135bd8deadSopenharmony_ci FLOAT_MAT2x3_NV, FLOAT_MAT2x4_NV, FLOAT_MAT3x2_NV, 1145bd8deadSopenharmony_ci FLOAT_MAT3x4_NV, FLOAT_MAT4x2_NV, SAMPLER_2D, or SAMPLER_CUBE. 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci Add the following commands to the 4th paragraph on page 37: 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci void UniformMatrix2x3fvNV(int location, sizei count, 1195bd8deadSopenharmony_ci boolean transpose, const float *value); 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci void UniformMatrix3x2fvNV(int location, sizei count, 1225bd8deadSopenharmony_ci boolean transpose, const float *value); 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci void UniformMatrix2x4fvNV(int location, sizei count, 1255bd8deadSopenharmony_ci boolean transpose, const float *value); 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci void UniformMatrix4x2fvNV(int location, sizei count, 1285bd8deadSopenharmony_ci boolean transpose, const float *value); 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci void UniformMatrix3x4fvNV(int location, sizei count, 1315bd8deadSopenharmony_ci boolean transpose, const float *value); 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci void UniformMatrix4x3fvNV(int location, sizei count, 1345bd8deadSopenharmony_ci boolean transpose, const float *value); 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci Insert before the last paragraph on page 37: 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci The UniformMatrix{2x3,3x2,2x4,4x2,3x4,4x3}fvNV commands will load 1395bd8deadSopenharmony_ci count 2x3, 3x2, 2x4, 4x2, 3x4, or 4x3 matrices (corresponding to 1405bd8deadSopenharmony_ci the numbers in the command name) of floating-point values into a 1415bd8deadSopenharmony_ci uniform location defined as a matrix or an array of matrices. The 1425bd8deadSopenharmony_ci first number in the command name is the number of columns; the 1435bd8deadSopenharmony_ci second is the number of rows. For example, UniformMatrix2x4fvNV is 1445bd8deadSopenharmony_ci used to load a matrix consisting of two columns and four rows. The 1455bd8deadSopenharmony_ci <transpose> argument must be false and matrices are specified in 1465bd8deadSopenharmony_ci column major order. 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ciOpenGL ES Shading Language Specification v1.0.17 Updates 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci Including the following line in a shader can be used to control 1515bd8deadSopenharmony_ci the language features described in this extension: 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci #extension GL_NV_non_square_matrices : <behavior> 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci where <behavior> is as specified in section 3.3. 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci A new preprocessor #define is added to the OpenGL Shading 1585bd8deadSopenharmony_ci Language: 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci #define GL_NV_non_square_matrices 1 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci Add the following types to the Basic Types table in section 4.1: 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci mat2x3 - a 2x3 floating-point matrix 1655bd8deadSopenharmony_ci mat3x2 - a 3x2 floating-point matrix 1665bd8deadSopenharmony_ci mat2x4 - a 2x4 floating-point matrix 1675bd8deadSopenharmony_ci mat4x2 - a 4x2 floating-point matrix 1685bd8deadSopenharmony_ci mat3x4 - a 3x4 floating-point matrix 1695bd8deadSopenharmony_ci mat4x3 - a 4x3 floating-point matrix 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci Section 4.1.6 - Matrices 1725bd8deadSopenharmony_ci Replace the text under this section with 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci Matrices are another useful data type in computer graphics, and 1755bd8deadSopenharmony_ci the OpenGL ES Shading Language defines support for 2x2, 2x3, 2x4, 1765bd8deadSopenharmony_ci 3x2, 3x3, 3x4, 4x2, 4x3 and 4x4 matrices of floating point 1775bd8deadSopenharmony_ci numbers. Matrices are read from and written to in column major 1785bd8deadSopenharmony_ci order. Example matrix declarations: 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci mat2 mat2D; 1815bd8deadSopenharmony_ci mat3 optMatrix; 1825bd8deadSopenharmony_ci mat4 view, projection; 1835bd8deadSopenharmony_ci mat2x3 a; 1845bd8deadSopenharmony_ci mat3x4 b; 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Initialization of matrix values is done with constructors 1875bd8deadSopenharmony_ci (described in Section 5.4 "Constructors") in column-major order. 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci mat2 is an alias for mat2x2, not a distinct type. Similarly for 1905bd8deadSopenharmony_ci mat3 and mat4. The following is legal: 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci mat2 a; 1935bd8deadSopenharmony_ci mat2x2 b = a; 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci Section 4.3.3 - Attribute 1965bd8deadSopenharmony_ci Replace the sixth sentence with: 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci A mat2x4, mat3x4 or mat4 attribute will use up the equivalent of 4 1995bd8deadSopenharmony_ci vec4 attribute variable locations, a mat2x3, mat3 or mat4x3 will 2005bd8deadSopenharmony_ci use up the equivalent of 3 attribute variable locations, and a 2015bd8deadSopenharmony_ci mat2, mat3x2 or mat4x2 will use up 2 attribute variable locations. 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci Section 5.4.2 - Vector and Matrix constructors 2045bd8deadSopenharmony_ci Replace the last paragraph with: 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci A wide range of other possibilities exist, to construct a matrix 2075bd8deadSopenharmony_ci from vectors and scalars, as long as enough components are present 2085bd8deadSopenharmony_ci to initialize the matrix. To construct a matrix from a matrix: 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci mat3x3(mat4x4); // takes the upper-left 3x3 of the mat4x4 2115bd8deadSopenharmony_ci mat2x3(mat4x2); // takes the upper-left 2x2 of the mat4x4, last row is 0,0 2125bd8deadSopenharmony_ci mat4x4(mat3x3); // puts the mat3x3 in the upper-left, sets the lower right 2135bd8deadSopenharmony_ci // component to 1, and the rest to 0 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ciInteractions with EXT_separate_shader_objects 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci If EXT_separate_shader_objects is supported, then the 2185bd8deadSopenharmony_ci ProgramUniformMatrix{2x3,3x2,2x4,4x2,3x4,4x3}fvEXT functions will 2195bd8deadSopenharmony_ci be present in both OpenGL ES 2.0 and OpenGL ES 3.0 instead of only 2205bd8deadSopenharmony_ci in OpenGL ES 3.0. 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ciErrors 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci None. 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ciNew State 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci None. 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ciNew Implementation Dependent State 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci None. 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ciRevision History 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci 06-06-12 nsubtil - Initial version 2375bd8deadSopenharmony_ci 07-23-12 nsubtil - Added NV suffix to entry point and token names 2385bd8deadSopenharmony_ci Added return values for GetActiveAttrib and GetActiveUniform 2395bd8deadSopenharmony_ci Added extension pragma to the GLSL updates section 2405bd8deadSopenharmony_ci Disallow transpose = TRUE in UniformMatrix*x*fvNV 2415bd8deadSopenharmony_ci Added TBD interactions with SSO 2425bd8deadSopenharmony_ci 09-19-13 marka - EXT_separate_shader_object interactions 243