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

How are reflection probes realtime/onenable supposed to work in 2019?

Discussion in '2019.1 Beta' started by EiknarF, Mar 4, 2019.

  1. EiknarF

    EiknarF

    Joined:
    Apr 28, 2011
    Posts:
    142
    I'm trying to setup a scene where I can update the reflection probes after something happens.

    The way I assume is to set them to real time and on enable, but they update every frame. How do I make them stop updating so I can use the component’s OnEnable() function?

    Thanks
     
  2. EiknarF

    EiknarF

    Joined:
    Apr 28, 2011
    Posts:
    142
    I think this is HDRP specific fwiw. I tried to report it as a bug but the bug reporter gave me a file read fail while trying to create an archive. I then tried to make a new project to send but the option to set realtime reflection probes is grayed out and set to "every frame" so not sure what to do about it...
     
  3. iriguchi

    iriguchi

    Joined:
    Feb 1, 2016
    Posts:
    46
    I try to update reflection probe form scritp. BUT "via script" dropdownlist item is gone away.
    I thnks this is similer problem.
    Of course I sent a bug report but support can't detect this problem......
     
  4. EiknarF

    EiknarF

    Joined:
    Apr 28, 2011
    Posts:
    142
    Yeah same problem.
    I think I should have posted under the Graphics Experimental Previews section instead of 2019 beta, oh well. I've wasted too much time on this, need to move on :(
     
  5. iriguchi

    iriguchi

    Joined:
    Feb 1, 2016
    Posts:
    46
    2019.1.0b5 and HDRP 5.6.1
    I found the item "On Demand"!!

    rp_ondemand.png

    And then I read the souce code on GitHub.....
    ANd I got it.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. namespace UnityEngine.Experimental.Rendering.HDPipeline
    6. {
    7.     public class RPupdate : MonoBehaviour
    8.     {
    9.         public ReflectionProbe rp;
    10.  
    11.  
    12.         // Start is called before the first frame update
    13.         void Start()
    14.         {
    15.             rp = GetComponent<ReflectionProbe>();
    16.         }
    17.  
    18.         // Update is called once per frame
    19.         void Update()
    20.         {
    21.             if (Input.GetKeyDown(KeyCode.U))
    22.             {
    23.                 rp.GetComponent<HDAdditionalReflectionData>().RequestRenderNextUpdate(); ;
    24.  
    25.                 Debug.Log("U");
    26.             }
    27.         }
    28.     }
    29. }
    30.  
     
    LeonhardP likes this.
  6. EiknarF

    EiknarF

    Joined:
    Apr 28, 2011
    Posts:
    142
    Thanks for the reply! I'm on the latest HDRP on package manager, 5.3.1. Will try and update asap