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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Normal shading direction is opposite sunlight?

Discussion in 'General Graphics' started by vsnry, Dec 8, 2018.

  1. vsnry

    vsnry

    Joined:
    May 4, 2018
    Posts:
    35
    I made some blocky terrain generation code, and it works perfectly, but for some reason the normals are getting shaded from the completely opposite side.

    As you can see in the video, the sunlight is going right to left, but the mesh is getting shaded as if the light was coming from the left to the right.

    https://i.gyazo.com/ce22bc09999d46f37b2f650f79904665.mp4

    Any ideas on how I could fix this?
     
    Last edited: Dec 8, 2018
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,229
    How are you generating the mesh normals?
     
  3. vsnry

    vsnry

    Joined:
    May 4, 2018
    Posts:
    35
    Nevermind, it seems that it was a bug with my material. I don't know how it happened, but making a new material fixed it.