Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How to set Realtime Shadows Resolution Via Script

Discussion in 'Universal Render Pipeline' started by ClearRoseOfWar, Nov 30, 2022.

  1. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    87
    Hello,

    I am trying to set the realtime shadow resolution of a point light, but It doesn't update in the inspector nor can I see any changes in the scene-view.. I have it set to low in the inspector. When I change things like LightShadows and LightRenderMode it works fine. but nothing seems to work for shadowResolution.

    I found a thread that informed me its possible that urp doesn't support changing shadow resolution at runtime, but how could I Instantiate a point light at runtime, and change its settings?

    This is what I'm trying here:
    Code (CSharp):
    1. _light.shadowResolution = LightShadowResolution.High;
    Obviously, I'm missing some key information here.. Any thoughts?