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

Reflection Probe or camera projection

Discussion in 'General Graphics' started by ThunderMusic, Oct 9, 2018.

  1. ThunderMusic

    ThunderMusic

    Joined:
    Sep 19, 2013
    Posts:
    43
    Hello,
    I have a scene where I need to have a 360¤ view of the exterior of a ship as if there was nothing around the room I am in, but when I get out of the room, everything is there, so I can't make things really invisible except in this exact room.

    I have set up a reflection probe that takes everything but the ship and I have set up my room to have 100% reflective walls. It works, but everything is mirrored. Is there a way to "de-mirror" the textures? I have also tried to set up 6 cameras to make a square and then use them as textures for each of the 6 walls. I don't know how it would hit the performance, but one thing is for sure, I can't make it so I have 6 cameras to form a cube. The aspect ratio seems to be locked to the main graphics' aspect ratio. Is there a way to make those camera square?

    Is there a better way to achieve what I want?

    Thanks

    ThunderMusic
     
  2. ThunderMusic

    ThunderMusic

    Joined:
    Sep 19, 2013
    Posts:
    43
    Finally, I found my solution. I did not notice, but when I assign my render texture target, the camera changes its aspect ratio to match the render texture ratio.

    Now, I have my 6 cameras set up and it does not seem to affect the performance too much for the moment (I only have a test scene with minimal assets). Each camera has a square aspect ratio with a 90 degrees view field, so 6 cameras equal 360 degrees on each side (each side of a cube). I assigned each side to a plane. My problem is, there is a clear distortion at each edge. We see the texture changing from plane to plane. I have centered my camera in relation to my planes, but it only minimizes the issue; it does not eliminate it. I use the "unlit -> texture" shader. Is there a better way to go? Should I use a cube map with a custom inverted cube (pointing inwards instead of outwards)? What are your thoughts on that?

    Example of the visible edges :


    Thanks a lot.
     
    Last edited: Oct 12, 2018