C# WebGLRenderingContext.framebufferRenderbuffer方法 ...
文章推薦指數: 80 %
framebufferRenderbuffer方法的典型用法代碼示例。
如果您正苦於以下問題:C# WebGLRenderingContext.framebufferRenderbuffer方法的具體用法?
當前位置:首頁>>代碼示例>>C#>>正文
本文整理匯總了C#中WebGLRenderingContext.framebufferRenderbuffer方法的典型用法代碼示例。
如果您正苦於以下問題:C#WebGLRenderingContext.framebufferRenderbuffer方法的具體用法?C#WebGLRenderingContext.framebufferRenderbuffer怎麽用?C#WebGLRenderingContext.framebufferRenderbuffer使用的例子?那麽恭喜您,這裏精選的方法代碼示例或許可以為您提供幫助。
您也可以進一步了解該方法所在類WebGLRenderingContext的用法示例。
在下文中一共展示了WebGLRenderingContext.framebufferRenderbuffer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。
您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的C#代碼示例。
示例1:InitializeContent
點讚7
//.........這裏部分代碼省略.........
gl.generateMipmap(gl.TEXTURE_2D);
gl.bindTexture(gl.TEXTURE_2D,null);
};
#endregion
varcrateTexture=gl.createTexture();
handleLoadedTexture(crateTexture,crate);
varmoonTexture=gl.createTexture();
handleLoadedTexture(moonTexture,moon);
#regioninitTextureFramebuffer
varrttFramebuffer=gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER,rttFramebuffer);
varrttFramebuffer_width=512;
varrttFramebuffer_height=512;
varrttTexture=gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D,rttTexture);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,(int)gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,(int)gl.LINEAR_MIPMAP_NEAREST);
gl.generateMipmap(gl.TEXTURE_2D);
gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,rttFramebuffer_width,rttFramebuffer_height,0,gl.RGBA,gl.UNSIGNED_BYTE,null);
varrenderbuffer=gl.createRenderbuffer();
gl.bindRenderbuffer(gl.RENDERBUFFER,renderbuffer);
gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,rttFramebuffer_width,rttFramebuffer_height);
gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,rttTexture,0);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,renderbuffer);
gl.bindTexture(gl.TEXTURE_2D,null);
gl.bindRenderbuffer(gl.RENDERBUFFER,null);
gl.bindFramebuffer(gl.FRAMEBUFFER,null);
#endregion
#regioninitBuffers
varcubeVertexPositionBuffer=gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER,cubeVertexPositionBuffer);
varvertices=newf[]{
//Frontface
-1.0f,-1.0f,1.0f,
1.0f,-1.0f,1.0f,
1.0f,1.0f,1.0f,
-1.0f,1.0f,1.0f,
//Backface
-1.0f,-1.0f,-1.0f,
-1.0f,1.0f,-1.0f,
1.0f,1.0f,-1.0f,
1.0f,-1.0f,-1.0f,
//Topface
-1.0f,1.0f,-1.0f,
-1.0f,1.0f,1.0f,
1.0f,1.0f,1.0f,
1.0f,1.0f,-1.0f,
//Bottomface開發者ID:exaphaser,項目名稱:JSC-Cross-Compiler,代碼行數:67,代碼來源:Application.cs
示例2:Application
點讚6
//.........這裏部分代碼省略.........
varmvMatrix=glMatrix.mat4.create();
varpMatrix=glMatrix.mat4.create();
varvec3aVertexPositionBuffer=newWebGLBuffer(gl);
varvec2aTextureCoordBuffer=newWebGLBuffer(gl);
gl.clearColor(0.0f,0.0f,0.0f,1.0f);
gl.enable(gl.DEPTH_TEST);
#regioninitTextureFramebuffer
varxWebGLFramebuffer=newWebGLFramebuffer(gl);
gl.bindFramebuffer(gl.FRAMEBUFFER,xWebGLFramebuffer);
//generateMipmap:level0notpowerof2ornotallthesamesize
//varrttFramebuffer_width=canvas.width;
//WebGL:INVALID_OPERATION:generateMipmap:level0notpowerof2ornotallthesamesize
varxWebGLTexture=newWebGLTexture(gl);
gl.bindTexture(gl.TEXTURE_2D,xWebGLTexture);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,(int)gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,(int)gl.LINEAR_MIPMAP_NEAREST);
gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,rttFramebuffer_width,rttFramebuffer_height,0,gl.RGBA,gl.UNSIGNED_BYTE,null);
gl.generateMipmap(gl.TEXTURE_2D);
varxWebGLRenderbuffer=newWebGLRenderbuffer(gl);
gl.bindRenderbuffer(gl.RENDERBUFFER,xWebGLRenderbuffer);
gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,rttFramebuffer_width,rttFramebuffer_height);
gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,xWebGLTexture,0);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,xWebGLRenderbuffer);
gl.bindTexture(gl.TEXTURE_2D,null);
gl.bindRenderbuffer(gl.RENDERBUFFER,null);
gl.bindFramebuffer(gl.FRAMEBUFFER,null);
#endregion
varpass=newChromeShaderToyColumns.Library.ShaderToy.EffectPass(
gl:gl,
precission:ChromeShaderToyColumns.Library.ShaderToy.DetermineShaderPrecission(gl),
supportDerivatives:gl.getExtension("OES_standard_derivatives")!=null
);
pass.MakeHeader_Image();
pass.NewShader_Image(
newChromeShaderToyColumns.Shaders.ProgramFragmentShader()
);
varsw=Stopwatch.StartNew();
varvbo=newWebGLBuffer(gl);
Native.window.onframe+=e=>
{
//canwerunitinVRasHUD?
//https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20150706
#regionFRAMEBUFFER
gl.bindFramebuffer(gl.FRAMEBUFFER,xWebGLFramebuffer);
////http://stackoverflow.com/questions/20362023/webgl-why-does-transparent-canvas-show-clearcolor-color-component-when-alpha-is
gl.clearColor(1,1,0,1.0f);
gl.viewport(0,0,rttFramebuffer_width,rttFramebuffer_height);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);開發者ID:exaphaser,項目名稱:JSC-Cross-Compiler,代碼行數:67,代碼來源:Application.cs
注:本文中的WebGLRenderingContext.framebufferRenderbuffer方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。
相關方法
WebGLRenderingContext.useProgram
WebGLRenderingContext.bindBuffer
WebGLRenderingContext.enableVertexAttribArray
WebGLRenderingContext.vertexAttribPointer
WebGLRenderingContext.linkProgram
WebGLRenderingContext.getUniformLocation
WebGLRenderingContext.clear
WebGLRenderingContext.bufferData
WebGLRenderingContext.createProgram
WebGLRenderingContext.viewport
WebGLRenderingContext.getAttribLocation
WebGLRenderingContext.clearColor
WebGLRenderingContext.createBuffer
WebGLRenderingContext.enable
WebGLRenderingContext.uniformMatrix4fv
WebGLRenderingContext.flush
WebGLRenderingContext.bindTexture
WebGLRenderingContext.texImage2D
WebGLRenderingContext.drawElements
WebGLRenderingContext.getExtension
WebGLRenderingContext.pixelStorei
WebGLRenderingContext.uniform1i
WebGLRenderingContext.texParameteri
WebGLRenderingContext.createTexture
WebGLRenderingContext.activeTexture
WebGLRenderingContext.uniform3f
WebGLRenderingContext.createShader
WebGLRenderingContext.getShaderParameter
WebGLRenderingContext.getShaderInfoLog
WebGLRenderingContext.drawArrays
WebGLRenderingContext.generateMipmap
WebGLRenderingContext.attachShader
WebGLRenderingContext.uniformMatrix3fv
WebGLRenderingContext.uniform1f
WebGLRenderingContext.depthFunc
WebGLRenderingContext.clearDepth
WebGLRenderingContext.uniform3fv
WebGLRenderingContext.blendFunc
WebGLRenderingContext.disableVertexAttribArray
WebGLRenderingContext.getParameter
WebGLRenderingContext.bindRenderbuffer
WebGLRenderingContext.uniform1fv
WebGLRenderingContext.createRenderbuffer
WebGLRenderingContext.shaderSource
WebGLRenderingContext.renderbufferStorage
WebGLRenderingContext.bindFramebuffer
WebGLRenderingContext.bindAttribLocation
WebGLRenderingContext.uniform4fv
WebGLRenderingContext.disable
WebGLRenderingContext.getProgramParameter
WebGLRenderingContext.getProgramInfoLog
WebGLRenderingContext.createFramebuffer
WebGLRenderingContext.framebufferTexture2D
WebGLRenderingContext.framebufferRenderbuffer
WebGLRenderingContext.compileShader
WebGLRenderingContext.blendFuncSeparate
WebGLRenderingContext.uniform4f
WebGLRenderingContext.lineWidth
WebGLRenderingContext.Orphanize
WebGLRenderingContext.depthMask
WebGLRenderingContext.deleteShader
WebGLRenderingContext.deleteProgram
WebGLRenderingContext.CreateBuffer
延伸文章資訊
- 1GL.FramebufferRenderbuffer Method (OpenTK.Graphics.ES30 ...
FramebufferRenderbuffer(FramebufferTarget, FramebufferSlot, RenderbufferTarget, UInt32). Importan...
- 2glFramebufferRenderbuffer - Khronos Group
- 3WebGLRenderingContext.framebufferRenderbuffer - Web APIs
The WebGLRenderingContext.framebufferRenderbuffer() method of the WebGL API attaches a WebGLRende...
- 4C++ GstGLFuncs::FramebufferRenderbuffer方法代碼示例- 純淨天空
本文整理匯總了C++中GstGLFuncs::FramebufferRenderbuffer方法的典型用法代碼示例。如果您正苦於以下問題:C++ GstGLFuncs::FramebufferR...
- 5C# WebGLRenderingContext.framebufferRenderbuffer方法 ...
framebufferRenderbuffer方法的典型用法代碼示例。如果您正苦於以下問題:C# WebGLRenderingContext.framebufferRenderbuffer方法的...