When Baking Shadows is Enough

So I know I promised last time that I had a big COLLADA/3DS Max/Papervision post coming up. Well this is it!

We’ve been working a lot lately with the awesome open-source Flash 3D engine Papervision3D to introduce some 3D elements into our games. Just like any other 3D engine, Papervision gives you access to primitives– in other words, simple shapes like cubes, planes, spheres, and so on– which are great for some circumstances, but realistically won’t meet every possible need for 3D objects (without looking circa-1992, that is). That’s where COLLADA comes in. I won’t talk about COLLADA too much since my last post was pretty detailed. But suffice to say it’s the format you’ll use to get your super detailed 3D assets out of 3DS Max and into Flash.

So you have your awesome 3D objects, your Flash animation, and your game engine going. Wouldn’t a little bit of shadow be nice? Papervision offer a whole lot of options for using realtime shadows in your work. Plus, Super Papervision Master Andy Zupko has this incredible ShadowCaster class that he’s written an article about.

But if you play around a little with Papervision, you may find that things get bogged down once you get some shaders going, especially if your COLLADA has a fair amount of polygons to it. It “chugs”, as Mike calls it. That might be okay for a simple rendered scene or a Web site image, but for a game it stinks!

So then what to do? You don’t want to cut polys on your COLLADA, but you also don’t want to have everything look like a plastic model by removing all your shadows. I would humbly suggest a compromise: bake your shadows into the asset in 3DS Max before you export. (Not sure how to do this? Don’t worry, the next blog post will cover this in minute detail.)

Check out exhibit A, below. Just a simple Utah teapot render with a wood tabletop. You can use the left and right keys to rotate it, just to see how the shadows look. Note that’s I’ve rendered the shadows on the tabletop too, but the table plane could easily be rendered as a primitive in Papervision, even without the shadows, depending on the application.

The bottom line? If you have a stationary object, odds are you don’t need realtime shadows. So why take the performance hit from using shaders? Render it ahead of time and your game will run smoothly!

3 Responses to “When Baking Shadows is Enough”

  1. www.engel-bedeutung.de Says:

    Hi I like your post “When Baking Shadows is Enough” so well that I like to ask you whether I should translate into German and linking back. Greetings Engel

  2. ChrisH Says:

    Hi Engel,

    I’m glad you liked it! Feel free to translate it and let me know the link!

    Thanks, Chris

  3. Makai Media Workshop » Blog Archive » Do you really need a 3d model? Says:

    [...] know that those of you working with Papervision3d (and those of you who read my previous post about baking shadows) are well aware that there are circumstances where you need to decide that, while you could go [...]

Leave a Reply