- Home /
Why 2d camera is not pixel perfect
I am making a 2d project for web player. Web player dimensions are 900*600. I created a texture 150*600 to make a left menubar, but when i place it on the scene it does not fill my scene vertically. Can somebody tell me why? I use standard unity 4,3 2d projet settings.
Answer by s_guy · Dec 03, 2013 at 06:31 AM
Unity isn't designed for pixel perfect rendering. You can achieve it, but you have to set things up to remove artifacts (sample rate errors).
Some things to look at:
You will likely need a texture with "power of 2" dimensions, e.g. 512 by 1024.
Texture filter mode should be "point"
Turn off texture compression
If you are using Unity Sprite texture type, take care with your sprite pixels to units setting
Take care with your orthographic camera scale relative to your screen dimensions
Please google for details on the last two items. There is some math involved. Here's one lead: http://forum.unity3d.com/threads/210329-Unity-4-3-Tips-amp-Workarounds?p=1415249&viewfull=1#post1415249
Answer by tonic · Feb 24, 2014 at 01:42 PM
If you want the orthographic camera to match your screen resolution, then set the camera Size to be half of your screen height. So, in this case, if your window is 600 pixels, set your camera Size value to be 300.
PS. for pixel perfect text you might want to check out my Pixel-Perfect Dynamic Text asset: http://strobotnik.com/unity/dynamictext/
Your answer
![](https://koobas.hobune.stream/wayback/20220613123301im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I do a smooth tracking camera, using the animator controller? 1 Answer
Camera moving in one direction? 2 Answers
2D Camera Follow - Jittery? 1 Answer
Camera setup question 2 Answers
Optimizing sprites at a distance 0 Answers