Smooth 2D Camera is an addon that allows 2D games to display crisp and clear images with sharp outlines, and avoid a pixelated or blurry look. Setting it up in your project is very easy, just add a single script to your camera.
This video demonstrates how Smooth 2D Camera can improve your graphics:
(please watch in fullscreen resolution)
I’m confused as to what this does. The main picture in the asset store seems really deceiving considering it’s just not possible to extrapolate from that low res sprite to a high res sprite. Does it just use a distance field to improve edge drawing? Which by the way means there’ll be some memory overhead which should be mentioned.
Hey Blizzy.
I wrote a review and mentioned I had some issues with your asset. My setup is identical to the setup in the demo scene. I have a Canvas (with screen space and a UI camera assigned) and then I have my main camera which has the Smooth2DCamera script attached. I have UI elements using the Mask component, and these aren’t working unless I change the RenderTextures that your asset creates so they use a 24bit depth buffer. This does not affect the glitches that I see though.
It looks like this: https://gfycat.com/UntriedRemorsefulAmbushbug
I only get the glitches in the UI, the sprites seen by the main camera looks perfectly fine.
EDIT: While investigating I found that when I pause my game (not by changing the timescale, but by some custom code) and all the moving sprites stops walking around, the glitches goes away, so it seems to be linked to that for some reason. Will keep looking.
You’re right about the depth buffer, I have changed that in the code now.
The flickering seems pretty odd. If I see that correctly on your GIF, it doesn’t seem to happen on every frame of the animaton? Can you tell me more about the setup of those images? I don’t notice anything strange here with a static UI image and a mask (with the change to the render texture regarding the depth buffer, of course.)
I can now reliably reproduce it, and it definitely has something to do with UI masks. In the example below I’m using a horizontal scrollrect to slide two elements left and right. They’re both masked by a parent so when they leave the side they’ll disappear. However, it looks as if they also cause the glitchyness to appear when they exits/enters the mask. https://gfycat.com/FrequentPolishedDairycow
EDIT: They’re made like this:
Mask and Scroll rect (mask is not showing graphic)
– Horizontal Layout Group
— Item 1
— Item 2
The hands on the clock seem to have gone missing, and the numbers are messed up.
In the left bottle, the red contents of the bottle is replaced by the map image.
The K icon is replaced by some black mushroom, which you can also see on the far right.
The map is replaced by the flag.
The spot where the flag has been has gone empty.
The person image has been replaced by that black mushroom.
Right now I’m a bit stumped as to what would be causing this messup. Smooth 2D Camera is only causing all cameras to render into a render texture, and then it displays the contents of that texture onto the screen. It doesn’t care at all about what is being drawn.
No camera effects. I’m on Unity 5.2.03f.
I’ll try and make a package for you later today Thanks bud!
Also, to your other post - it does look super weird. At first I thought it had something to do with sprite packaging and sprite atlases since it seemed like some of the images were being replaced by others, but I get the same glitches even when not using atlases, and as you say - since it’s just using a render texture it shouldn’t affect anything
I just tried adding some stuff in your demo scene and was able to reproduce it. Looks like this: https://gfycat.com/DaringOrnateBassethound
That’s just a basic scrollrect and some random items. The glitch seem to happen when the item is leaving the parent - there’s no mask or anything. It happens even when I set the depth buffer to 0.
This was in my own project, using none of my own assets.
HOWEVER, when I created a brand new project and did exactly the same the glitches were gone, so it’s related to some of the project settings I presume. I’ll try and compare them to my project
Thanks, I can reproduce it now. This only seems to happen with Unity 5.2.0, whereas with 5.1.3 I don’t see any artifacts. However, enabling/disabling the mask while in play mode shows artifacts with 5.1.3 (the previously masked text is displayed in purple for a split second, then appears in the specified color.)
Okay, so while the new mechanic works as it should, the artifacts are still there. I now believe the contents of the render texture is wrong in that it already contains those artifacts. What’s really interesting here is that it basically all works like it should, except for that single split second every now and then where things are messy, but then correct themselves.
I’m not sure what to do at this point other than filing a bug report with Unity. I have a (more or less) complete platformer here that is using the asset without any artifacts. I’m not using masks in it, though.
Yea, guess we’ll have to wait for Unity to fix it since my project uses a lot of masks for our UI :\ I edited my review to reflect your findings - thanks for helping me pal