Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Using Clip/Discard in Singlepass Instanced custom shader not working

Discussion in 'VR' started by Kajta, Sep 19, 2023.

  1. Kajta

    Kajta

    Joined:
    Feb 13, 2016
    Posts:
    11
    Hey, I am trying to make an opaque shader that uses discard/clip to mask out the rendering of the head for local players. The idea is to use Vertex Colors on model parts of the head and read them out in the Shader to mask them out.

    Now whenever I mask out certain parts of the model using any form of evaluation using the VertexColors, I get rendering artifacts and the result is not properly masked out, while it is correctly masked out in the SceneView.

    If use for example, the position of the vertex for discard/clip evaluation, the result is fine, even in VR.
    Any ideas?
    upload_2023-9-19_14-41-46.png