00:00
00:00
mike
hello!

Mike Welsh @mike

Age 38, Male

stupids

Penn State

San Diego

Joined on 2/24/00

Level:
23
Exp Points:
5,596 / 5,880
Exp Rank:
8,107
Vote Power:
6.47 votes
Rank:
Police Captain
Global Rank:
3,933
Blams:
1,268
Saves:
1,003
B/P Bonus:
16%
Whistle:
Normal
Trophies:
10
Medals:
916
Supporter:
9y 11m 15d
Gear:
1

raytracing with adobe pixel bender

Posted by mike - July 22nd, 2008


I started playing around with Adobe's Pixel Bender, the image processing language that will be integrated into Flash 10. Pixel Bender lets you make things like custom filters and blend modes, so I'm sure we'll see all kinds of cool effects pop up.

After reading through the Pixel Bender spec, I was impressed that it had good support for conditionals and loops, which is a tough spot for these shader languages. So what do I do? Push it to the max and make a raytracer, of course. :)

You can download the source .pbk file here. You'll need the Pixel Bender Toolkit to check it out.

It's your run-of-the-mill raytracer featuring ambient, diffuse, and specular lighting, reflection, and shadows. There are a few sticking points I had to work around. For one, there's no recursion in Pixel Bender, so spawning a tree of rays from a single ray would be tough. This rules out having objects that are both reflective and refractive, for example. Secondly, there's no indirection. This makes it difficult to have different type of primitives, so I'm rendering spheres only.

The Pixel Bender toolkit renders using the GPU, so its really cool to see the picture update at 60fps. :) It's even more awesome to think that this could run inside Flash Player 10! Unfortunately, it looks like that's too good to be true. For one, Flash 10 only supports a subset of the Pixel Bender spec. You could work around this, but even then, all signs point to Flash 10 running these shaders on the CPU only. Setting the Pixel Blender toolkit to run in CPU mode slows the raytracer to a crawl. :(

Watching the GPU do all this crazy stuff makes me wonder about the future of graphics hardware. As we add things like branch logic to our GPUs, they become more and more like a generalized CPU. Will we get to a point where the GPU/CPU distinction doesn't even exist, and your "graphics card" is just used as another core? Or will the GPU continue to be distinct as a very specialized, parallel number cruncher? I'm not really a hardware guru, so maybe I'm way off base here.

I'll be at San Diego Comic-Con this weekend, at The Behemoth booth. Stop by and check out Castle Crashers. :)

raytracing with adobe pixel bender


1

Comments

That's mighty spiffy that pixel bending

SWEET MICHAEL!

That is awesome.

radical

I wish I understood what you were talking about :C

3d shit

complicated.................

nice!!

Looks like you could make a blue spheres fan pic with that and it look real...(Blue Shpere is a Sonic minigame,or it can refer to the secret mega-game.

Oh and please tell Tom I said hi.

why do you have to do this to me mike

Holy crap! I had no idea that Flash 10 was capable of this!

I agree with you that it will be very interesting to see how GPUs are used in the near future. Espcially when they start implementing the single chip integrated CPU and GPU. I did a backflip when I found out that Flash 10 was going to be given GPU support. The possibilities make me drool a bit.

Intel says it will have 80-core processors by 2012. The scary part is realizing that that's only 4 years away. At some point soon, Flash and Flex will have the ability to become something much more than what they are.

sketchy

IT DOESN'T MAKE A BIT OF DIFFERENCE; THE BALLS ARE INERT.

Wow, extremely hot.

!_!
woooooooooooooooooooooow
grovie XD
jajja
zee you later

if your interested in new processor tech check out the worlds first artificial DNA molecule. It has great potential for super fast storage and processing capabilities
<a href="http://www.ecogeek.org/content/view/1913/71/">http://www.ecogeek.org/content/view/1 913/71/</a>

Haha, I love it. "Let's just write a raytracer for fun!" You code monkeys are too much!

and I thought flash was laggy as is, even with the player 10 beta, if someone tries to run this thing on MY CPU it'll probably fry my whole machine, great job Adobe, I liked it better back when it was Macromedia

That's fucking sweet.

More Results