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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Best way to get one object to show through one object, but not show through another using shaders?

Discussion in 'General Graphics' started by Teledoor24, Aug 6, 2023.

  1. Teledoor24

    Teledoor24

    Joined:
    Aug 1, 2013
    Posts:
    1
    Hello!

    I'm trying to put together my first vtuber rig with VRM and VSeeFace, so I've modeled an anime style character, and for stylistic purposes I would like to be able to see the eyelashes and eyebrows through the hair geometry.

    Currently, the eyelashes have a material with a z-test value of "Always", so that they will always be showing. The eyelashes are part of the same mesh as the head, with a different material on those faces, to keep the blend shapes for facial expressions simple. If they need to be a separate mesh that's fine, I can change it. I'm using Poiyomi shaders.

    The problem is that when you look at the character from the side or the back, the eyelashes show all the way through the head. What methods could I use to make it so the eyelashes are still occluded by the head, but show through the hair geometry? Is this possible just using shaders?

    example images:
    from the front, eyelashes and eyebrows show through hair geometry.

    from the back, they still show through. I don't want this.

    Thank you for your help!!