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

Reflection probes and walls/objects exposed to different surroundings

Discussion in 'Global Illumination' started by sqallpl, Oct 29, 2014.

  1. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    375
    I have posted this in other thread about reflection probes but I think that this question deserves its own.

    What about a situation when your walls are single meshes (very typical situation) and you want to achieve proper reflections for the inside faces of the walls and outside faces of the walls too?

    Looks like it's impossible with the actual approach because the reflection probe affects whole mesh instead of just the faces/parts of faces inside the probe.

    I really have no idea how it can work this way.

    When we will put a wall inside a reflection probe that gathers its cubemap from the inside of your building it will affect whole wall so in effect we will get very unnatural reflection for the outside part of this wall. In most common case the outside part of a wall will reflect the interior of the building instead of the skybox. If interior is dark and we have a bright skybox in this case, we will get dark reflections on the walls surrounded by a sunny skybox.

    It can work with 'cube' reflection probes that affect whole object for meshes that aren't exposed to two different surroundings at once (a table in the room for example) but what if there is a mesh like wall or something different that like wall has one part of the mesh inside the building and another one outside?

    Sunny day and building i just an example.


     
    Last edited: Oct 29, 2014
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Break the meshes? :D
     
  3. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    375
    Yes I was thinking about that but this is definitely not a perfect solution and it would require meshes to be divided perfectly to avoid any 'leaks' of wrong reflections.

    Another thing is that for objects that have different shape than cube/plane etc. it would still require a way to 'attach' a mesh to a specific reflection probe, because it would be impossible to correctly place the reflection probe boxes with this kind of geometry.

    Just imagine placing them with this kind of house to correctly affect the interior and exterior parts of the roof ;)

     
    Last edited: Oct 29, 2014
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Parallax corrected cubemaps are not supposed to be "perfect".

    They are just a very serious step up from the old school, infinity projected cubemaps we used up to now.

    If you want "perfection" on something like a floor, you could use some sort of screenspace reflections.

    Maybe for the outside of the house, use some more generic infinity cubemaps (it will look "wrong" but you can make it look good).
     
  5. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    375
    I'm not talking about perfection. Sometimes it's better to have no reflection than have a wrong one.

    I would just use the skybox reflection or input from a reflection probe that is placed outside of the house.

    The thing is that at this moment the only way I can think of to accomplish this is by dividing meshes like walls/roofs etc. into parts (inside/outside) and manually assign reflection probes to them.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    The only other thing I can think of, is tweaking the Standard shader (or, create a variant) so that the cubemap input is per material and not per mesh. You would lose the "automagic" of the cubemap system, but it's doable I think.
     
    sqallpl likes this.
  7. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    416
    You can't have your cake and eat it too, I'm afraid.

    In forward rendering it is necessary to split the inside walls from the outside walls.

    Remember that you can control which reflection probe a certain renderer will use by providing the "Anchor Override" on the renderer. Just use a dummy game object that is placed where only the wanted reflection probe has influence.
    You can see which reflection probe is used in the readonly "Closest" field on the renderer.
     
  8. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    643
    I don't think it is that much typical. I work mostly on architectural projects and my inside and outside walls are different meshes since they usually need different materials and splitting big meshes is better for lightmapping.

    I think you can adapt even if I understand you wanting to keep your usual work-flow.
     
  9. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    can we expect SSR for Unity 5.0?
     
  10. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    416
    No. In Unity 5.x? Likely...
     
  11. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    but earlier than 5.6, right?
     
  12. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    Hey Kuba I was wondering if you could elaborate on this. You've explained what needs to be done in forward rendering by splitting the meshes. What about with deferred rendering, what is the alternative process?
     
  13. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    416
    Right now the process is the same.

    At some point we might switch to "splatting" reflection probes in a similar way the lights are rendered in deferred, which would mean that a given pixel can get contribution from all the reflection probes that overlap it and it would not be limited just to two nearest ones.
     
  14. HalversonS

    HalversonS

    Joined:
    Jan 24, 2014
    Posts:
    28
    This seems to be how reflection probes work in 5.2.2 now, however I'm no longer able to cull them from layers or use Anchor Override. I've looked around and not seen if this is a known issue or intended...
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    In 5.2 the probes are "deferred". They are sampled per pixel from within the bounds of the reflection probe.

    That solves a few issues and creates new ones :)

    In 5.3 there will be a global toggle to revert back to the old behaviour.
     
    sqallpl likes this.