- Home /
Issue with PixelPerfectCamera script and sprite masks (see images)... How to fix?
I'm having very strange behaviour with sprite masks that are caused by the PixelPerfectCamera script on Android devices only (I have only tested the game on PC and Android and it is only being released on Android): As you can see, the sprite mask does not work properly for some reason when stretch fill is disabled. What could be the solution to fix this? It is annoying because I have an option in the Options menu to disable stretch fill if the user wants to, as it is a bit of a performance hit (I'm pretty sure) for older phones to have stretch fill enabled.
Please let me know how to go about fixing this! I will reply as promptly as I can.
Edit: Might as well try and kill two birds with one stone here... Another issue I'm experiencing with the camera script on all platforms is when stretch fill is enabled it seems to get rid of the "crisp pixel look" and instead adds an "anti-aliased/bilinear-filtered look" on the graphics, as you can see here: What I want to achieve is the "crisp pixel" look.
I was able to dive into the code actually achieve this by changing this line of code: activeRT.filterMode = m_Internal.useStretchFill ? FilterMode.Bilinear : FilterMode.Point;
I modified "FilterMode.Bilinear" to "FilterMode.Point", and it worked, however, I noticed it made my phone screen's actual pixels seem to have a weird grid effect and very pronounced. This effect is noticeable in the very first attached image. Any way to solve this?