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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Cubemap MipMaps inadequate for Reflection Probes for PBR

Discussion in 'Unity 5 Pre-order Beta' started by Waz, Nov 18, 2014.

  1. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    286
    The blurring of the reflection from an object uses the mipmaps of the reflection probe cubemap - using lower resolution the rougher (less smoothness) the material. This is good.

    However, this fails whenever it uses Mip 6 because while this image is certainly low resolution, the borders between the faces of the cube are hard edges, making the material look highly relective.

    Here is a metallic sphere with smoothness 0.2, note the crisp lines in the reflection on what is supposed to be a very rough surface. You might think it's smoothness 0.9 in a rather drab room. The apparent high smoothness is particularly obvious when the object/camera is moving.

    CubemapMipMapsProblem.jpg

    By comparison, at smoothness 0.4 it uses mip level 5, a nice dulled reflection:

    CubemapMipMapsProblem2.jpg

    If, when creating Cubemaps, at least for reflection probes, the edges of the cube where forced to always be equal on touching faces on each mip level (they generally are on early levels), I think it would all work fine.

    This is not really a new bug but rather something that is only showing up now because of how important reflection cubemaps are in PBR.
     
  2. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I can confirm this behavior. Looks horrible. :(
     
  3. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    They really should be doing the edge fixup thing, such as what ATI's CubeMapGen does.
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    Eh...strange, are those imported cubemap or generated by reflection probe??? since i never encountered this issue.
    Edit:
    Okay...scratch that, this issue occured in Dx9 mode, in Dx11 mode the reflection are perfect.
     
    Last edited: Nov 19, 2014
  5. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Yep, DirectX 11 made it so that texCUBElod sampled between cube faces, so that the harsh edges aren't there. If you're only targetting DX11, then you don't need to do edge fixup. Of course, not everybody is targetting only DX11, so...
     
  6. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    well this is kinda strange actually, since fixup edge seams seems not working in Dx9. this was working correctly in unity 4 isnt? maybe a bug
     
  7. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Edge fixup never worked in DirectX 9, you're probably mis-remembering.
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    i see, probably i missed something then.
    well i'm just didn't notice those kind of seams before, since what i got is good enough for me :p
    Those were unprocessed cubemap btw, and i'm not sure how it supposed to behave.
    Cubemap.PNG