Type Meaning --------------------------------------------------------------------------------- void for functions that do not return a value bool a conditional type, taking on values of true or false int a signed integer uint an unsigned integer float a single floating-point scalar vec2 a two-component floating-point vector vec3 a three-component floating-point vector vec4 a four-component floating-point vector bvec2 a two-component Boolean vector bvec3 a three-component Boolean vector bvec4 a four-component Boolean vector ivec2 a two-component signed integer vector ivec3 a three-component signed integer vector ivec4 a four-component signed integer vector uvec2 a two-component unsigned integer vector uvec3 a three-component unsigned integer vector uvec4 a four-component unsigned integer vector mat2 a 2×2 floating-point matrix mat3 a 3×3 floating-point matrix mat4 a 4×4 floating-point matrix mat2x2 same as a mat2 mat2x3 a floating-point matrix with 2 columns and 3 rows mat2x4 a floating-point matrix with 2 columns and 4 rows mat3x2 a floating-point matrix with 3 columns and 2 rows mat3x3 same as a mat3 mat3x4 a floating-point matrix with 3 columns and 4 rows mat4x2 a floating-point matrix with 4 columns and 2 rows mat4x3 a floating-point matrix with 4 columns and 3 rows mat4x4 same as a mat4
浮点采样器类型
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Type Meaning --------------------------------------------------------------------------------- sampler1D a handle for accessing a 1D texture sampler2D a handle for accessing a 2D texture sampler3D a handle for accessing a 3D texture samplerCube a handle for accessing a cube mapped texture sampler2DRect a handle for accessing a rectangular texture sampler1DShadow a handle for accessing a 1D depth texture with comparison sampler2DShadow a handle for accessing a 2D depth texture with comparison sampler2DRectShadow a handle for accessing a rectangular texture with comparison sampler1DArray a handle for accessing a 1D array texture sampler2DArray a handle for accessing a 2D array texture sampler1DArrayShadow a handle for accessing a 1D array depth texture with comparison sampler2DArrayShadow a handle for accessing a 2D array depth texture with comparison samplerBuffer a handle for accessing a buffer texture
有符号整数采样器类型
1 2 3 4 5 6 7 8 9 10
Type Meaning --------------------------------------------------------------------------------- isampler1D a handle for accessing an integer 1D texture isampler2D a handle for accessing an integer 2D texture isampler3D a handle for accessing an integer 3D texture isamplerCube a handle for accessing an integer cube mapped texture isampler2DRect a handle for accessing an integer 2D rectangular texture isampler1DArray a handle for accessing an integer 1D array texture isampler2DArray a handle for accessing an integer 2D array texture isamplerBuffer a handle for accessing an integer buffer texture
无符号整数采样器类型
1 2 3 4 5 6 7 8 9 10
Type Meaning --------------------------------------------------------------------------------- usampler1D a handle for accessing an unsigned integer 1D texture usampler2D a handle for accessing an unsigned integer 2D texture usampler3D a handle for accessing an unsigned integer 3D texture usamplerCube a handle for accessing an unsigned integer cube mapped texture usampler2DRect a handle for accessing an unsigned integer rectangular texture usampler1DArray a handle for accessing an unsigned integer 1D array texture usampler2DArray a handle for accessing an unsigned integer 2D array texture usamplerBuffer a handle for accessing an unsigned integer buffer texture
Use the texture coordinate P to do a texture lookup in the texture currently bound to sampler. The last component of P is used as Dref for the shadow forms. For array forms, the array layer comes from the last component of P in the nonshadow forms, and the second to last component of P in the shadow forms.