Search Unity

Fragment vs Surface Difference (Simple Question)

Discussion in 'Shaders' started by razzraziel, Apr 21, 2019.

  1. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    Ok i'm still shader noob, but why those are different? I tried a lot but cant get this sparkles work on surface.


     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    I don’t know a reason why your surface shader wouldn’t work. The IN.viewDir should perfectly match the viewDir value you have in the vertex fragment shader, as should the worldPos.

    Make sure there are no warnings or errors showing up when you select the shaders in the project view?
     
    razzraziel likes this.
  3. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    Yes they were same indeed but i had a logic error at somewhere else. Surface couldnt get its properties correct. Thanks.