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
4
votes
2 answers

Rendering multiple depth information with FBOs

I am trying to implement a shader computing the light refraction through two surfaces: the back and front of the object. To do so, I need to render the refractive geometry with the normal depth test (GL_LESS), and the reversed depth test…
geenux
  • 297
  • 4
  • 15
4
votes
1 answer

GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT errors

I'm using FBOs in my OpenGL code and I'm seeing compilation errors on GL\_FRAMEBUFFER\_INCOMPLETE\_DUPLICATE\_ATTACHMENT\_EXT. What's the cause of this and how do I fix it?
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
4
votes
2 answers

Frame buffer object support

Do most OpenGL 2.0 and 2.1 graphics cards that still are in use support frame buffer objects (through the GL_ARB_framebuffer_object or GL_EXT_framebuffer_object extensions)?
Johan Råde
  • 20,480
  • 21
  • 73
  • 110
4
votes
1 answer

Save 2D texture to a png in Android OpenGL ES

I am new to OpenGL ES in Android. But right now, I need to use OpenGL ES 2.0 to do some photo editing. I found the sample code "Hello-effect" in Android 4.1.2, it complete the work of editing the photo and render it to a window. But right now, I…
4
votes
2 answers

How to use glReadPixels() to return resized image from FBO?

Shortly: I need a quick way to resize the buffer image and then return the pixels to me to save them to file etc. Currently I first use glReadPixels(), and then I go through the pixels myself to resize them with my own resize function. Is there any…
Rookie
  • 4,064
  • 6
  • 54
  • 86
4
votes
0 answers

Strange issue with a multi pass, multi RT render in GLSL

I am seeing a strange issue with a multi pass, multi RT ping-pong render I am using 3 shaders and an FBO, I get no errors at any stage. I am using opengl 4, so I am not using glBegin/glEnd, I use my own matrices for transformation and i am using…
4
votes
1 answer

OpenGL ES to video in iOS (rendering to a texture with iOS 5 texture cache)

You know the sample code of Apple with the CameraRipple effect? Well I'm trying to record the camera output in a file after openGL has done all the cool effect of water. I've done it with glReadPixels, where I read all the pixels in a void * buffer…
user1562826
  • 69
  • 1
  • 3
3
votes
3 answers

Render to texture problems

I'm tyring to get rendering to texture working, but am having a bit of trouble. I'm trying to render a simple quad to the screen to make sure everything is working. target->enable(); glBegin(GL_QUADS); glColor4f(1.f, 0.f, 0.f, 1.f); …
rcapote
  • 1,034
  • 7
  • 19
3
votes
0 answers

Opengl ES 2.0, FBOs, and Fragment Shaders

Here's my render loop: Bind a custom FBO Bind a texture (previously associated with the FBO as COLOR_ATTACHMENT0) Render using a custom fragment shader which chooses fragment colors on the basis of a fractal algorithm. (If a fragment is not used…
Aman
  • 31
  • 1
  • 4
3
votes
1 answer

OpenGL, stencil buffer of FBO not working?

I try to use the stencil buffer of a FBO in OpenGL, but I can't get it to work. I bound a depth24_stencil8 texture to the FBO both for the depth and stencil targets. As a simple test, I tried: /* Enable FBO…
neodelphi
  • 2,706
  • 1
  • 15
  • 22
3
votes
4 answers

Framebuffer Texture behavior in OpenGL/OpenGLES

In OpenGL/ES you have to be careful to not cause a feedback loop (reading pixels from the same texture you are writing to) when implementing render to texture functionality. For obvious reasons the behavior is undefined when you are reading and…
Skyler Saleh
  • 3,961
  • 1
  • 22
  • 35
3
votes
1 answer

PNG saved from OpenGL framebuffer using stbi_write_png is shifted to the right

I have been trying to solve this visual bug for a few days without any success, so I'm asking this question to see if somebody can help me understand what is happening. First I will describe the problem without any code, and then I will present some…
user3266738
  • 477
  • 2
  • 12
3
votes
2 answers

Frame Buffer Object (FBO) and Render & Depth Buffers Relation

I saw many examples on the web (for example) which do the following Create and Bind FBO Create and Bind BUFFERS (texture, render, depth, stencil) Then, UnBind BUFFERS To work with FBO- Bind FBO, do the work then UnBind FBO However, also Bind…
Rudi
  • 700
  • 1
  • 8
  • 19
3
votes
1 answer

Minimal OpenGL offscreen rendering using QT

I am trying to make a simple offscreen renderer to produce a bunch of image files using QT. There are lots of examples around, though I haven't found any dealing with this sort of one-shot rendering, without a loop and without a visible window. Plus…
canaldin
  • 63
  • 1
  • 5
3
votes
2 answers

Save OpenGL rendering to an image file

Although simple for what it does OpenGL is still confusing to me, I am beginning to learn how it works. I am looking for a minimal example of off-screen rendering to get me started. My application shall take a bunch of triangles and information…
canaldin
  • 63
  • 1
  • 5