Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QC and FBOs



On 27/02/2007, at 8:39 AM, Pierre-Olivier Latour wrote:

Indeed, that's a better as it will work on all machines and not only the ones that support FBOs. Also, passing a FBO to QC would mean passing a texture name and there's no efficient way to do this.
OK, so this is what I needed to find out - there is no efficient way of using FBOs with QC presently.

AFAIK FBOs have been around since OpenGL 2.0 so I'm not personally concerned about backward compatibility. Also FBOs appear to be the way to perform offscreen rendering moving forward.

Yes, but not all Macs support OpenGL 2.0
All the Macs that I support do. :-) Besides which, supporting FBOs in QC would just be another image source would it not i.e. it would not necessarily introduce a compatibility issue - right?


Check out the following, looking specifically under CVImageBuffer - you could use a CVOpenGLBufferRef to perform your desired task, I would think...
Not as far as I can see... CVOpenGLBufferRef requires an OpenGL context whereas I think I'd need a CVFBOBufferRef style of function.

If I was to log an enhancement request for a CVFBOBufferRef style of API would this be something that QC could easily make use of?

You will always need a GL context to do GL rendering, FBO or not. CVOpenGLBufferRef just require the use of a shared context to attach to the buffer in order to render into it:
- create primary OpenGL context
- create a second one, shared with the first
- create QCRenderer on primary context
- create CVOpenGLBuffer, attach to secondary context
- draw in secondary context and call glFlush() to ensure drawing commands have been sent
- detach secondary context with CGLClearDrawable()
- pass CVOpenGLBuffer to QC image input
- render a frame with QCRenderer
Thanks so much for this. Sounds like the framebuffer resides on the GPU side as desired.


Incidentally my real goal here is to render into GPU memory and then have QC use my image without the image having to move from the GPU back to the CPU and then back to the GPU. I'm thinking that FBOs are the way to do this but maybe I'm missing something...

CVOpenGLBufferRefs is exactly what you need
OK it is just that I thought that FBOs were all the rage... how might FBOs be useful to QC then in future? This article on FBOs at Wikipedia is quite insightful as to why FBOs are a good option:

http://en.wikipedia.org/wiki/Framebuffer_Object

Thus I'm still wondering if you'd think it a good idea to enhance QC to support them.

Cheers,
-C
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >QC and FBOs (From: Christopher Hunt <email@hidden>)
 >Re: QC and FBOs (From: John Pannell <email@hidden>)
 >Re: QC and FBOs (From: Pierre-Olivier Latour <email@hidden>)
 >Re: QC and FBOs (From: Christopher Hunt <email@hidden>)
 >Re: QC and FBOs (From: Pierre-Olivier Latour <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.