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. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lightweight and HD in same build (proof of concept)

Discussion in 'Graphics Experimental Previews' started by rz_0lento, May 4, 2018.

Thread Status:
Not open for further replies.
  1. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I know Unity devs have claimed this doesn't work (in many occasions) so I gave it a try yesterday:

    https://www.dropbox.com/s/uiv721bm7oyhuf6/Unity_SRP_swap_tweaked.gif?raw=1

    There's a small difference in the PP's as I just used the ones from HD and LW templates (should have disabled vignette on HD) and they use different sky system.

    The way I did this wasn't very practical, I did this only to see if it were possible despite what Unity has said. Basically I swap the LW and HD assets from c# code and load a level that's been setup for that particular SRP materials & shaders.

    I feel that Unity has said this doesn't work mainly because you simply cannot swap from SRP to another on the fly on same shader configuration (as each SRP rely on their own shader setup). But if you swap the shaders on level to point into your SRPs own variants, it seems to work just fine. Basically you'd have few options on how to do this: Swap shaders immediately after level load or make your shaders include both variants and detect current SRP by some global variable or make a duplicate scene where you swap everything for the other SRP (in which case you'd want to make a script that can serialize the levels and make it do all the mirroring/changes for you). I also had to set the LW sky manually from lighting settings and disable automatic lightmap baking for this setup as it rebakes automatically when you swap the pipeline asset in the editor. In my test, I was using only realtime lights.

    I'd love to hear from Unity devs, is there any other reason than different shaders (and sky) why you claim this isn't possible? (did I miss something?)
     
    Last edited: May 4, 2018
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
Thread Status:
Not open for further replies.