Questions tagged [fbo]

Framebuffer object (FBO) is an OpenGL object type that allows rendering to textures or other user-allocated image buffers. Versions of OpenGL older than 3.0 can access an extension version of this functionality.

421 questions
28
votes
3 answers

How to use Multisampling with OpenGL FBOs

I'm trying to enable mutlisampling and alpha-to-coverage for an FBO. Using the default framebuffer, all I have to do is call glEnable(GL_MULTISAMPLE) and glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE). However, I am unable to achieve the same effect using my…
GraphicsMuncher
  • 4,583
  • 4
  • 35
  • 50
27
votes
2 answers

Best method to copy texture to texture

What is the best method to copy pixels from texture to texture? I've found some ways to accomplish this. For instance, there's a method glCopyImageSubData() but my target version is OpenGL 2.1, so I cannot use it. Also, because the performance is…
slyx
  • 2,063
  • 1
  • 19
  • 28
23
votes
1 answer

How can I resize existing texture attachments at my framebuffer?

When I resize my window, I need to resize my textures that are attached to my framebuffer. I tried calling glTexStorage2D again, with different size parameters. However that does not work. How can I resize the textures attached to my framebuffer?…
gartenriese
  • 4,131
  • 6
  • 36
  • 60
17
votes
2 answers

What is the best way to handle FBOs in OpenGL?

I wonder since a long time what would be the best way to handle OpenGL FrameBuffer Objects (FBO). Switching FBOs can be costly but defining new attachments too. How do you do it fast ? I hesitate between these 3: 1 FBO for everything, change…
ponce
  • 919
  • 5
  • 15
16
votes
2 answers

How to check which Frame Buffer Object is currently bound in OpenGL?

I'm working with OpenGL Frame Buffer Objects. I have created a Frame Buffer Object with 2 color textures and a depth texture. I'm using glBindFramebuffer(GL_READ_FRAMEBUFFER, ID); To bind my framebuffer, but on console i'm getting this…
ammar26
  • 1,584
  • 4
  • 21
  • 41
16
votes
2 answers

Is it possible to clear just certain textures in a framebuffer with multi target rendering?

I have a framebuffer object in which I use Multi Target Rendering on N textures binded to it. At a certain time, I want to clear the content of some of those textures, but not all of them. If I call glClearColor(0.0, 0.0, 0.0,…
darius
  • 837
  • 9
  • 22
16
votes
1 answer

OpenGL fbo blitting inconsistent between Intel and Nvidia

I am rendering a scene in OpenGL in a low resolution into a framebuffer. Then I intend to draw this version onto the whole screen (upscaled with GL_NEAREST). I do this using texture blitting (glBlitFramebuffer). On my Nvidia GPU this works, but when…
Jannis Froese
  • 1,347
  • 2
  • 10
  • 23
12
votes
2 answers

Reading the pixels values from the Frame Buffer Object (FBO) using Pixel Buffer Object (PBO)

Can I use Pixel Buffer Object (PBO) to directly read the pixels values (i.e. using glReadPixels) from the FBO (i.e. while FBO is still attached)? If yes, What are the advantages and disadvantages of using PBO with FBO? What is the problem with…
Rudi
  • 700
  • 1
  • 8
  • 19
12
votes
1 answer

Rendering to cube map

According to ARB_geometry_shader4 it is possible to render a scene onto the 6 faces of a cube map with a geometry shader and the cube map attached to a framebuffer object. I want to create a shadow map using this way. However there seems to be a…
Maurice Gilden
  • 1,934
  • 1
  • 12
  • 16
10
votes
4 answers

problem saving openGL FBO larger than window

I'm rendering into an OpenGL offscreen framebuffer object and like to save it as an image. Note that the FBO is larger than the display size. I can render into the offscreen buffer and use it as texture, which works. I can "scroll" this larger…
razong
  • 1,269
  • 11
  • 22
9
votes
2 answers

glReadPixels from FBO fails with multisampling

I have an FBO object with a color and depth attachment which I render to and then read from using glReadPixels() and I'm trying to add to it multisampling support. Instead of glRenderbufferStorage() I'm calling glRenderbufferStorageMultisampleEXT()…
shoosh
  • 76,898
  • 55
  • 205
  • 325
9
votes
1 answer

OpenGL: Objects are smooth if normally drawn, but edged when rendering to FBO

I have a problem with different visual results when using a FBO compared to the default framebuffer: I render my OpenGL scene into a framebuffer object, because I use this for color picking. The thing is that if I render the scene directly to the…
Tim
  • 135
  • 1
  • 12
8
votes
1 answer

Opengl, DrawArrays without binding VBO

I am rendering array of points with a custom vertex shader. Shaders looks like: void mainVP() in varying int in_vertex_id : VERTEXID { foo(in_vertex_id); } So the only thing I need - is vertex id. But I need a lot of vertices and I don't…
Roman Silakov
  • 175
  • 1
  • 8
8
votes
2 answers

glGenFramebuffers or glGenFramebuffersEXT?

I'm confused. To use the Framebuffer Object extension (FBO) in OpenGL 1.x on Windows, which of these do I use?: wglGetProcAddress("glGenFramebuffers"); // or wglGetProcAddress("glGenFramebuffersEXT"); As far as I can tell from reports from users…
AshleysBrain
  • 22,335
  • 15
  • 88
  • 124
8
votes
3 answers

glReadPixels() sets GL_INVALID_OPERATION error

I'm trying to implement color picking with FBO. I have multisampled FBO (fbo[0]) which I use to render the scene and I have non multisampled FBO (fbo[1]) which I use for color picking. The problem is: when I try to read pixel data from fbo[1]…
Oleg Titov
  • 1,100
  • 1
  • 8
  • 13
1
2 3
28 29