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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

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:
    6
  2. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    290
    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:
    6
    but do

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

    hippocoder

    Digital Ape Moderator

    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:
    6
    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 Moderator

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