Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Shader behaving differently for second instance

Discussion in 'Shaders' started by genedegsg, Jun 13, 2017.

  1. genedegsg

    genedegsg

    Joined:
    Jun 3, 2015
    Posts:
    8
    Not sure what's going on here, but the custom shader is not behaving properly for the second instance of this dress. It looks washed out and its shadows are different. In the image, the one on the right (where the character is wearing the baseball cap) is correct. It's especially noticeable in the armpits. I've checked to be sure: both dresses use the same material, maps, shader, and shader property settings. Both are in the same layer. Both are using Mesh Renderers with the same settings. There are no warning or error log entries.

    Does anyone have any clue why the one on the left looks wrong?

    thanks much!
    Gene
     
  2. LukasCh

    LukasCh

    Unity Technologies

    Joined:
    Mar 9, 2015
    Posts:
    102
    Hey, yes it looks like the dress is unlit (Maybe some issues with normal). What rendering mode are u using, could try comparing forward vs deferred with your scene?
     
  3. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Are they marked as static? Could be batching at work if some of your shader code depends on the object space position.
     
  4. genedegsg

    genedegsg

    Joined:
    Jun 3, 2015
    Posts:
    8
    LucasCh do you have any other ideas?
     
  5. genedegsg

    genedegsg

    Joined:
    Jun 3, 2015
    Posts:
    8
    This issue can be closed out. I narrowed it down to Mega-Fiers recalculating normals, so it has nothing to do with my shader or with Unity's game engine. Somehow, switching Normal Method from Mega (default) to Unity permanently fixes the problem, even in the actual build as opposed to the editor, and even if you later switch back to Mega, which I had done in the original-- this explains why all the settings in the editor were identical and yet I was seeing different behaviors. I've confirmed with multiple repros. This looks to be something deep in Mega-Fiers guts.
     
    Last edited: Jun 26, 2017