Material Pixel Perfect Mask

Can create a mask in a material that uses a parameter to adjust length of the mask but need it to be pixel perfect depending on texture size to match retro style.

So far I have this which takes a value from 0 to -128 and multiplies it by 0.003906 to get pixel perfect for a texture that is 128x128.

Anyone know of a better method to achieve the same effect that can be adjusted based on texture size?

Thanks.

Not an exact solution, but this video has some useful information regarding pixel perfect Materials

2 Likes

I was looking for SDF info. Yup SDFs are great.

Also there is great example in epic launcher that uses SDF.