- Home /
How should I size a plane to put images on?
I'm adding a background to a scene and I have a photo I'd like to use for the background. The image is 800 pixels by 600 pixels and I can easily crop that if need be. To get the image into Unity, I created a plane and applied the image as a texture to the plane. I see some stretching and resolution issues and I'm wondering the best way to make sure the plane is the exact size as the image.
From what I understand, Unity scale is in units and there is no standard such as 1 unit = 1 meter or anything like that. It seems that a unit should represent what ever scale I'd like it to represent. Is there any settings where I decide how many pixels there should be per unit ?
Also, I've read the information about textures needing to be a power of two which makes me wonder about how exactly I can use an image where in my case, the width is 75 percent the length of the height. I guess this would be a case where I use the "Non Power of 2" option in the advanced texture type in the import settings?
As you can probably tell, I'm quite new to this and any help would be appreciated. Thanks!
I just had a quick thought... I realize that to texture a 3D object, it must be uv unwrapped in the modeling application so that the correct texture size can be created. I'n my case, I'm working in the opposite direction; I need to start with the image and create a plane to perfectly fit the image. Any ideas on the best way to do this would be greatly appreciated. Thanks!
my suggestion would be to make the image itslef to be some powerof 2 and import. there are actually 2 ways one is abruptly convert the image to the size u want, which may not work in most cases, and the other is to keep tht 800x600 image and add alpha to the remaining area to get a 1024 x1024 image!! and adjust the texture offset and texture scale of the material to get the 800x600 image ( basically changing the uvs)
for the plane i actually would take a 1x1 plane and would set the scale to (800 , 600 , 0), that would be easy to handle!
I don't think the first option will work, as the display the image will be shown on is 960 pixels x 640 pixels and ideally I'd like to crop the image to those dimensions if possible. I think your second idea might work by adding an alpha channel to the rest of the image to make it 1024 by 1024 and then adjusting that to fit.
I'm not sure the 1x1 plane will work, as that will create a 1 unit x 1 unit plane and scaling it to 800 x 600 would make it 800 x 600 units, not 800 x 600 pixels. Also, I've read that scaling in unity is not ideal and it's better to scale your objects before importing and not in the editor, as that is an unneeded performance hit.
im having a whole iphone game with more than 200 objects(everythig is 1x1 plane that is scaled!!) i dont find a difference in my profiler! and 800x600 units or pixel it doesnt matter really does it( i mean when the camera is orthographic and set to a size that is supported for iphone devices)!, this way i run the same game on 3gs and 4g (retina) w/o any change..
anyway it was jus a suggestion, everything depends on how u want to go finally!
I didn't see anything about scaling being an unnecessary performance hit, I could be wrong on that, but what I read about the scaling had thing's to do with the physics engine. Scaling during runtime might be performance related, but I don't see why it'd bother anything scaling it in the scene editor.
"From what I understand, Unity scale is in units and there is no standard such as 1 unit = 1 meter or anything like that."
The physics stuff had to do with the scale of the objects because Unity DOES use a standard unit which IS unit=1 meter ; so, for example, a car that is 500 units long x 300 units tall is going to act retarded. ... That's what I got out of the scaling stuff I read, anyway.
Answer by imnickb · May 10, 2012 at 01:44 PM
In case anybody is interested, I ended up creating the plane in Blender. There's an option in blender to "Import images as planes." That gives you a plane textured with your image that you can then import in Unity.