A few questions,
are you flushing properly after rendering the FBO? Does your
QCRenderer have a clear in it, if not, are you calling glClear()
before you render your QCRenderers?
Does your FBO have a depth buffer attachment? Otherwise anything
rendering geometry may look weird or have depth artifacts.
You mention the QT movie shares the GL context, Are you using a
QTOpenGLTextureContext with your movie? Are you properly calling
QTVisualContextTask after each frame?
If you suspect the QT movie to be messing with your context, you can
isolate each component (QC Renderer, QTMovie) to their own GL context
shared with the master context that is driving your view. Sharing the
context will allow your FBOs texture attachments, and textures from
the QTmovie to all be rendered and mixed accordingly to the main view
(or have the CVOpenGLTextureRefs from your visual context passed as
input keys to your QC Renderers). You can do this as many times as
needed, you are not limited to 2 shared contexts, you can do master
shared to many "sub" contexts, or have a "serial" approach where its
master -> shared a -> shared b. I've seen little difference between
these approaches.
I've observed via OpenGL Profiler that the renderers are being
called, and producing frames. The frames I really want to see
painted on my textures seem to be being created as their own
textures (maybe QCRenderer does this internally, I don't know), and
not drawn into the FBO.
You may be seeing the texture that is painted onto the billboard here
in the GL profiler. If you are looking to pass the output of one QC
Renderer to another, it will be faster to publish output images and
use the QCImage type, and then set that as an input image value in the
next QCRenderer. This will save you a draw call on the billboard, as
well as a render to texture phase with your FBO, and whatever internal
swizzling QC does with textures -> QCImage conversions. This of course
is moot if your QCRenderer draws lots of geometry and you want to
capture that.
Describe your rendering pipeline?
On Feb 7, 2010, at 8:27 PM, Neil Clayton wrote:
Hi All,
I'm having some problems rendering using multiple FBOs.
I have texture, to which I want to draw to using an FBO. I've
verified the texture is bound to the FBO correctly by drawing basic
geometry (lines/polys) before I do the QCRenderer render. 80% of
the time, these geometry operations are not overwritten with the
contents of the render. The other 20%, I sometimes see a first
frame being rendered to the texture and then garbage afterwards.
It's as if QCRenderer isn't drawing into the currently bound FBO at
all, or it is, and subsequent renders are stuffing up the FBO state
(I'm careful to restore previous FBO state, afaik).
I've observed via OpenGL Profiler that the renderers are being
called, and producing frames. The frames I really want to see
painted on my textures seem to be being created as their own
textures (maybe QCRenderer does this internally, I don't know), and
not drawn into the FBO.
Is it the case that if I setup and FBO using a shared OpenGL
context, and render a QC composition via QCRenderer, that it should
render-to-texture if that is how the FBO is setup?
One thing to note is that the QCRenderer, view and QTMovie all share
the same context. The corruption happens while the movie is
playing. I wonder if it's to do with locking between these
components? (since the visual context will be rendering frames at
the same time). I perform a CGLContextObj cglContext =
(CGLContextObj)[context CGLContextObj]; within both my view and the
QCRenderer...
I've put a sample movie here:
http://dl.dropbox.com/u/421935/RotatingCubeExample.mov
Any ideas regarding QCRenderer and FBO's, with subsequently mapping
the underlying textures to a quad?
Neil Clayton
[email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected]
)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]