Search Unity

Creating a Portal Effect That carries Fog Settings on both ends of the Portals

Discussion in 'Shaders' started by dann96, Nov 23, 2020.

  1. dann96

    dann96

    Joined:
    Dec 6, 2014
    Posts:
    113
    I have been in the process of creating a portal effect in my game where the player will pass through a portal on one side of the level and end up on the other side of it. To achieve this, I found a solution in the form of a shader that allows me to transpose a render of the other portal onto the portal that the player is passing through. However, the shader does not take into effect that the portal camera being used to show the other side is set at a distance in order to better parallel with the Main Camera. Is their a way to fix this problem to where the shader renders the fog correctly?

    Heres two images showing how the fog currently "pops in" when the player passes through the portal. Before portal.png After portal.png
     

    Attached Files: