Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Instantiated content not affected by scene fog?

Discussion in 'Addressables' started by JelmerV, Mar 29, 2021.

  1. JelmerV

    JelmerV

    Joined:
    Nov 29, 2012
    Posts:
    237
    I have a scene that is mostly instantiated from an addressable asset, expect for the excavator in the discance (I forgot to add it :p)
    However, that excavator made a bug clear: the addressable content is not affected by the scene's fog in my built version of the app (Oculus Quest)

    Here you see that only the excavator (part of the scene) is blueish, while the rest of the scene (addressables) is not blue-ish

    Unity bug android.jpg


    In the editor however, everything loads fine and blends with the fog, everything in the distance has a blue tone:

    Screenshot (65).png


    What is going on?

    Using Unity 2019.4 with URP 7.x
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,238
    I'll kick this to the team for some insight, and guidance. Which version of Addressables are you using?
     
  3. JelmerV

    JelmerV

    Joined:
    Nov 29, 2012
    Posts:
    237
    Hi

    Thanks for getting back to this. In the meantime I found out about the problem: the addressable system doesn't take into account shader variants that may occur when loading it into a scene that contains fog. In my case I had to set these values and now all works. But I think more people will experience this problem at some point so it probably needs some explanation.

    Unity 2019.4.17
    Addressables 1.16.16
    URP 7.5.2

    Screenshot 2021-04-05 220757.jpg
     
  4. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    14
    Hi could you explain a bit more on how the scene/its objects are being loaded. Is the scene an addressable asset that contains all the objects (with the exception of the excavator)?

    Also when in the editor, are you using a play mode script other than "Use Existing Build (requires built groups)"? That script most closely replicates the behavior of a build application as it will access data from your AssetBundles. This might be the reason why you're seeing different behavior in the editor vs the build.
     
unityunity