[Fluxus] commit (pixels->depth)

gabor papp gabor.lists at mndl.hu
Sat Dec 15 08:35:31 PST 2012


hi,

i committed a new experimental feature (pixels->depth), which returns
the depth buffer of a pixel primitive renderer as a texture:
http://git.savannah.gnu.org/cgit/fluxus.git/commit/?id=33c08d8da1b56a7b60a19786ba07165365751a9f

this is a basis of many more advanced 3d shader effects like depth of
field or shadow maps.

basic depth of field test screenshot:
http://www.flickr.com/photos/gaborpapp/8273123622/

(pixels->depth) can be used similarly to (pixels->texture)
this example renders a scene and shows its depth map next to it:


(clear)

(define p (build-pixels 256 256 #t))

(with-pixels-renderer p
    (clear-colour (vector 1 .6 .1)))

(with-state
    (hint-unlit)
    (translate #(1.1 0 0))
    (texture (pixels->depth p))
    (build-plane))

(every-frame
    (with-pixels-renderer p
        (random-seed 0)
        (for ([i (in-range 55)])
            (with-state
                (rotate (vector 0 (* 20 (time)) 0))
                (translate (vmul (srndvec) 8))
                (draw-cube)))))

best,
gabor




More information about the Fluxus mailing list