iOS - edge flicker using decal mask over spritesheet

Hi,
I am using Aras P’s Decal2UVs.shader

http://www.unifycommunity.com/wiki/index.php?title=Decal2UVs

where the underlying main texture is a spritesheet and the overlying decal is used as a mask. The decal texture has an opaque border around a transparent center, and it is clamped so that the border pixels spread out to hide the unwanted parts of the spritesheet

The shader is applied to a bell-shaped mesh and works fine except for flicker from the spritesheet showing at the object edges where the mesh normals are nearly parallel with the screen.

Is there a way to adjust the shader so as to avoid this effect?

Any help would be much appreciated - I have looked through many of the shader tutorials and have not figured out the best way to solve this.

Thanks,
Gavin H

I don’t think it has anything to do with normals, but rather, what mip level those pixels are using. Non-uniform textures look really terrible when they are only taking up a pixel or two, and next to pixels that are using much higher res mipmaps - the colors (and if applicable, transparency) don’t match up. I’m interested to hear if anyone has a solution to this.

Hi Jessy - thanks for your thoughts on this.

Is there a way for the shader to mask out (or make solid color) the unwanted UV areas of the spritesheet - ie directly manipulate the _Main texture contribution - as it cycles through the sprites? Also, am I right that depth offsets can only be applied to the shader as a whole?

And, if I can’t find a way within the single shader, should I be looking at doubling the mesh and using the a depth offset to have a mask mesh write over the mesh with the cycling spritesheet?

Very appreciative of your advice - and of your video tutorials which are excellent,
Best,
Gavin