Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Mixed lights in 5.3 stable

Discussion in 'Graphics Experimental Previews' started by TJHeuvel-net, Aug 9, 2016.

  1. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Firstly its great to see Unity is working hard on providing what the community has been asking for, and i'm very much looking forward to using it in production!

    However it is still experimental, if you are looking for a solution that you can use in 5.4 right now, this suggestion might be of use. Our product had always used realtime lights because we found the quality acceptable, however the performance costs was too high for our console port. Our only purpose for switching to baked lightmaps is performance, we are not very concerned with visual quality. If you are in the same boat as us, there might be a solution. Again; this solution removes all visual benefits (softer shadows, indirect light etc) from using lightmaps, your lightmaps will look like realtime lights but perform like baked lights.

    https://gfycat.com/GrotesqueWideAphid

    The scene in the GIF shows a plane and a cube, both static and lightmapped, and a capsule moving about. With the standard shader the mixing is very visible, the dynamic shadow is blended on top despite Unity's best effort. Our modified shader solves this by throwing away all niceties of the lightmap and just applying the realtime shadow where the lightmap used to be.

    The important difference however is that it doesnt draw all other objects in the shadowmap pass, only the dynamic objects are drawn. This makes a huge difference if you have a large scene with many objects.

    Attached is a package with the lightfixed shader.
     

    Attached Files:

    Deleted User likes this.
  2. Deleted User

    Deleted User

    Guest