Search Unity

Question Desperately trying to fix this point light bug on my grass!

Discussion in 'General Graphics' started by Introfernal, Oct 14, 2021.

  1. Introfernal

    Introfernal

    Joined:
    Dec 5, 2017
    Posts:
    9
  2. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    Blend OneMinusDstColor One


    source color is multiplied by 1-Destination and added 1*Destination...

    having trouble mentally seeing this but
    (light * 1-grass) + grass?

    OneMinusDstColor would turn green -> magenta

    It kinda looks like that can be part of the issue... but the instruction confuses me as to what it was trying to accomplish
     
    Introfernal likes this.
  3. Introfernal

    Introfernal

    Joined:
    Dec 5, 2017
    Posts:
    9
    but do

    hmmm interesting..
    Do you have any idea what is causing them to glitch to white?
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    place saturate( ) around your output in fragment shader, see if it fixes it.
     
    Introfernal likes this.
  5. Introfernal

    Introfernal

    Joined:
    Dec 5, 2017
    Posts:
    9
    Thanks but its still not working :(

    upload_2021-10-15_1-34-2.png


    upload_2021-10-15_1-34-8.png
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Are the normals for the mesh OK? How does it look for a Unity sphere - lit correctly?