lightmap question..again..

I´ve got a mental blockage, perhaps you could help me.

Just imagine this scene. I´ve got my hallway (corridor) in a hospital scene. Things like chairs, tables trollies etc. are static, they don´t have to move. Let´s go further and place a couple of little objects i.e. books, water glasses, flowers, small things on the tables.
My character (3rd person view) walks around the scene, casting a realtime shadow.

To increase performance, the static objects shouldn´t cast dynamic shadows, just the baked ones (even if the camera is close up to them).

Now somebody told me that this wasn´t possible. He said that the dual lightmapping switches real lights on when the camera is close and turns lightmapping on when objects are far away.

But it must be possible somehow…Otherwise whem I´m close to this table object EVERY little thing casts a realtime shadow???

Additional note: In my 3D rendering program I could create a lightmap for all static items, throw onto them, in Unity I´d turn “cast shadows” off, turn “receive shadows” on, add a light to the scene and … voilá … static baked things with realtime shadows for my character.

This must be possible to do in BEAST?

Are these shadows in the image realtime shadows? If yes, why?

Could I use the beast created lightmaps in my legacy-lightmap shader? If I would bake only the selected “room-box”, could I just throw this lightmap exr-file onto the material (lightmap slot) of my box object?

Best regards and thanks,
Oli

Probably yes. Because when the character goes over that, you can see a slice of light cast on to him

You can take the files and do whatever you want with them. Convert them use them in other shaders etc, so yeah you can use it I don’t see why not. But… Why are you using the legacy shaders again?

Well turning shadows on and off for specific objects in realtime works just how you’d expect it to. Have them casting shadows for the purpose of the lightmap creation but not for the realtime side of things. You can always use the single lightmap approach, or clone the far version as the near version, giving you the best of both worlds (dual lightmaps really are an awesome idea).

Anyway, yeah you can do what you’re suggesting if you have issues with the above (I toyed with the same idea myself pre-v3.x actually), and it’s quite possible to do what you’re asking.

Buuuuuuuuuut

You’ll begin to notice strangeness when it comes to lighting, specularity etc. You can create shaders to get around the problem, using alpha channels to limit specular effects where there should be shadows, things like that. But it doesn’t quite look right in practice, you also end up with the realtime shadows overlaying the baked ones, which again doesn’t quite look right (though it’s seen so often in games, I doubt anyone would consider that a game breaker).

All Beast does, is generate (if you let it) the UV2 coords on your models, then bakes the lightmap/s. From there it’s no different to before if you choose to do it the 2.6.1 way. Though you really want to give Dual Lightmaps a chance. One little trick I use btw, is to have the lightmaps just a bit darker than they should be, then use a single distant light without shadows to bring out normal mapped features in the distance, ever so slightly (works with pointlights too, and is probably more optimized with those than one light to light everything), takes a bit of tweaking to get the near/far maps matching brightnesses, but it gets around the no normal maps being baked into the lightmaps. Parallax continues to work as normal regardless of distance.

Thanks for your quick answer. I´m using the forward render mode (modified shader pragma for point light shadows) , because I need nice antialiasing. Isn´t that the right shader to use for a lightmap?

You got me on that :frowning: I only use Deferred, it’s pro’s tend to outweight the cons… in my case anyway (so don’t quote me on that lol).

You do have to edit the shaders to allow for dual lightmaps to work in forward I think though.

Thanks for both of your answers. :slight_smile: Yes, you do have to alter the shader pragma for dual lightmaps. I think I´ve got info for now, I´ll just have to do some testing.

Hurry up with your next lightmap question thread too, I have fun answering them :smile: (I’m a total lightmapping whore)