Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
motorsep's avatar
motorsep
Start Partner
11 years ago

Unity 5: shadowing dynamic objects with lightmaps ?

If you modded Quake (1,2,3), you would probably remember that baking lightmaps also baked lighting into 3D lightgrid, which lit/shadowed dynamic objects. It wasn't perfect, but it was quite decent, automatic and performance friendly.

Apparently Unity doesn't have such a way, and lightmaps don't affect dynamic objects in any way. I was told that the only way to have dynamic objects shaded is to keep all real-time lights in the scene. Wouldn't it be performance taxing on mobile VR?

Another thing I was told was that light probes should do the job, but based on the docs and some training materials online it appears that light probes are only good for indirect lighting for dynamic objects.

So, technically, I'd have to keep real-time lights + have light probes in the scene for dynamic objects to be lit properly, matching lightmaps. Sounds like not something that should be done for mobile VR.

Please correct me if I am wrong and please advise on how to do it for mobile VR properly.

I also found this video: https://www.youtube.com/watch?v=9IqSGjIGp64 which shows pretty cool solution for the problem. Does anyone know how it's done ?

Thanks!

5 Replies

Replies have been turned off for this discussion
  • "owenwp" wrote:
    Light probes do what you are asking for.


    Aye, thanks. I read up on it and it seems to have one major downside - I'd have to manually place all of the light probes across the level :/

    Another concern is performance on mobile VR. Isn't it slow to use light probes as opposite to not using them?
  • Got it, thanks.

    Do you happen to know of any tool for Unity 5 for automatic placement of the probes ?
  • owenwp's avatar
    owenwp
    Expert Protege
    None that I have used. There are two approaches I usually take: either use select all -> duplicate repeatedly to build up a large selection, or add light probe groups to all of my static object prefabs with probes placed all around the object. If you take the latter approach and your game is such that you reuse objects a lot, it gives you guaranteed coverage near most of your occluding geometry without a lot of work, and fewer probes in open spaces where they dont matter.