Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Change UnivgersalRenderPipelineAsset at runtime on iOS

Discussion in 'Universal Render Pipeline' started by EduardDraude, May 13, 2020.

  1. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Hello,
    I simply want to change the universal render pipeline asset at runtime. One has Cast Shadows checked the other not. I simply exchange the assets with
    GraphicsSettings.renderPipelineAsset
    . This works in the editor, but not on iOS. It stays disabled. Is this not supported or du I have to call something else?
    Additianlly I set the cameras render shadow checkbox accordingly.
    I use Unity 2019.3.11f1 with URP 7.3.1

    Any advise on this?
    Thanks and cheers
     
    Last edited: May 13, 2020
  2. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
  3. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Hmm still no shadows when changing the asset in the quality settings.
     
  4. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    Okay, has nothing to do with changing the asset in Quality/Graphics settings, but with my system how I load the scene. I use addressables and additively insert the scene to the main scene. Something is happening there... Still investigating
     
  5. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    My guess is that some shader variant is stripped, when building the addressables, which contains the scene, models and materials. Does someone know how to prevent it from stripping this shadow shader variant?
     
  6. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    60
    So I think I figuered it out. So when the currently selected RenderPipelineAsset has cast shadow checked, the shadow variants will be included to the bundles. But be caraful, I had to clean build before building addressables to take any effect when changing the RenderPipelineAsset. I guess some caching thing...
     
  7. xgonzal2

    xgonzal2

    Joined:
    Jul 3, 2012
    Posts:
    62
    If I remember correctly URP 7.3.1 still only looks at the currently set render pipeline asset to determine what shader variants to compile so if the currently active one doesn't have shadows enabled then the build won't compile those variants. I think this has already been changed in 8.x.x but can't remember for sure.
     
    EduardDraude likes this.