Java教程

gfx 各个类的源码解读(2)- WebGLFramebuffer

本文主要是介绍gfx 各个类的源码解读(2)- WebGLFramebuffer,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

gfx 各个类的源码解读(2)- WebGLFramebuffer

WebGLFramebuffer 在webgl-framebuffer.ts

成员函数
_gpuFramebuffer: IWebGLGPUFramebuffer

IWebGLGPUFramebuffer结构

export interface IWebGLGPUFramebuffer {
gpuRenderPass: IWebGLGPURenderPass;
gpuColorTextures: IWebGLGPUTexture[]; //绑定到framebuff图片纹理,如果纹理不存在实际的纹理,则是RENDERBUFFER屏幕缓存(gl.RENDERBUFFER)**
gpuDepthStencilTexture: IWebGLGPUTexture | null; //绑定到framebuff深度或者Stencil纹理
glFramebuffer: WebGLFramebuffer | null;
isOffscreen: boolean;
width: number;
height: number;
}

initialize (info: FramebufferInfo)
   调用WebGLCmdFuncCreateFramebuffer生成framebuff 保存在this._gpuFramebuffer.glFramebuffer
   同时绑定纹理,深度和Stencil纹理到framebuff

destroy()
   调用WebGLCmdFuncDestroyFramebuffer 删除framebuff

这篇关于gfx 各个类的源码解读(2)- WebGLFramebuffer的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!