Search Unity

Problems with cliped texel still showing up.

Discussion in 'Shaders' started by _Franz, Jun 30, 2022.

  1. _Franz

    _Franz

    Joined:
    Apr 29, 2016
    Posts:
    3
    Hello guys,

    I tried to search for some solutions but I is quite hard to find the right something. So It's very possible that the next answer is to look at a other forum entry.

    I work on a Oculus Quest standalone application and use some premade foliage assets. To optimize I want to use the same material on them to the can be batched together.
    I created texture arrays for albino and normal maps. Then I edit the models to include the index for the texture array. I followed this tutorial to modified the standard shader (https://medium.com/@calebfaith/how-to-use-texture-arrays-in-unity-a830ae04c98b) to be able to use my array. I use an opaque option on my material and this all worked fine, my frame rate is nice etc...

    However I seem to have problem with one model and
    when I use a spotlight for my night mode.

    It's like my spotlight can bleed into the alpha channel. Or the differed texture array images blead into each other?

    Here some Pictures


    It seams to work on the grass but also not in all angles.


    Its really confusing to me since a cliped texel should not even be considered anymore or maybe my understanding of how clip() in shaders work is wrong?
    I played around with different cutoff values but I stills renders the supposedly clipped areas.

    I hope somebody can give me a lead into the right direction. Thanks
     
  2. _Franz

    _Franz

    Joined:
    Apr 29, 2016
    Posts:
    3
    Ok I found the problem I especially had to edit also UnityStandardCoreForwardSimple.cginc and UnityStandardShadow.cginc. In the end that makes sense.

    If someone is interested I can share more code.
    However if you know it's actually quite obvious.
    Thx