Home Technical Talk

Environment shadow maps

Hello,

I've seen 3d environment's textures that uses two set of textures:

1. The basic diffuse texture per object

2. A baked alpha shadow map for large sections of a scene including several objects per area all fully unwrapped.

My question is how are these two maps put together in an engine in runtime. Normally I bake shadows on the object's textures themselves but then that takes a lot of texture space by having to separate every single polygon on the UVs. The only way I can think of is making a duplicate of the entire scene, using a push modifier, baking global illumination and then basically have the two environments on top of each other. The smaller environment with each objects' texture and the slightly larger env with the baked shadow textures. But that doubles the geometry.
Can anybody please shine some light on what is the efficient/standard way of doing this?

Thanks.

Replies

  • Warheart
    Options
    Offline / Send Message
    Warheart polycounter lvl 17
    Definitely don't duplicate all your geometry. Depends on your engine but at best I'd imagine you'll end up with horrible z-fighting plus all the extra geometry.

    The way you use shadow/light maps is generally to create a second UV set (or "UV channel" if you're a Max user). In this second UV set you have all your UVs laid out uniquely and proportionally to their area in 3D space (also this set should usually be within the 0 to 1 region of UV space.)

    In the engine the baked light maps are applied through this UV set leaving your normal first UV set to do whatever you want with. e.g. scale up UVs or place them outside the 0 to 1 region for tiling textures or whatever.

    If you give some more details about what engine you are using and the scene you are trying to create then I'm sure someone here will be able to give you specific pointers for what to do in that workflow.
  • vertex
    Options
    Offline / Send Message
    Warheart wrote: »
    Definitely don't duplicate all your geometry. Depends on your engine but at best I'd imagine you'll end up with horrible z-fighting plus all the extra geometry.

    The way you use shadow/light maps is generally to create a second UV set (or "UV channel" if you're a Max user). In this second UV set you have all your UVs laid out uniquely and proportionally to their area in 3D space (also this set should usually be within the 0 to 1 region of UV space.)

    In the engine the baked light maps are applied through this UV set leaving your normal first UV set to do whatever you want with. e.g. scale up UVs or place them outside the 0 to 1 region for tiling textures or whatever.

    If you give some more details about what engine you are using and the scene you are trying to create then I'm sure someone here will be able to give you specific pointers for what to do in that workflow.

    Thanks,

    I don't really have a specific engine in mind, just was curious on how this is accomplished. Yes i'm using 3ds max

    And how do you go about creating that second uv set? Do you select several objects and apply a uv unwrap? How do I avoid messing up the original object's uv map?
  • vertex
    Options
    Offline / Send Message
    Oh, I see you mention I would use a different UV channel in max. I'm not sure either how to do that for several objects at the same time.
  • tristamus
    Options
    Offline / Send Message
    tristamus polycounter lvl 9
    Hey there man,

    It's hard to talk about this generally unless we have an idea of what engine you wanted to use specifically.

    If it's UDK, you just copy your UV's and paste them into a 2nd set / channel in whatever package your using (max, maya), and in that second set, you can move and scale disproportionately to your model. That's right, lightmap UV's don't need to be 1:1 ratio or whatever, and in fact, it's better if they're not, and you should try to take advantage of that to gain better lightmap quality. Just make sure you have enough pixels / padding around UV shells so that when the texture mipmaps, nothing bleeds.
Sign In or Register to comment.