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 Probe inaccuracy

Discussion in 'General Graphics' started by johnnyppp, Aug 28, 2017.

  1. johnnyppp

    johnnyppp

    Joined:
    Jan 18, 2017
    Posts:
    4
    Hey guys,

    I have been trying to use a reflection probe to create a reflective floor surface. The probe is being held at the camera position with the y-axis inverted and the floor in a culling mask to create a surface reflection.
    The reflection is accurate under the camera but the further from the camera, the further the distance between the reflection and the actual object, i.e. if pointing a laser from the camera, will converge directly under the camera and the reflection will be further from the camera and actual object the further it is from the camera, instead of converging at all points of contact with the floor.

    Enabling box projection had no effect, any help would be greatly appreciated.
     
  2. johnnyppp

    johnnyppp

    Joined:
    Jan 18, 2017
    Posts:
    4
    The size of the reflections also doesn't scale as expected, this seems to be a parallax issue.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    I think you're confusing reflection probes and planar reflections. Reflection probes are cubemaps and by default have no sense of distance. Everything reflected in them are assumed to be infinitely far away. Box projection lets you define a box that the cubemap it's effectively projected onto, which will help with walls and ceilings that perfectly match that box, but anything else will still appear in the wrong location. Reflection probes are best used for showing reflections on complex objects where the accuracy of the reflection isn't a concern.

    For reflective floors where accuracy is important you want a planar reflection, or mirror reflection. This also requires a custom shader to take advantage of.

    There are free examples available on the forum and on the Wiki. Do a google search for unity mirror reflection.
     
    dot_entity, xeniaeo and UnityLighting like this.
  4. dot_entity

    dot_entity

    Joined:
    Nov 2, 2012
    Posts:
    79
    More than a few times in Unity, I begin straight on to work with some feature and sooner or later I realise that I need to understand the principle behind, in order to accomplish my task properly. Your comment @bgolus offered me the leap from spending hours trying to fix some floor reflections to finally come to the realisation that the reflection probe is the improper method when dealing with floors.