Lightmapping, shadows and multiple objects problem

Hi,

This is my first post here, so I’d like to say hello to everyone.

My problem is: I have a large terrain with multiple houses. When I use lightmapping to make shadows, I have to use “Bake” option which bakes shadows for EVERY object which is set to static. As you can suspect, this takes ages (3-4 hours) to bake. The other problem is, that I have then hundreds of lightmap textures…

So my questions are:

  1. If I have duplicated object - can I have ONE lightmap for many duplicated objects? (ie: 2 different objects duplicated many times will have only 2 different lightmaps)
  2. Can I lightmap separate objects one by one? I always have previous lightmap overwritten (even for different objects)
  3. When I chose “Bake selected” with one house, then I have only this one object lightmapped (which is OK), but only one shadow on the terrain (but all the trees cast shadows). Can I have EVERY object cast shadows but none of them be lightmapped (to avoid having a lot of lightmaps)

I’m using Unity Pro.

Sounds like you want ultimate control over your scene’s lightmaps. Myself, I would lightmap manually with something like VRay or mental ray in your DCC package if you need that kind of maximum manual control over everything. Beast is good, but it is geared more towards being very “automatic” and doesn’t have the manual controls and tools it appears you’re looking for.

Well… If you bake once and duplicate the object later, it will have the same lightmap, but the next time you press bake it will get it’s own space in the lightmap, so it’s not really a workable solution.

AFAIK, no.

Bake Selected is meant for previewing, nothing more. If you want an object to contribute to the lightmap, but not be lightmap shaded itself, you can go to lightmapping → Object and put 0 in “Scale in Lightmap”. Scale in lightmap in generally is very useful if you want to optimize your lightmaps in any way.

You saved my day. This is almost exactly I wanted - shadows on the terrain and nothing more (and rendered very quickly).

I’m still afraid of VRAM usage when game is completed - many objects with many lighmaps will consume all the VRAM available. Is reducing lightmap size (in pixels) is the only workaround?

Well, adjusting scale in lightmap for each object is a nice optimization, to reduce the number of lightmaps. For example things that the player isn’t supposed to get close to, should have the same resolution as the rest of the scene, right? So having those with scale at lightmap at say 0.1, will make them still look good from a distance, and they will use less lightmap space.

That’s kinda work differently - you have big texture with lots of objects (thats where atlas params come into play) - you just have object’s uv2 scaled and translated to correct place in lightmap - so no it is not hitting vram like if you have every object with separate lightmap.
So to reduce VRAM usage in that scenario your options are: lower resolution or create better uv2 [there are also some settings probably in beast.xml to setup inter-objects padding - but even if you find it - don’t touch ;-)]