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

Flickering and Buggy Reflections

Discussion in 'Unity 5 Pre-order Beta' started by tbg10101_, Jan 12, 2015.

  1. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Hello all,

    I am seeing a pretty severe issue with reflection probes. In the editor reflections seem to work fine with a slight flicker. However, once I made a standalone I noticed some pretty bad issues. I tested on Windows 8.1, Nvidia GTX 970 and the latest drivers available. The application is running in DX11 mode. The reflections flicker between the two images seen below: Bad1.png Bad2.png
    Here is a reference image with the reflection probe disabled:
    NoReflections.png

    Any idea what is going on? Any idea how to fix it? Is this a bug?
     
    Last edited: Jan 18, 2015
  2. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    I found one problem with the flickering which fixed it in the editor. This is what I used to have to update my reflection probe:
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class ReflectionsUpdate : MonoBehaviour {
    4.     private int renderID = -1;
    5.  
    6.     void LateUpdate () {
    7.         ReflectionProbe r = gameObject.GetComponent<ReflectionProbe>();
    8.  
    9.         if ((renderID == -1 || r.IsFinishedRendering(renderID)) && r.enabled) {
    10.                 renderID=r.RenderProbe(false);
    11.         }
    12.     }
    13. }
    I realized that the above code mixes the time-sliced mode with the immediate mode. So this is what I have now:
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class ReflectionsUpdate : MonoBehaviour {
    4.     private int renderID = -1;
    5.     public bool timeSlice = true;
    6.  
    7.     void LateUpdate () {
    8.         ReflectionProbe r = gameObject.GetComponent<ReflectionProbe>();
    9.  
    10.         if (timeSlice) {
    11.             if ((renderID == -1 || r.IsFinishedRendering(renderID)) && r.enabled) {
    12.                 renderID=r.RenderProbe(true);
    13.             }
    14.         } else {
    15.             if (r.enabled) {
    16.                 renderID=r.RenderProbe(false);
    17.             }
    18.         }
    19.     }
    20. }
    Like I said, this fixed the flickering in the editor. Now reflections work and look exactly like they should be in the editor.

    Now this is what reflections look like if I build a Windows x86 standalone:
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Please submit a bug with repro project attached, thank you. You can do it via menu in Unity, Help->Report a Bug