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.
There are reasons that I said I didn't want to use a third party program, and its not shyness... I am teaching a series of week long classes on video game programming 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). My 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.
– anon46865890If 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.
– Jessy