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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Are real-time reflection probes working with specular convolution on mobile devices?

Discussion in 'General Graphics' started by akiraddd, Jun 2, 2015.

  1. akiraddd

    akiraddd

    Joined:
    Jan 9, 2015
    Posts:
    8
    As I haven't heard any feedback in "Answers" section since I asked about this nearly a month ago, I figured I should try the forums.

    Suspecting specular convolution was simply missing from the real-time reflection probe's render target on Android, I modified a custom shader to simply output all of the cubemap's miplevels. As expected, only the full resolution reflection was present. None of the mipmaps were ever updated with specular convolution (they remain black). This was true regardless of which real-time reflection mode I set the probe to use, enabling/disabling time-slicing made no difference.

    My initial tests using custom shaders I authored for our project appeared to prove that real-time reflection probes do indeed work on Android. Updating reflections every frame was, as expected, fairly slow even with timeslicing enabled, but it did appear work...because the shaders I had used in the test simply displayed the reflection probe's cubemap at full resolution (it just so happened that all of the specular materials in my scene at that time had glossiness set to 1.0). To improve performance on hardware, I elected to trigger reflection probe updates via script and reduce the resolution of the cubemaps...which is when I decided against ever having perfectly smooth materials. And that's when I started noticing that the reflections would drop glancing cube-facings or fade as the camera pulled back from the surface.

    Custom reflections work fine on Android and are my present workaround (the probes are still set as real-time for PC, but the script I use to trigger probe updates switches the probe type to custom on mobile devices). I was hoping to take advantage of script-triggered real-time reflections so I wouldn't have to store files for every environment / lighting scheme we plan to load at run-time.

    Is this a known bug or simply a limitation of real-time reflection probe implementation on mobile devices? I haven't even checked to see if this is the case on iOS.
     
  2. akiraddd

    akiraddd

    Joined:
    Jan 9, 2015
    Posts:
    8
    Anyone?
     
  3. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    I'm having the same issues.

    Realtime reflection probes on ios set to update via scripting are black.

    The work around is to set a custom reflection probe.
    create a legacy cubemap texture, Set mip maps and face size and readable in inspector.
    Assign this texture to the reflection probe.


    instantiate a camera and rendertocubemap(into the created cubemap texture).
     
  4. akiraddd

    akiraddd

    Joined:
    Jan 9, 2015
    Posts:
    8
    Awesome. That works on target hardware! My script now generates a cubemap render texture, briefly associates it with the main camera where I call RenderToCubemap on the first frame, then assigns the texture to the probe.

    Ironically, reflection probe custom texture baking, real time reflection probes, and RenderToCubemap appear broken on PC (when running in OpenGL mode) in 5.1.1.p2...
     
    Last edited: Jul 10, 2015