WebGLRenderingContext.getAttribLocation - Web APIs

文章推薦指數: 80 %
投票人數:10人

The WebGLRenderingContext.getAttribLocation() method of the WebGL API returns the location of an attribute variable in a given WebGLProgram. WebGLRenderingContext.getAttribLocation() TheWebGLRenderingContext.getAttribLocation()methodoftheWebGLAPIreturnsthelocationofanattributevariableinagivenWebGLProgram. Syntax GLintgl.getAttribLocation(program,name); Parameters programAWebGLProgramcontainingtheattributevariable.nameADOMStringspecifyingthenameoftheattributevariablewhoselocationtoget. Returnvalue AGLintnumberindicatingthelocationofthevariablenameiffound.Returns-1otherwise. Examples gl.getAttribLocation(program,'vColor'); Specifications Specification WebGLSpecification(WebGL)#5.14.10 Browsercompatibility Desktop Mobile Chrome Edge Firefox InternetExplorer Opera Safari WebViewAndroid ChromeAndroid FirefoxforAndroid OperaAndroid SafarionIOS SamsungInternet getAttribLocation 9 12 4 11 12 5.1 ≤37 25 Yes 12 8 1.5 Seealso WebGLRenderingContext.getUniformLocation() ©2005–2021MDNcontributors.LicensedundertheCreativeCommonsAttribution-ShareAlikeLicensev2.5orlater. https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getAttribLocation



請為這篇文章評分?