My pixel art assets all have a ppu of 32 and i have applied that to them all.
On 1920x1080, the resolution is fine, but most other resolutions the sprites pixels are squashed and stretched. I also have set the correct camera size using vertical resolution / PPU / 2). I have also used other formulas and they all give me the same camera size so i'm sure that's not the issue.
I have two moniters, one at 1920x1080, and one at 1360x768, and that moniter is where it scales wrong. Is there a way i can keep the pixels scaling the same across all resolutions? I have tried the pixel perfect camera and this doesn't fix my issue either.
https://imgur.com/gallery/Uf8YqNi Here is a sample of both resolutions, if you open them in a new tab and zoom in on the sprite you can see how tey get distorted in the 1360x768 screen.
Filter mode should be Point and compression None. If this doesn't fix it, then you should use Pixel Perfect camera. It will help you with the animations to be pixel perfect as well.
Window -> Package Manager -> Advanced -> Show preview packages -> 2D Pixel Perfect -> Instlal. Then you just add Pixel Perfect Camera component to your Camera.
Related
I have a number of images and text mesh pro assets on a screen space camera canvas (not overlay, so this question is not a dup) with a 45 deg FOV perspective camera and I'm getting jaggies on every asset that is rotated on an axis other than 0, 90, 180, 270 deg.
Images and text mesh pro are equally affected.
The plane distance from camera makes no difference, nor does the
scale or size of the assets.
I have a canvas scaler but no settings change the aliasing.
I'm using post processing stack 3.2.2. I've tried all 3 AA methods,
each has a slightly different effect but the aliasing is always quite
noticeable.
I've disabled the post processing in case it's another effect but no
change.
Changing Anti Aliasing in quality settings to affect the cameras MSAA
has no effect at all.
Because images and text are affected equally - including the default
image sprite in the above picture - I don't think mip map settings
etc are the issue.
I've increased atlas resolution to max for the TMPro assets to no
effect.
Anything else I can try?
Cross posted on GameDev and UnityAnswers
This is my scene
Right now if I use resolutions that aren't 16:9 the Pixel Perfect Camera zooms out quite a lot showing parts that shouldn't be shown.
How do I get it to scale like the Normal Camera which just cuts out parts outside the borders?
The Reference Resolution is currently set to 320x180, I tried changing the Reference Resolution to other resolutions (640x360, etc) but that changed nothing.
Tried Pixel Snapping on/off.
Cropping the X and Y does a good job at hiding the outside borders places but makes the screen too small for non 16:9 resolutions.
Two questions the first how to zoom in and zoom out ? and why i have that red line in some resolutions is it a bug or a problem (i tried reimporting the package and recreate the project but nothing new) ?
It's about resolution and aspect ratio.
I see you are using an asset for this "Pixel Perfect Camera". If you want to zoom in and out you need to make sure you are staying in line with the original supported resolutions (and the aspect ratio).
On your camera settings the "Reference Resolution" is 320x180, on the error it says you're in "485x279", so it seems your project is in 16:9 (aspect ratio).
20*16 and 20*9 = 320x180. Keep your resolution in line with your aspect ratio. Simply put, you need a multiple of 16 for width and of 9 for height.
I'm working on a 2D project in unity and I'm having trouble getting the camera to the exact size I need. I would like the camera to be centered around a level I've already created, so I know exactly how tall and wide it should be, and where it should be centered. Where I get lost is translating these values to the properties of the camera. Any advice would be appreciated.
You can put more details about your problem.
Unity's camera rect is resolution depend. So you cannot set width and height of camera size. For example if you have resolution 16:10, camera rect will have that ratio, you can only change scale of that real resolution.
I have a Unity 2D project with a fixed screen size of 800x450 pixels.
I have imported a background image that is also 800x450 pixels.
When placed on the stage, the image only takes up half of the screen.
The scale of the image is set to 1,1. The Z position is 0.
Why is the image displayed too small? How can I display the image at the correct resolution?
Does this mean that I have to design all my game assets at 2x the required size? Or that I somehow have to set the scale for all imported assets at 2? What is the recommended workflow?
EDIT
I have added a screenshot of the camera settings:
I would trying making your camera orthographic, and set the size of the camera (not the transform) to be half the height that you would like it to be (225)
Also if you are looking for pixel perfect game. here is a pretty good article from Unity about how to make that work and it explains some of the camera aspect ratios and scaling
http://blogs.unity3d.com/2015/06/19/pixel-perfect-2d/