Search Unity

Bug Lighting doesn't work correctly when at the bottom left of the object.

Discussion in 'Shaders' started by lamoos, Dec 8, 2020.

  1. lamoos

    lamoos

    Joined:
    Jan 23, 2015
    Posts:
    2
    So I have a relatively simple shader that is meant to light up a sprite at all angles (even from behind). The sprite is viewed from an isometric(3D) angle, and once a point light that rotates around the said sprite reaches the bottom left of the object; the way the light works seems totally different from the other angles. It really doesn't make sense to me how just one of the four corners is broken.

    Code (CSharp):
    1. Shader "pls" {
    2. Edit: shader was here
    3. }
    If more info is needed ill post some pics but help would be GREATLY appreciated!

    EDIT: So what I have found to cause this problem is flipping the sprites x scale. However I'm still not sure how to go about getting around this.

    EDIT2: Just gonna flip the uvs instead of the scale. this should sort it.
     
    Last edited: Dec 8, 2020