Mailing Lists: Apple Mailing Lists

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

Multi-context rendering



A quick question:
Is it possible to share the depth buffer between 2 drawables, where one is on-screen and one is offscreen?


To elaborate:
------------------
I'm looking at a profile of our upcoming game, GooBall, and a glTexSubImage is literally jumping out at me. We use it for refraction through a glass sphere along these lines:


Set up render-to-texture
Render Scene.
do a copyTexSubImage around the ball.
Render ball with the texture copied above to fake refraction
Set up rendering to screen.
Post-process texture to main screen.

We're already rendering to a texture & putting that on screen with various post-processing FX applied. What I would like to do would be something along these lines:

Set up render-to-texture
Render Scene
Set up rendering to screen.
Post-process texture to main screen.
Render ball with texture generated above

This would effectively eliminate my glCopyTexSubImage, but gives me one problem: when rendering to the main screen, I don't have the Z buffer from the actual scene, hence the ball would appear in front of any geometry that might be between the camera & the ball. I can live with the geometry getting refracted incorrectly (as it does in the current scheme), but I cannot separate the geometry between the ball and the camera.

Any ideas?

Nicholas Francis
www.otee.dk

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to 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.