[Fluxus] anti-alias, depth-sort

Kassen signal.automatique at gmail.com
Thu Jul 22 05:28:36 PDT 2010


Hi all,

I think I talked about this before, but now I understand more of it and have
a clear example;

(clear)
(hint-depth-sort)

(define moving_bar
    (with-state
        (hint-ignore-depth)
            (build-cube)))

(define screen
    (with-state
        (translate (vector 0 0 2))
        (scale 5)
        (colour .2)
        (build-plane)))

(define line
    (with-primitive (build-ribbon 2)
        (hint-wire)
        (line-width 3)
        (hint-anti-alias)
        (pdata-set! "p" 0 (vector 0  2 3))
        (pdata-set! "p" 1 (vector 0 -2 3))))

(every-frame
    (with-primitive moving_bar
        (identity)
        (scale (vector 10 1 1))
        (translate (vector 0 (sin (time)) 0 ))))

Here the "moving bar" represents some sort of object that internally ignores
depth. Could be a set of particle sprites, could be some other objects with
transparency. "screen" represents some sort of thing in between that's
non-transparent. "line" is any "hint-wire" type thing, and I think particles
in point mode are affected too.

When these wires are anti-aliased the surrounding pixels are made somewhat
transparent, which makes sense as a way of blending them, but here they are
blended with the bar and the background (coloured green to make this more
clear here), instead of the screen, like they should. Result; we see the
moving bar, through the non-transparent screen, at points around the line.
The odd thing is that removing the "hint-depth-sort" in line 2 cures this. I
find that strange as I'd imagine that depth-sorting would be the default
anyway. On top of that we may need to force depth-sort in some layers of a
structure that involves both transparent and non-transparent objects.

The annoying thing is that wires and points are often the precise kind of
thing that need anti-aliassing the most.

Could be a Fluxus bug, could be a Nvidea bug, could be pilot-error;
hopefully we can clear that up now.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20100722/00b47a44/attachment-0001.htm>


More information about the Fluxus mailing list