首页 > 其他分享 >Opengl-Framebuffer

Opengl-Framebuffer

时间:2023-03-07 16:47:09浏览次数:36  
标签:Opengl buffer texture color new Framebuffer framebuffer

A color buffer for writing color values, a depth buffer to write and test depth information, and finally a stencil buffer that allows us to discard certain fragments based on some condition. The combination of these buffers is stored somewhere in GPU memory and is called a framebuffer.

In the tutorial, Framebuffer is actually a texture. We use this framebuffer-texture as a normal texture and render it on the defalt buffer

When attaching a texture to a framebuffer, all rendering commands will write to the texture as if it was a normal color/depth or stencil buffer which means the created NULL texture is a canvas, and opengl draw on this canvas。this drawed canvas can be a new texture.

So, to draw the scene to a single texture we'll have to take the following steps:

  1. Render the scene as usual with the new framebuffer bound as the active framebuffer.
  2. Bind to the default framebuffer.
  3. Draw a quad that spans the entire screen with the new framebuffer's color buffer as its texture.

Reference
https://learnopengl.com/Advanced-OpenGL/Framebuffers

标签:Opengl,buffer,texture,color,new,Framebuffer,framebuffer
From: https://www.cnblogs.com/zhaobangliu/p/17188546.html

相关文章

  • Opengl-Rasterization
    Therasterizerthendeterminesthepositionsofeachofthosefragmentsbasedonwheretheyresideonthetriangleshape.Basedonthesepositions,itinterpol......
  • Opengl-ShadowMapping(directional light)
    Thisismainlyaboutdirectionalligt.wecanusedepthmaptofindoutwhichfragmentshouldbeshadow.Thenormalwayislikefollows:Usekowledgeaboutfr......
  • Opengl-Bloom
    Thebloomchapteriscomplicated.Itcombinesalltheideasfromthechapterswehavelearn.ExtractingbrightcolorGaussianblurBlendingbothtexturesEx......
  • 【转】【OpenGL】OpenGL显示文字--显示汉字
    OpenGL显示文字--显示汉字    原则上,显示中文和显示英文并无不同,同样是把要显示的字符做成显示列表,然后进行调用。但是有一个问题,英文字母很少,最多只有几百个,为每个......
  • OpenGL 4.4 pipeline
    svg版本见:https://raw.githubusercontent.com/g-truc/website/d17f404f103caf537564fd1dc5a3b9b71f1d6070/doc/OpenGL%204.4%20Pipeline%20Map.svg 更多请参考:https://g......
  • 【转】OpenGL光照设置
    1.设置光源(1)光源的种类环境光环境光是一种无处不在的光。环境光源放出的光线被认为来自任何方向。因此,当你仅为场景指定环境光时,所有的物体无论法向量如何,都将表现为同......
  • Qt-FFmpeg开发-视频播放【软解码 + OpenGL显示RGB图像】(3)
    Qt-FFmpeg开发-视频播放【软解码+OpenGL显示RGB图像】目录Qt-FFmpeg开发-视频播放【软解码+OpenGL显示RGB图像】1、概述2、实现效果3、FFmpeg软解码流程4、主要代码4.......
  • FFmpeg开发-视频播放【软/硬解码 + OpenGL显示YUV/NV12】05 转载
    1、概述最近研究了一下FFmpeg开发,功能实在是太强大了,网上ffmpeg3、4的文章还是很多的,但是学习嘛,最新的还是不能放过,就选了一个最新的ffmpegn5.1.2版本,和3、4版本api变化......
  • OpenGL Program渲染框架
    Program.h#pragmaonce#ifndefProgram_h#defineProgram_hclassProgram{public:///ConstructorforarenderingprogramProgram(conststd::......
  • OpenGL体素化&什么是SSBO?
    [1]TheBasicsofGPUVoxelization:https%3A//developer.nvidia.com/content/basics-gpu-voxelization[2]体素化Voxelization:基于GPU的三维体素化:https%3A//yangwc.com/20......