- Home /
Help with pixel perfect, thanks.
Hello,
I'm testing things in unity but I've run into this problem and i can't solve it... I have the following configuration:
Images of the problem:
As we can see in the problem images the pixels are blur or strange and i need the pixels not to be clipped or strange... i read that a possible solution to that is to create a script for Pixel Perfect but i can't get it work... ¿Any suggestion? Thanks!!
You must check the sprite individual first that is that correct ? You can try 3 thing .. It is just a hit and try
Take it a single sprite ins$$anonymous$$d of multiple ( sprite sheet ) .
By changing the 'Filter mode' to some thing else . And try with format also.
By manually change the Camera position of the camera at run time is Scene view & check the result in the Game view
The above mentioned points are not a actual approach (answer to ur question), its just a try. Sorry for not guiding u properly.
@zach.r.d Thanks for the advice, done! @itsharshdeep I already tried that but thanks! @maccabbe Thanks! I will see that... if there is anything new, i will edit.
Also i don't know if is necessary to know but my sprites size are 512x512.
I tried to set the camera ortographic size to the right value and yes it appears to be pixel perfect but it's too big. Here an image:
The image of what i want:
I need to get the view as the image above but with a good view of the pixels.
Thanks!
Have you tried scaling up the sprite by an integer factor? For instance, if each sprite is scaled 2x then each pixel in the sprite sheet should show up as 4 (2x2) pixels on the screen. You can also try dividing the orthographic camera size by a integer factor.
Answer by Douvantzis · Jul 14, 2016 at 12:06 PM
You'll have to set the orthographic camera's size so that each sprite pixel gets rendered to an integer multiple of screen pixels. For each screen resolution, you'll end up with specific camera sizes that produce a pixel perfect result. I have written a blog post that explains this in detail.
I have created a free simple camera script that does the above calculation for you. You can set the desired camera size and it will choose the closest one that is pixel perfect. You have to realize that it may zoom-in or zoom-out a bit, but that's the best you can do.
You can get it for free from the asset store: https://www.assetstore.unity3d.com/en/#!/content/64563