EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

getUniform method

Gets the uniform value for a specific location in a program.

IE11

 

Syntax

var retVal = WebGLRenderingContext.getUniform(program, location);

Parameters

program [in]

Type: WebGLProgram

The program to query.

location [in]

Type: WebGLUniformLocation

The location of the uniform variable.

Return value

Type: any

One of the following. Returns null if a WebGL error is generated.

Uniform typeretVal type
booleanBoolean
intNumber
floatNumber
vec2Float32Array(with 2 elements)
ivec2Int32Array(with 2 elements)
bvec2Array containing Boolean (with 2 elements)
vec3Float32Array(with 3 elements)
ivec3Int32Array(with 3 elements)
bvec3Array containing Boolean (with 3 elements)
vec4Float32Array(with 4 elements)
ivec4Int32Array(with 4 elements)
bvec4Array containing Boolean (with 4 elements)
mat2Float32Array(with 4 elements)
mat3Float32Array(with 9 elements)
mat4Float32Array(with 16 elements)
sampler2DNumber
samplerCubeNumber

 

Remarks

WebGL ErrorDescription
gl.INVALID_VALUEIf program is not generated by WebGL.
gl.INVALID_OPERATION
  • If location isn't a valid uniform variable location for program
  • If program is not a program object.
  • if program isn't successfully linked.

 

See also

WebGLRenderingContext

 

 

표시:
© 2014 Microsoft