A few months ago I played with an idea of creating 3D illusion from an image and its depth map. First versions were based on displacement maps (custom implementation in pixel bender) and later I used common 3D engines to transform image into a 3D model. With software rendering I hit fps limit somewhere around 10000 triangles, what is like 70×70 segments per plane. Now if your source image is something like 700×700 pixles, the fragmentation is 10px per segment, that is not enough details for me 🙂 .
Luckily, Adobe introduced Molehill a GPU-accelerated 3D API and I was curious about where the limits of this are. While Away3D already released its molehill version, I have transformed existing 3ddm Away3D version what literally was just like 10 lines of code.
You need Flash Player 11 to view this:
This demo uses 250×250 segments (125000 triangles) and still runs smooth. You can also run it standalone. Textures and depth maps are created with PhotoSculpt. PhotoSculpt software creates photorealistic 3D models and seamless tileable 3D textures.
While both Molehill and Away3D molehill version are still in its prerelease stages, I observed some issues that I had while developing. It seemed like Away3D accepts only texture bitmaps sized at power of two and same size for width and height (64×64, 128×128…). When I tried to use more than 250×250 segments per plane the “buffer is full” exception was thrown. I believe those issues will not be in release versions.
Just a short recap of how to setup your development environment to use molehill:
- download the playerglobal.swc for Flash Player 11
- make sure to compile into swf version 13 (-swf-version=13)
- in HTML set wmode to direct