When Alternativa3D showed some demos with their parallax mapping, I always thought it’d be interesting to try it myself without having to resort to PixelBender.
Well, I did, and I wasn’t happy how some things turned out. There was no overlap of objects, and sharp edges would come out looking odd or distorted. Then, taking another look at their demo, I noticed they conveniently used slanted or smooth edges all the time without any possible overlap.
Reading up on some stuff, I decided to make the process iteratable, and liked it much better already. There are some downsides… Most importantly, it’s a cpu-killer and still pretty flawed compared to the real thing (which is a pixel shader). Nonetheless, it was fun to figure out and code, and that’s pretty much the reason why I decided to post it
Oh, and I also rewrote the Bump Map from some time ago, since I needed it to make this demo a bit cooler overall. The code back then was a quick experiment; not exactly a beauty nor reusable whatsoever, which has been taken care of to some extent. Additionally, the lightmaps now support colours and you could just as well write your own.
Check out the demo here and the source here. The images used came from here.










Frits
on Oct 7th, 2008
@ 8:14 pm:
No idea what you’re going on about but it looks spectacular!
sakri
on Oct 8th, 2008
@ 1:43 pm:
WOW, really impressive!
stephane
on Oct 13th, 2008
@ 1:32 pm:
Love it! Why not include some fancy web-cam motion detection to insist on the holographic effect? You know, user moves his head to the right and left to see things differently etc.
Keep up the great stuff
foreground
on Oct 13th, 2008
@ 1:52 pm:
My Q6600 2.4GHz CPU had busy ~42% (firefox.exe)
Bump is similar to http://blog.alternativaplatform.com/ru/files/2007/12/spotnormalmapping.swf , but alternativa is more functionality - have ~15-30% (firefox.exe)
David
on Oct 13th, 2008
@ 2:06 pm:
That’s actually not a bad idea, stephane
Foreground: As mentioned in the post, it is quite intensive indeed, because of the parallax effect which is iterated. A single-iteration version is already much faster - especially if it’s done with a filter instead of BitmapData.applyFilter (not an option tho because of the iteration). But in any case, if you leave out the parallax effect and use the bump mapping only, you’ll see it’ll run much faster as well (showing the bump mapping, however, wasn’t the point of this post - it just makes the parallax effect more efficient because of added lighting).
foreground
on Oct 13th, 2008
@ 2:19 pm:
Oh - http://blog.alternativaplatform.com/en/2007/12/27/parallax-mapping/ not seen .. my CPU have 0-68% (firefox.exe) your parallax is faster 8o) But alternativa have more functionality in demo. And I saw they post in his blog another demo with girl face, may be it has later date and other performance.
David
on Oct 13th, 2008
@ 2:24 pm:
I’d hope their newer version is faster, since (as far as I can tell) theirs a single-pass algorithm
Mr.doob
on Oct 13th, 2008
@ 2:35 pm:
How come you didn’t do it with Pixel Bender instead?
David
on Oct 13th, 2008
@ 2:42 pm:
Hi Mr.doob
I actually wanted to try out a version that would run on FP9 (that, and it was easier to do it using the DisplacementMapFilter to get a grip on the concept). I’ve been working on a Pixel Bender version tho, but I can’t get it just right… The pixel-perfect way of doing Parallax Mapping that can handle steep slopes apparently requires a conditional loop, but I hope I can somehow approximate the effect with hard-coded iterations
Mr.doob
on Oct 13th, 2008
@ 5:43 pm:
Ah! I see I see
We’ll have to wait for Joa’s hack then.
http://blog.joa-ebert.com/2008/09/08/pixelbender-runtime-compilation/
David
on Oct 13th, 2008
@ 6:15 pm:
Hehe yeah, I’ve been looking forward to that as well, but nearly forgot about it! I guess it’s a good way to test my patience
Parallax Mapping with Pixel Bender (still burning cpu’s) | Der Schmale - David Lenaerts's blog
on Oct 14th, 2008
@ 1:11 am:
[...] « Home « (fake) 2D parallax mapping… will burn your cpu [...]
Paul Andre
on Jan 24th, 2009
@ 1:19 am:
Thank you!Your site is very nice
==
http://www.linkedin.com/in/paulandredevera
Timur I. Alhimenkov
on Jan 27th, 2009
@ 7:49 pm:
Good work! Thank you!
I always wanted to write in my blog something like that. Can I take part of your post to my blog?
Of course, I will add backlink?
Sincerely, Timur Alhimenkov
David
on Jan 27th, 2009
@ 7:51 pm:
Sure Timur, feel free
kris
on Feb 7th, 2009
@ 1:18 am:
guess i shouldve found your blog some while ago, very cool stuff!