Search Unity

Question Crop mesh inside bounds?

Discussion in 'Shader Graph' started by hippocoder, Jan 30, 2020.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Is there a high performing mobile friendly technique that'd crop a mesh inside some bounds set on the material? it's for meshes that might be really near to each other and I want to avoid stencils.

    I haven't found anything that avoids the use of clip or discard instructions since these are awful on mobile VR.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Well that's a real hard one, the only options left are transparency, but then you get overdraws, or mesh cutting, which move effect to the cpu. There is slice algorithm, you would probably need to apply it every movement update of the object. Another stupid one would be to render object on another overlapping camera, which you would then manipulate the bound, and that would be 2d.