[cairo] Avoiding seams (again)

Mike Emmel mike.emmel at gmail.com
Thu Apr 6 15:36:53 PDT 2006


On 4/5/06, MenTaLguY <mental at rydia.net> wrote:
> On Wed, 2006-04-05 at 10:06 -0700, Mike Emmel wrote:
> > Whats wrong with a two pass approach that renderes the full scene.
> > In phase one you render the alpha channel keeping any needed
> > geometry/alpha information for each object thus your combining all the
> > alphas in a full sceen.
> > In phase two you do the stroke and fills agianst the full alpha mask
>
> You can't really separate the two stages.  But building a scene graph
> and computing exact coverage is otherwise a valid solution.
>
> The disadvantages are that it's significantly more complicated and
> potentially more resource-intensive than supersampling.
>
> -mental
>
>

I'm thinking of something more primitive then a scene graph which to
my understanding builds all the operations up abstractly first then
walks the tree to rasterize.

In this case you would rasterize only the alpha plane and maintain the
flattened paths
in the firt pass you could even use and extended concept of alpha say
a 16-32 but number that used the extra bits to say record how many
times the pixel was colored or in this case alpha was set. That may be
enough information itself. Saving the flattened paths is simply to not
rasterize them agian but the extended alpha format would/could have
enough info so you don't need the paths.

In a sense this is like a 3D voxel but in this case its a fat 2D pixel
not a scene graph  I think and very similar to hidden surface removal
in 3D.
I suspect 3D hardware could be used to accomplish the same goals ?

I don't know what the minumum info needed from a scene graph is to
prevent artificats but if its small you could use a 16-128 bit extends
pixel format to save the info. Also you only need to expand to a
larger pixel format when a crossing is detected where alpha values
don't match. You proably want at least 16 bit to detect pixels that
were never written.



Mike


More information about the cairo mailing list