Search Unity

Question Multiply Lighting

Discussion in 'Global Illumination' started by IrishCyborg, Jul 1, 2021.

  1. IrishCyborg

    IrishCyborg

    Joined:
    May 29, 2018
    Posts:
    6
    Hi,

    I'm working on an FPS game where the user can switch to a third person view. However, while in that third person view, I want them to only be able to see the things they could have seen while in first person view if they turned 360 degrees.

    Here is a diagram explaining my goal:



    I was thinking maybe I could use a light for this, i.e. have a light emitting from the player, which multiplies the light information of everything it touches by 1 or 0, depending on how far away it is.

    For example, if the "light" had a 6 meter range, everything within 6 meters that wasn't obstructed would be visible, with the same lighting information from other sources as it would have had from the first person view.

    Does that make sense? If so, how could I do this?

    If there's a more efficient or easier way to achieve this effect, please let me know! :)
    Regards,
    Fynn
     
    Last edited: Jul 1, 2021
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    A simple shadow casting point light attached to the player character might just do the trick. You would disable ambient lighting upon switching to the third person mode.