|
Volume Render GLSL ShaderJust been working on a volume-rendering implementation in GLSL, based on a tutorial on Peter Trier's blog http://www.daimi.au.dk/~trier/?page_id=98 Unfortunately, since QC can't deal with 3D textures, I can't render any cool medical data with it (until I get around to making a custom plugin that is), but I've been getting some interesting results rendering a couple of surface equations from the Paul Bourke's perennially-popular website. Here's an example, rendering the Borg surface: ..and another, this time it's The Blob: I'll tidy up the QTZ a bit and release it sometime soon, if anyone is interested. a|x
|
Very cool! I'd definitely be interested in seeing the .qtz :)
I'll second psonice's request -- no time for me to actually do anything with it, but it could be a cool launchpad into 3d texture stuff.
(I now realize that we could write a custom image provider/subclass to deal with 3d textures, potentially -- need some more R&D on that front)
Just about to post a QTZ.
Ooh, ooh... reallllllly....? That would be cool. That would be really useful, I think. As long as you could then use them in a standard GLSL patch in QC, of course. I'd still like to write a GLSL patch to do volume-rendering using this or a similar method though.
a|x
OK, here's the composition. The GLSL shader code probably needs some optimisation, but I have a feeling it's never going to be that fast, simply because of the number of times it has to run through the raycasting loop per-pixel.
Hope you can make some sense of it. Peter's blog entry explains the basics of how it works, though I found it a little confusing on the details. Also, the way texture coordinates are setup on the builtin Quartz Composer Cube primitive meant I had to hack the shader code around a bit (took me ages to work out why things weren't working as expected).
EDIT: I should add that it requires vade's excellent v002 Blur patch to be installed. You can easily bypass the macro where it's used though- it's the Bloom one. Then again, you should have v002 Blur anyway; it's very cool!
a|x
Did either off you have a go with this one, by any chance? I'm thinking of adding some other equations, and attempting some adaptive-sampling-type optimisations.
a|x
an intricate piece of work.
responds well to mouse input on the blur or position.
Cheers! Not quite sure what you mean by the blur though.
I'll add support for the SpaceNavigator 3D mouse thing, I think. I keep forgetting I have one on the shelf, gathering dust, but they're actually a pretty cool control device for 3D stuff.
a|x
The Space navigator is that the 3d axys thing that I've ended up using in Audio Atom ? I think so - sheepish grin :-)
Mouse input for x and y position into blur amount and blur sizewas what I was referring to.
SpaceNavigator is a really cool piece of hardware, which I bought a while back, and keep forgetting about. http://www.3dconnexion.com/3dmouse/spacenavigator.php
I used it to control the movement of the IsoSurface in this clip:
a|x
I see, Logitech's 3DConnexion Space Navigator. All becomes clear. A cool looking little bit of kit that does a whole lot more than you might at first imagine.
What a cool clip :-) Spacey Volumetric Dynamics
Cheers!
I like the way the SpaceNavigator allows nice organic movement. I had it setup to allow toggling of the controls, so you could control either rotation/movement, or the parameters of the IsoSurface raytracer, which worked really nicely.
That was the first clip I ever posted on Vimeo, actually...
a|x