Optical illusion: self-tangling wires (Composition by psonice)

Author: psonice
License: (unknown)
Date: 2011.03.24
Compatibility: 10.6
Categories:
Required plugins:
(none)

Yep, this one is a bit of a mindf**k :) Mouse rotates it (with a trackball).

I was just experimenting a bit with my raytrace/raymarching setup. I wanted to see if I could make a 'weave' (like a basket material), in 3d. Well, I did, using just 2 spheres and some cunning.

Then I wondered, what happens if I modify it with some sin waves? Well, I wasn't quite expecting this :D It looks like a weave that re-weaves itself. Really confusing to watch.

Technical stuff: It's raymarched, using a signed distance field, with ambient occlusion + regular lighting. There's not much to see in the comp, just a shader and a single quad really. The magic happens in the shader.

Try moving the mesh around to move/rotate the camera.

Minor warning: it needs a fast GPU. An intel one definitely won't cut it (you'll be waiting for it to render each frame!) It runs 30fps or so at 640x480 here (recent imac).

PreviewAttachmentSize
ray marching - twisting wires.qtz10.91 KB

dwskau's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Freaking. Awesome.

dust's picture
Re: Optical illusion: self-tangling wires (Composition by ...

sweet, what a happy accident. thats how my illusion happened, unintended. runs smooth on an air in lion. ;)

idlefon's picture
Re: Optical illusion: self-tangling wires (Composition by ...

This is incredible!! Well done!

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Thanks for all the feedback :)

I've improved it "a bit". This version has reflections (yep, true reflections :D Took me a while to figure the maths out!) Also cubes instead of spheres, I think they look better. If you want rounded tubes back, find the f(...) function in the fragment shader, and replace cube with sphere.

Now I just need a checkerboard floor to show off those reflections ;)

PreviewAttachmentSize
rmref2.jpg
rmref2.jpg132.73 KB
ray marching - twisting reflectors.qtz13.26 KB

dust's picture
Re: Optical illusion: self-tangling wires (Composition by ...

wow chris this one is amazing thanks for the share. the reflections are so nice. i like the cubes better.

Scratchpole's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Amazing work thanks for sharing. The second one works in 10.5 with an object inside it :)

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Made a quick video for those short of GPU power:

gtoledo3's picture
Re: Optical illusion: self-tangling wires (Composition by ...

I haven't looked at the composition yet, but it reminds me of some stuff I came across when messing around with the clod one time, except with snazzy lighting :)

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

It's funny looking back at clod. That was written by parapete, I just ported it.. and at the time, I didn't understand it at all beyond figuring out what a few of the parameters were. Now I look at it, and it looks like a pretty trivial setup (still highly impressive though, considering it was 1k including the application ;)

Maybe in a few more year's I'll look at unc's shader for cdak and not suffer a bad case of brainmelt. (And if you're willing to risk brainmelt: click here, and weep.)

usefuldesign.au's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Thks. Very Impressive for a shader.

I got exceptions on 10.5 so a no-go. Plugins required?

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

No plugins. It's probably the mesh renderer I used (which isn't needed, but it fixes a QC bug where the GLSL grid doesn't get rendered if it's offscreen).

I've attached a (hopefully, untested ;) 10.5 compatible version. If you rotate it around, it might suddenly disappear - that's the GLSL grid bug ;) If you try moving the grid around (it's the camera) it'll be more noticeable.

PreviewAttachmentSize
ray marching - twisting reflectors leopard.qtz11.36 KB

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Bored. So terribly, terribly bored. Waiting in a queue to buy an iPad :( feels like a waste of an afternoon to me but I need one.

Anyone know if webgl is supported on iPhone? At least I could play with shader toy :)

Scratchpole's picture
Re: Optical illusion: self-tangling wires (Composition by ...

I would love to be able to use the reflections shader on it's own. Would it work without being integral to the geometry? Sorry if that's a stoopid question.

psonice's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Nope, reflections, shadows etc. all depend on the geometry, and there is no geometry just some mathematical descriptions of shapes. There are ways to use it with regular objects, but it involves making a 3d texture containing a distance field of the object, not easy and not all that accurate either.

Scratchpole's picture
Re: Optical illusion: self-tangling wires (Composition by ...

Ah well, as I presumed. But hey I see that you like a challenge...;)