FAQ Database Discussion Community


OpenGL: GL_FRAMEBUFFER_UNSUPPORTED on specific combinations of framebuffer attachments

c++,opengl,textures,nvidia,framebuffer
Im trying to attach multiple targets to a framebuffer object. I have the following problem: There is no error, when using float texture attachments and a depth attachment. There is also no error, when using float texture attachments and integer texture attachments. Although these combinations work, I cant use float,...

Clearing DRAW framebuffer only works if attached to GL_COLOR_ATTACHMENT0?

opengl,textures,clear,framebuffer
I am trying to initialize a texture with all zeros, using DRAW framebuffer as suggested by this post. However, I'm quite puzzled that my DRAW framebuffer is only cleared when I attached it to GL_COLOR_ATTACHMENT0: int levels = 2; int potW = 2; int potH = 2; GLuint _potTextureName; glGenTextures(1,...

depth buffer is not rendered properly

c++,opengl,framebuffer,depth
I'm facing a problem rendering the depth buffer. I get some strange artifacts when I try to render my depth buffer to a texture. In the end, I want to render topography data. As a toy example, I would like to render a square. The colour of the square should...

GLSL: sampler upload only works when unused sampler is removed

opengl,textures,glsl,framebuffer
Im currently trying to implement deferred shading with framebuffers in OpenGL. The framebuffer itself works perfectly, but when I dont use all uniform samplers in the shader, one of the textures stop working. This is my fragment shader, a test demonstration of the framebuffer: #version 330 core uniform sampler2D texCoordTex;...

Can I have two ping-pong framebuffers of screen size on Android?

android,opengl-es,framebuffer,fbo
I need to have two ping-pong framebuffers in my OpenGL ES app on Android. I also need them to be of the same size as device screen. Neither depth buffer nor stencil buffer will be attached to them only RGBA8888 color buffer. I'm planning to use them for adding some...

How to use framebuffer targets in webgl?

webgl,framebuffer
How can I specifically use the read and write framebuffers in webgl ? Can't seem to find the constants for it.

Can linear filtering be used for an FBO blit of an MSAA texture to non-MSAA texture?

opengl,textures,framebuffer,blit,msaa
I have two 2D textures. The first, an MSAA texture, uses a target of GL_TEXTURE_2D_MULTISAMPLE. The second, non MSAA texture, uses a target of GL_TEXTURE_2D. According to OpenGL's spec on ARB_texture_multisample, only GL_NEAREST is a valid filtering option when the MSAA texture is being drawn to. In this case, both...

OpenGL ES 2.0 Framebuffer with render to texture iOS: nothing shown

c++,ios,opengl-es,opengl-es-2.0,framebuffer
I'm using a Framebuffer to do post processing. Creating and drawing to the buffer (tested via glReadPixels and glCheckFramebufferStatus) is working fine. But now I want to render the this texture with a quad to the screen. But the screen remains black. The same code (for drawing) is working fine...

OpenGL framebuffer android without GL_OES_packed_depth_stencil (on Nexus 7 2012)

android,c++,android-ndk,opengl-es-2.0,framebuffer
How do I init the framebuffer with depth and stencil on a device which does not support GL_OES_packed_depth_stencil (In my case a Nexus 7 2012)? This does not work: glGenRenderbuffers(1, &depthStencil); glBindRenderbuffer(GL_RENDERBUFFER, depthStencil); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthStencil); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthStencil); GLenum status =...

Android OpenGL ES 2.0 reuse previous frame

android,opengl-es,framebuffer
I am looking for a minimal example where each frame will reuse the triangles from the previous frame. I have been trying over and over unsuccessfully, so I do not have any code worth showing, although I do have a program that works by drawing to the default framebuffer. During...

Solved - GLES2.0+ framebuffer fade artifacts

android,opengl-es,glsl,framebuffer
I'm writing a simple test program on android using GLES 2.0 or 3.0. (If the solution only works on one over the other, than that's what I'll go with.) Problem: Basically I am running into strange pixel artifacts when fading colors. The problem can be "hidden" by making the cutoff...

How to set up 2 different FBOs as fragment shader outputs

c++,opengl,framebuffer,fragment-shader
I am trying to output the result of a fragment shader to two different outputs (frame buffer objects). As far as the shader is concerned, I learned I can specify the different targets as : layout (location = x) out vec4 color; layout (location = y) out vec4 miscData; Now...

LibGDX FrameBuffer quirk on iOS

ios,opengl-es,libgdx,opengl-es-2.0,framebuffer
I've got dynamic textures for a word game that I create and keep on a FrameBuffer. I then use TextureRegions backed by that FrameBuffer to draw to the screen. This code works fine on Android, but I'm having problems on iOS. You can see below a screenshot with the FrameBuffer...

COLOR_ATTACHMENT's - How to render to multiple textures as color attachments inside a Framebuffer Object?

c++,opengl,framebuffer,fbo
I am trying to render to multiple textures as COLOR_ATTACHMENTs without success. All I get from displaying them is a black screen (with a red clear fill) meaning my texture is read but is 'empty'. My pseudo code is : attach 3 textures to an FBO with texture indexes 1,...