Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Help: error rendering to framebuffer (EXT_framebuffer_object)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help: error rendering to framebuffer (EXT_framebuffer_object)




On Oct 19, 2006, at 9:40 , Mark Munte wrote:

Thanks Brian, that is the problem!

Now I don't know the best to correct it...

What I am trying to do is
1 upload video frames as textures

You do that with your _inputTexture


2 create ciimage from the textures and apply filters

Not sure about this, I use GLSL and pure OpenGL for calcs.
3 render to a offscreen texture (upside down, so it can looks correctly when read back to main memory)

I believe you can control the orientation of rendering by changing how you map the texture coord. to vertices.


4 use the offscreen texture as source for another ciimage
5 apply some more filters (only for display) and render to screen (flipping the texture...)


In this scenario, EXT_framebuffer_object was best in my eyes, as there's no need to manage 2 contexts.


You can accomplish render to texture and then use the rendered results from the last pass in the current pass with
FBOs and ACS, although I'm not sure if matters. If the textures are only rendered and not filled with data from RAM, then I'm not sure if there is a performance gain in using ACS. The act of render-to-texture (RTT) and
reusing the
results in a following render pass can be accomplished with two FBOs, each having one COLOR_ATTACHMENT, or one FBO and two COLOR_ATTACHMENTS. The one FBO option is in my experience marginally faster, but which one you use depends more on the capabilities of your machine. My iBook only supports the first option. You need to check to see how many COLOR_ATTACHMENTS your MacBook can handle, MacBook Pros can have up to 4. This technique of RTT requires working knowledge of multi-texturing and is called Ping-Ponging in the GPGPU world(Which is what I do). Here is a link that introduces more of the specifics of Ping-Ponging.


http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html

and www.gpgpu.org

Brian.


Is there another way to do it - using other extensions (compatible with APPLE_CLIENT_STORAGE) ?

mark


On 19.10.2006, at 08:37, Brian wrote:

Hello Mark,

You can use the APPLE_CLIENT_STORAGE(ACS) and FBOs. Textures that use ACS need a pointer to memory and not a NULL
pointer(how can it use client storage when it doesn't exist?). Do you check for gl errors after the call to glTexImage2D() for you outputTexture? That's probably the problem. When you don't provide a valid pointer address for ACS textures, you get an "invalid value" error and the
texture will not be setup. This would cause the GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT error, the texture is not complete.


I hope this helps,

Brian


On Oct 19, 2006, at 1:48 , Mark Munte wrote:

Disabling the APPLE_client_storage extension solves the problem, but my framerate dropps from 50fps to 15fps ad cpu usage increases from 55% to 100%.

Is there a way to use APPLE_client_storage together with GL_FRAMEBUFFER_EXT ?

Mark


On 18.10.2006, at 21:33, Richard Schreyer wrote:

On Oct 18, 2006, at 12:10 PM, Richard Schreyer wrote:


On Oct 18, 2006, at 11:39 AM, Mark Munte wrote:

//set the framebuffer as the rendering target, attached to the output texture
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _framebuffer);
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, _outputTexture);


glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, _width, _height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_EXT, _outputTexture, 0);


GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) NSLog(@">ERROR WITH GL_FRAMEBUFFER_EXT %u", status);

You're missing Step 7 on the list in the OpenGL Programming Guide: "Set up the texture environment and parameters."


The default TEXTURE_MIN_FILTER state is NEAREST_MIPMAP_LINEAR. _outputTexture is incomplete, because the texture parameter state is set up to assume mipmapping, where you have only defined storage for texture level 0.

Add glTexParameteriv(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR) before checking the framebuffer status, and it should work.

Actually, that is not the problem. For RECTANGLE targets, the default minimization filter is already GL_LINEAR.


Richard

_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
memories.de


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Mark Munte <email@hidden>)
 >Re: Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Richard Schreyer <email@hidden>)
 >Re: Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Richard Schreyer <email@hidden>)
 >Re: Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Mark Munte <email@hidden>)
 >Re: Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Brian <email@hidden>)
 >Re: Help: error rendering to framebuffer (EXT_framebuffer_object) (From: Mark Munte <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.