- Home /
Jagged Edges Around Imported png Texture on Cube Game Object
I'm making a button using a cube that I put a png picture on. I parent the cube to the camera, and have it about a distance of 1 in the z direction from the camera. However, the image appears to have jagged lines around the edges. I've set the import settings to Format "Truecolor" and the Wrap Mode to "Clamp," as has been recommended by people on the forum. I'm still experiencing the poor image quality problem though, even after experimenting with different sizes ranging from 64x64 to 200x200
The image that I'm using was made in illustrator using the "Save for Web and Devices" option. The graphic seems to have the jagged edge problem in unity whether I keep a stroke of 1 on it or not. The format is a png.
This pic is a screenshot from illustrator:
This is what it looks like in unity:
Does it look "right" in Photoshop? What Import settings are you using for the texture in Unity?
You might want to play around with different filter modes. I had a similar issue that was solved by switching from point to bilinear filtering.
As a side note:
You want to keep all your textures at power of 2 resolution.
It seems to look "right" in Photoshop. The import settings are: Texture Type: "Texture" Wrap $$anonymous$$ode: "Clamp" Filer $$anonymous$$ode: "Bilinear" $$anonymous$$ax size: "128" Format: "Truecolor"
Changing the Filter $$anonymous$$ode doesn't seem to help. This texture also is a power of 2 resolution (it's 64x64)
Well you are taking a 186x188 image and shrinking to 64x64... so that's both a loss of resolution and some distortion. Then if you render it larger than that in screen-space in unity... fat bits... aka jaggies... results. Increase the resolution of the image, say 128x128 or 256x256 in the source and deep it at that in the export. Then be $$anonymous$$dful of what resolution you render at in the engine.
I noticed after posting this that you say you did your original in illustrator, a vector application. Check what the export is (not a screen shot) to make sure that's looking right before even worrying about Unity.
Thanks nsxdavid for bringing to my attention that the actual file is more relevant than the screenshot.
In the post, I just replaced the screenshot with the actual illustrator png export, which is 64x64. So the illustrator png is actually not any larger than the unity cube that it's on.
Any other things that might solve the jagged edge problem, and increase the quality of the image in unity?
Your answer
Follow this Question
Related Questions
Jagged Edges Around imported png on cube game object 1 Answer
Imported png doesn't keep colors 2 Answers
PNG Sprite scaling issues 1 Answer
Texture Import - PNG 8bits ? 1 Answer