{{APIRef("WebGL")}}
The WebGLUniformLocation interface is part of the WebGL API and represents the location of a uniform variable in a shader program.
Description
The WebGLUniformLocation
object does not define any methods or properties of its own and its content is not directly accessible. When working with WebGLUniformLocation
objects, the following methods of the {{domxref("WebGLRenderingContext")}} are useful:
- {{domxref("WebGLRenderingContext.getUniformLocation()")}}
Examples
Getting an uniform location
var canvas = document.getElementById("canvas"); var gl = canvas.getContext("webgl"); var location = gl.getUniformLocation(WebGLProgram, "uniformName");
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('WebGL', "#5.10", "WebGLUniformLocation")}} | {{Spec2('WebGL')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatChrome("9")}} | {{CompatGeckoDesktop("2.0")}} | {{CompatIE("11")}} | {{CompatOpera("12")}} | {{CompatSafari("5.1")}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | 25 | {{CompatVersionUnknown}} | {{CompatUnknown}} | 12 | 8.1 |
See also
- {{domxref("WebGLRenderingContext.getUniformLocation()")}}