WebGLRenderingContext.getAttribLocation - Javascript
文章推薦指數: 80 %
getAttribLocation( program, name ) const buffer = gl.createBuffer() gl.bindBuffer( gl.ARRAY_BUFFER, buffer ) gl.enableVertexAttribArray( index ) gl.
HowtousegetAttribLocationfunctioninWebGLRenderingContextBestJavaScriptcodesnippetsusingbuiltins.WebGLRenderingContext.getAttribLocation(Showingtop3resultsoutof315)createBuffer(name,size){
constgl=this.gl
constprogram=this.program
constindex=gl.getAttribLocation(program,name)
constbuffer=gl.createBuffer()
gl.bindBuffer(gl.ARRAY_BUFFER,buffer)
gl.enableVertexAttribArray(index)
gl.vertexAttribPointer(index,size,gl.FLOAT,false,0,0)
returnbuffer
}
/**
*Extractstheattributes
*@class
*@memberofPIXI.glCore.shader
*@paramgl{WebGLRenderingContext}ThecurrentWebGLrenderingcontext
*@paramprogram{WebGLProgram}Theshaderprogramtogettheattributesfrom
*@returnattributes{Object}
*/
varextractAttributes=function(gl,program)
{
varattributes={};
vartotalAttributes=gl.getProgramParameter(program,gl.ACTIVE_ATTRIBUTES);
for(vari=0;i
延伸文章資訊
- 1WebGLRenderingContext.getAttribLocation - Javascript
getAttribLocation( program, name ) const buffer = gl.createBuffer() gl.bindBuffer( gl.ARRAY_BUFFE...
- 2WebGLRenderingContext.getAttribLocation() - Web APIs
The WebGLRenderingContext.getAttribLocation() method of the WebGL API returns the location of an ...
- 3GL.GetAttribLocation Method (OpenTK.Graphics.ES20)
GetAttribLocation(UInt32, String). Important. This API is not CLS-compliant. C# 複製.
- 4glGetAttribLocation
- 5WebGLRenderingContext.getAttribLocation - Web APIs
The WebGLRenderingContext.getAttribLocation() method of the WebGL API returns the location of an ...