Shadow texture - precompute

Hi,

Using Unity Pro, it’s possible to use shadow texture like in this page : http://unity3d.com/support/documentation/Manual/DirectionalShadowDetails.html

In my case, the environnement is static : only the player and the camera are moving (no light move, no objects move)

Is it possible to “precompute” shadows texture for the whole environnement, so shadow textures are not computed during game ?

Thanks.

Yes, using Lightmaps. If you’re using Unity 2.6.1, you’ll need to create them in another app such as MAX or Maya. If you’re using the Unity 3 beta you can do it inside Unity using Beast.

Thanks for answer !

But since the user can build a level inside the game, the shadow texture need to be computed at run-time.

I’m looking for a way to compute it only one time (at end of level creation) and not in realtime, at each frame.

You’d need some kind of runtime lightmap creation. There’s some Unity code around here somewhere which computes lightmaps; not sure how fast it is or how easy to adapt to runtime creation.

–Eric

I can’t be sure, but didn’t someone make a bsp oldstyle mapping thing and post something recently along those lines too? I can’t find it now though keeps looking

http://forum.unity3d.com/viewtopic.php?t=35498&highlight=bsp

found it, hopefully it helps!

Thanks for the link, very interesting.

But we are developping our own level-creation tool, not BSP based and designed to be used at runtime (by end-users).

This tool is drag’n’drop based (drag’n’drop objects from a library and move it inside the scene) and we just need a way to compute shadowmaps at runtime.