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.
  2. Dismiss Notice

How do I refresh a Reflection Probe via scripting?

Discussion in 'Universal Render Pipeline' started by AtomicLugia, Dec 31, 2020.

  1. AtomicLugia

    AtomicLugia

    Joined:
    Aug 15, 2020
    Posts:
    54
    I use UniStorm on a scene and the reflection is always "black" with the sun and moon on it. So I use Reflection Probes to fix this issue. Works pretty good, however, since this is a dynamic skybox, I want the Reflection Probes to update constantly, so I set it's type to "Realtime". However, I don't want to use "Every Frame" since this would hit the performance hard. However, there's a option to refresh a Reflection Probe "Via scripting". So I'm going to make a script that refreshes the Reflection Probe every 2 seconds, but I don't know what command to use for that code. I looked up on the threads here but they're so old and outdated and it didn't help. So, what's the code to make a Reflection Probe refresh?
     
    aniline888 likes this.
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    aniline888 likes this.
  3. vignesh211

    vignesh211

    Joined:
    Feb 8, 2019
    Posts:
    13
    Refer the ReflectionProbe GameObject (Let's name it relectionProbeObj).
    Now call reflectionProbeObj.RenderProbe();
     
    aniline888, fairtree and chrpetry like this.