WebGLRenderingContext.framebufferRenderbuffer - Web APIs

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

The WebGLRenderingContext.framebufferRenderbuffer() method of the WebGL API attaches a WebGLRenderbuffer object to a WebGLFramebuffer object. WebGLRenderingContext.framebufferRenderbuffer() TheWebGLRenderingContext.framebufferRenderbuffer()methodoftheWebGLAPIattachesaWebGLRenderbufferobjecttoaWebGLFramebufferobject. Syntax voidgl.framebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer); Parameters targetAGLenumspecifyingthebindingpoint(target)fortheframebuffer.Possiblevalues:gl.FRAMEBUFFER:Collectionbufferdatastorageofcolor,alpha,depthandstencilbuffersusedtorenderanimage.WhenusingaWebGL2context,thefollowingvaluesareavailableadditionally:gl.DRAW_FRAMEBUFFER:Equivalenttogl.FRAMEBUFFER.Usedasadestinationfordrawing,rendering,clearing,andwritingoperations. gl.READ_FRAMEBUFFER:Usedasasourceforreadingoperations.attachmentAGLenumspecifyingtheattachmentpointfortherenderbuffer.Possiblevalues: gl.COLOR_ATTACHMENT0:colorbuffer. gl.DEPTH_ATTACHMENT:depthbuffer. gl.DEPTH_STENCIL_ATTACHMENT:depthandstencilbuffer. gl.STENCIL_ATTACHMENT:stencilbuffer.WhenusingaWebGL2context,thefollowingvaluesareavailableadditionally:gl.COLOR_ATTACHMENT1gl.COLOR_ATTACHMENT2gl.COLOR_ATTACHMENT3gl.COLOR_ATTACHMENT4gl.COLOR_ATTACHMENT5gl.COLOR_ATTACHMENT6gl.COLOR_ATTACHMENT7gl.COLOR_ATTACHMENT8gl.COLOR_ATTACHMENT9gl.COLOR_ATTACHMENT10gl.COLOR_ATTACHMENT11gl.COLOR_ATTACHMENT12gl.COLOR_ATTACHMENT13gl.COLOR_ATTACHMENT14gl.COLOR_ATTACHMENT15WhenusingtheWEBGL_draw_buffersextension:ext.COLOR_ATTACHMENT0_WEBGL(sameasgl.COLOR_ATTACHMENT0)ext.COLOR_ATTACHMENT1_WEBGLext.COLOR_ATTACHMENT2_WEBGLext.COLOR_ATTACHMENT3_WEBGLext.COLOR_ATTACHMENT4_WEBGLext.COLOR_ATTACHMENT5_WEBGLext.COLOR_ATTACHMENT6_WEBGLext.COLOR_ATTACHMENT7_WEBGLext.COLOR_ATTACHMENT8_WEBGLext.COLOR_ATTACHMENT9_WEBGLext.COLOR_ATTACHMENT10_WEBGLext.COLOR_ATTACHMENT11_WEBGLext.COLOR_ATTACHMENT12_WEBGLext.COLOR_ATTACHMENT13_WEBGLext.COLOR_ATTACHMENT14_WEBGLext.COLOR_ATTACHMENT15_WEBGLrenderbuffertargetAGLenumspecifyingthebindingpoint(target)fortherenderbuffer.Possiblevalues:gl.RENDERBUFFER:Bufferdatastorageforsingleimagesinarenderableinternalformat.renderbufferAWebGLRenderbufferobjecttoattach. Returnvalue None. Exceptions Agl.INVALID_ENUMerroristhrowniftargetisnotgl.FRAMEBUFFER,gl.DRAW_FRAMEBUFFER,orgl.READ_FRAMEBUFFER.Agl.INVALID_ENUMerroristhrownifrenderbuffertargetisnotgl.RENDERBUFFER.Agl.INVALID_ENUMerroristhrownifattachmentisnotoneoftheallowedenums. Examples gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER,renderbuffer); Specifications Specification WebGLSpecification(WebGL)#5.14.6 Browsercompatibility Desktop Mobile Chrome Edge Firefox InternetExplorer Opera Safari WebViewAndroid ChromeAndroid FirefoxforAndroid OperaAndroid SafarionIOS SamsungInternet framebufferRenderbuffer 9 12 4 11 12 5.1 ≤37 25 Yes 12 8 1.5 WebGL2 56 79 51 No 43 No 58 58 51 43 No 7.0 Seealso WebGLRenderingContext.createFramebuffer()WebGLRenderingContext.deleteFramebuffer()WebGLRenderingContext.isFramebuffer()Otherbuffers:WebGLBuffer,WebGLRenderbuffer WEBGL_draw_buffers ©2005–2021MDNcontributors.LicensedundertheCreativeCommonsAttribution-ShareAlikeLicensev2.5orlater. https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/framebufferRenderbuffer



請為這篇文章評分?