Texturing Unity primitives for a noob
Hi all,
Now this will seem really basic but please bear with me. Currently all the work I've done in Unity has involved 2D work and sprites. But now I have need for some 3D objects, only the primitives for now, but I'm stuck on how I should create my textures. I'm familiar with photoshop etc. and coding, but what's confusing me is how to actually create my textures in a way that folds over an object e.g a cuboid. Say I had a cuboid that was 100px x 200px x 50px would I in essence create an image like the following?
I'm guessing it's actually not as simple as that, as how would you determine where the texture should 'fold' over the 3d model? I just can't find out how you should initially create a texture in a graphics program for a 3d model. I think it's probably because I've not quite got the terms right and maybe I should be looking for info on meshes?
You don't really want to try to texture a Unity primitive (just make your own cube model in Blender or other 3D modeling application), but if you do...the texture will be mapped onto each face wholly (ie. if the primitive is a cube then all 6 faces will show the entire texture).
Thanks, again as per my comment below, sorry for the late reply, notifications were going to my spam so wasn't aware any one had answered!
Answer by Cepheid · Apr 05, 2016 at 11:47 PM
Hi there @TommyB
To texture a 3D mesh you have to go through of process know as UVW Unwrapping. This is a process in which you take all of the faces, edges and vertices of a 3D mesh and align them onto a planar 2D grid known as a UVW sheet.
Using this UVW sheet, you can then export it out to a Power Of Two texture size e.g: 512x512, 2048x2048 etc. You then take this exported sheet, import it into Photoshop and paint over the now arranged UVW's. You would then re-import this texture back into a 3D modelling program and assign it to a material and then assign the material to the object.
Now that the object's UVW's have been properly arranged, it will fit each piece of the texture to the appropriate face, edge and vertex as defined by the UVW sheet. This is a process which must be performed within a 3D modelling program and you cannot simply create a texture and hope that it fit's around a cuboid object as there is no way to tell how the object has been unwrapped as 3D software generally tends to guess the placement of UVW's.
However, you can place a seamless texture over a cuboid or sphere in Unity and it will seamlessly wrap around, but this will be a repeated pattern across the whole object. For more intricate detail over each face, you will have to unwrap it.
Some hastily found tutorials for unwrapping:
UVW Unwrapping 3DS Max Blender Basic Unwrapping WhatIs Definition of Unwrapping
I hope this helped! :) If it didn't tell me what else you need to know/need explained better.
Hey sorry for the late reply, the notifications were going to my spam folder. Thanks for the answer. So there's not really anything to allow unwrapping for Unity objects. That's a shame, but I guess though don't really want to be in the business of also building a fully fledged 3d editor on top of a game engine!
So I see that the textures will stretch etc. is there any easy way to only stretch say the middle of a texture? i.e for a plane if I had 2 ends could I just tile the middle section? Or in this case is it easier to fake it by having a plane with a tiled texture and then 2 planes tacked on at the ends with a single 'end' texture?
Your answer
![](https://koobas.hobune.stream/wayback/20220612074231im_/https://answers.unity.com/themes/thub/images/avi.jpg)