Applying a texture to all 6 faces of a cube

Hi everyone,

I’m looking to place a texture (wood) on each face of a cube.
The same texture for all the faces.

The problem is that my texture takes the whole cube (all the faces for the same texture).

  • Here’s my texture:

  • And here’s the bad result:

It looks like a texture with a blurred effect that takes up the whole cube.
You can see the difference between the results.

Can you help me apply the texture at the very top to all 6 faces?

Your help is most welcome,

A+

Where does the mesh come from? The texture mapping has to be done in the modelling software. So it’s all about how your mesh got “unwrapped”. Since you have rounded corners you have to decide where the UV seam between the faces should be.

If the mesh is procedurally generated, you just need to generate the desired UV coordinates as you produce the mesh. Though I assume this is an imported model? You can’t really fix the texture map of a mesh inside Unity. So this has to be done in blender, maya, 3dsmax, …

Though, given your rounded cube, I’m not sure how you actually want to apply the texture to a “face” since the round cube doesn’t really have hard edges. Your texture is not tilable so you would always see a clear seam between the “faces”.

ps: My guess is that your cube is unwrapped as a classical t shape (found through google).

Unity’s default cube has an unwrap that looks like this:
9437021--1323482--upload_2023-10-28_15-19-41.png
Though it has a second UV channel (usually used for lightmapping) which looks like this:
9437021--1323485--upload_2023-10-28_15-20-31.png

So the second channel maps a different area of the texture to each face while the first (main) channel maps all 6 faces to the full texture. Select your mesh in the inspector and select UV Layout to see this view for your mesh.

Hello,

I have placed the same texture on the 6 sides in blender but when I import it into Unity it appears in white and removes the textures (wood).

Should I do my UV Mapping in Unity, if so can you give me some tutorials.

What I want to do is apply one texture to the 6 faces of the cube.

Thanks for your help,

A+

You can, but it requires ProBuilder, or you have to write some code.

You should challenge yourself to learn Blender3D!! It’s super easy.

Okay, 7:56am and I am going to open Blender3D now, take the default cube, map the 6 corners to 6 materials and export it for you. Here we go.

Okay, 8:03am (7 minutes time elapsed) and I have the cube in 3 formats: .blend, .fbx and .obj

You can use any or all of them. They are included in the enclosed .ZIP file.

I highly encourage you to learn Blender3D for use in Unity.

EDIT: I imported all into Unity and made separate dice pip textures for all. See the attached .unitypackage.

9437183–1323587–Cube6Materials.zip (105 KB)
9437183–1323599–Cube6MaterialsDice.unitypackage (222 KB)

Sorry, but when I paste the images onto the cube, it works fine in Blender.

I import the cube (in .fbx or .blend format) into Unity with the textures (Base color (yellow button) / image texture/ I load the texture above).

But this only colors one side of the cube, the rest is white.

Please note that I didn’t do any UV mapping.

I’ve already tried it, but this is what I get:

I don’t know how to use UV Mapping to get a final rendering (do I need to check any options, do I need to press ‘assign’ or nothing).

Moreover I’d like the wood texture to be placed in every square of the UV mesh.

But I can’t make the image smaller (wood toon).

Thanks for your help,

A+

Note that I’m not an artist so I can’t tell you how to unwrap the cube in blender or any other modelling software. However you should understand how UV mapping works. You said you did not do any UV mapping. However without UV coordinates for each vertex, you couldn’t see any texture at all.

I would recommend you read about UV mapping on wikipedia to better understand the basics. I actually made a WebGL example that shows how UV mapping works in real time.
More details about my example

In my example I create half a cube (only 3 faces). Since the view is static you can only ever see those 3 faces. At the left you see the 3 faces and the corresponding vertices. A vertex consists of many vertex attributes. One is the actual position in 3d space, another would be the vertex normal vector which is used to calculate correct lighting. In addition we have the so called UV coordinates. This essentially specifies the position of this vertex in 2d texture space. The x axis of this space is called U, the y axis is called V.

When you click on of the select buttons on top of each face on the left, you will see the actual mapping of that quad in texture space. You can drag and drop the corners of that yellow outline and manipulate the UV map of that face. Note how the appearence of the actual model in the background changes. I also added a few “presets” at the bottom of each face / quad. Clicking on of those buttons will overwrite the UV coordinates of that quad. The “R” button simply rotates / exchanges the coordinates in a cycle. So the positions stay the same, but the corresponding vertex is different.

You can also see the UV coordinates at the vertex listing. When you drag a UV coordinate of a vertex you can hold down CTRL and it will snap to a grid with an interval of 1/32.

The actual texture is a 4x4 grid. The transparent border around the texture is there to show that the texture is “wrapped” when you exceed the usual range of 0 to 1. Though this depends on the wrap mode of the texture. Usually you want to map your quads / triangles to the inside area of the texture.

In your case you want to map each face to the full texture. This is rather trivial with simple quads as faces. However when you have a more complex mesh, most modelling software uses a technique called “unwrapping”. The usually closed mesh is simply cut at UV seams and the connected triangles / quads a unwrapped and laid out flat. That’s because in most cases you want to keep a continuous mapping across triangles. That’s why it’s important, especially for non-regular shapes to keep the propotions. Modelling tools usually have many tools to manipulate the UV map.

Note that your image is not really suitable as a texture. Your texture already contains a 3d perspective on the right and bottom edge. So mapping the whole texture to one side will certainly look strange.

The image in your last post probably shows the UV map of a cube (classical T unwrap). However that means ony those small portions of the texture will be mapped onto a single face / quad.

In blender, just unwrap each face one at a time. You want the each face to encompass the entire texture space.

Hi all,

Can anyone tell me how to reduce the size of the texture (wood) to put it in each cell of the UV unfolding.

Thank you very much,

A+

That will be a VERY difficult way to work with texturing 3D objects.

If you want to create textured 3D content, start with basic Blender3D tutorials. You have already been struggling with this for DAYS now. Just work through some basic texture-painting tutorials.

Here’s one… it is only a few minutes long:

https://www.youtube.com/watch?v=WjS_zNQNVlw

Pay attention to the details. You literally MUST do 100% of every step 100% correctly. That’s how computers work. Be sure to SAVE your texture and get it into Unity.

This is basic 3D textured modeling workflow. Start small, build up.

Yes, that’s supposed to happen. Only the model is exported, which includes the UV mapping and any animations and normals. The texture and material don’t count as part of it. In Unity, find or make a Material with that wood texture and add it to a gameObject with that cube.