After the contingent destruction of my history on the forum, my tutorial was lost (boo!). But! It has returned! (yay!) And it's actually even better than ever, with a few new tricks you're gonna wanna learn:
https://adventure-creator.wikia.com/wiki/Unity_2018.2_Pixel-perfect_cameraIf you have any interest in pixel-perfect, retro, or any kinda of old-skool adventure game, please check my tutorial out, and let me know how you get on. I'm keen to get this as easy to follow as possible, so let me know if there's any step that needs refining or if I've missed anything out (hard to imagine! :P)
Comments
Amazing guide! The only thing I'm missing is preserving pixel perfect scaling of the character sprites when using the sorting maps. Any sprite scaling (even just in the transform) will result in subpixels compared to the background. Is this something that you've looked into?
Sorry for the late reply! I've had no issue with sorting maps, are you using Upscale Render Texture? Rather than forcing pixel perfect positions, it will scale everything to a internal RT so it will be forced to always appear correct, even if an object is rotated or scaled. Which method are you using?
True, but I couldn't stand the resulting blur in that case, so I ended up making my own render to texture solution with greater control of how the viewport is scaled
Oh, you don't need to worry about that awful blur, just modify the camera script as I put in the guide:
RenderTexture activeRT = m_Camera.activeTexture;
if (activeRT != null)
activeRT.filterMode = m_Internal.useStretchFill ? FilterMode.Point: FilterMode.Point;