- Home /
Texture tiling discrepancy and general confusion
I know this is a simple question, I did some searching but found nothing that clarified this specific point.
I downloaded the free "wallBrickExposed" asset from Unity Store. The texture tiles in a way I did not expect it to, and I have been unable to recreate this.
wallBrickExposed's mesh is an elongated cube, that is missing two faces on the side. Its material uses the Specular Diffuse shader, a texture (set to advanced, and repeating), and a normal map (both 512x512). The texture tiles horizontally along the wall (which is 33 units wide at scale 1,1,1) even though tiling on the material is set to x=1,y=1.
So I made a material containing another texture and its normal map (128x128) and set all the settings on those three assets identical to their counterparts in wallBrickExposed. I applied it to a cube and a plane, but in both cases the only way I could get the texture to tile was to change the
Is this because of the fact that a pair of the mesh's triangles in both the cube and plane only span 1 unit, while on wallBrickExposed only a few triangle make a 33 meter wide object (at scale 1,1,1)?
Is there any way to create an object (rectangular prism) so that I can increase its size along an axis, and the texture will not remain proportional to it, but simply tile? I would prefer to be able to accomplish this task solely inside of Unity.
In my searches for tiling textures, I came across UV mapping being talked about. I was under the impression that UV mapping was a semi tedious process for putting textures onto more complicated models. Is it somehow related to what I am trying to?
EDIT: Ive convinced myself I could make an editor script to change the tiling to match the scale, but only in the special case when the x y & z values of scale are equal. (unless I didn't care about specific sides, but lets say for the sake of argument that I do)
This still doesn't explain how wallBrickExposed managed to look nice, unless my hunch about the mesh was correct.
Answer by Jessy · Mar 21, 2011 at 06:04 PM
UV mapping with a GUI is a lot less tedious than trying to script it, and it allows for the control that you mention here, and more so. You can't work in 3D effectively without it. Also, trying to "model" in Unity is a bad idea. All you can do is scale, and scaling impacts performance. Go learn to unwrap.
There are reasons that I said I didn't want to use a third party program, and its not shyness...
I am $$anonymous$$ching a series of week long classes on video game program$$anonymous$$g to middle/high school students. Time is limited - so Im focusing on just one aspect per class, and making the rest as transparent as possible (but with a disclaimer and plug for relevant classes).
$$anonymous$$y actual question is almost purely academic. The 3d modeling class is finished for the middle school level and there wont be a high school version until at least next year.
If you can't do it outside of Unity, you're going to have to script the UVs. If I understand you correctly, each face will be a UV island, and you'll link the scale of the UVs for each face to the scale of the mesh. For a right prism, this is simple; you just scale the UVs the same value as the transform's scale. If you're talking about oblique prisms, you'll need to use a bit of trigonometry. Let us know if you have specific questions about how to do that.
Your answer
![](https://koobas.hobune.stream/wayback/20220613114023im_/https://answers.unity.com/themes/thub/images/avi.jpg)