[cairo] Mozilla on Cairo
cworth at redhat.com
Fri Jun 10 10:31:37 PDT 2005
On Fri, 10 Jun 2005 18:53:06 +0200, Alexander Larsson wrote:
> On Fri, 2005-06-10 at 09:23 -0700, Carl Worth wrote:
> > 4) Draw all objects front to back, taking advantage of
> > CAIRO_OPERATOR_SATURATE.
> Does this really work for partially transparent objects?
I honestly don't know. I don't have a lot of experience with this
operator, nor with conventional OpenGL practices. But let's assume for
a moment that it doesn't work, (if it does then the rest of this email
can be ignored).
Given that, here's an approach that should work fine.
For translucent objects, you obviously want to be drawing back to
front with OVER. That's an outer loop.
Then, this front-to-back with SATURATE rendering happens in an inner
loop. The simplest version would render all objects at the same Z
level with SATURATE to an intermediate surface, (to avoid seams). And
there, the order would be irrelevant.
A more sophisticated, (and more efficient), version would draw
multiple levels of objects to the same intermediate surface. This
could be done as long as the objects are opaque. And here, getting the
front to back order will be important.
I'd love to see somebody do some experiments with this stuff. I might
even do some myself to test the upcoming group API. This kind of
thing would make a good fit for that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050610/ae040c8a/attachment.pgp
More information about the cairo