Author Topic: Does anyone know how bricks sides are textured?  (Read 1499 times)

I've started making a brick based vehicle and i would like to make the brickwork visible on my 3D model, i see how i'm supposed to apply brickTOP.png to the top of the bricks, that's not an issue. But brickSIDE.png i'm not entirely sure how it is applied to bricks by the game internally so that no matter the length of the brick, the edge remains sharp and not stretched.

Does the game cut up the face of bricks into pieces and apply only a portion of that texture to it? I would like to use only stock textures on this so that if someone use replacements it will still look right.

No. You have to calculate the uv values and stretch the texture. If you set crappy uvs, the texture will be crappy.
If your face is smaller than 1 TU then you will have to actually shrink the texture and use texture extrusion to have lines of the correct thickness which I don't think .dso supports.

yeah but if you stretch it, won't you get a "thicker" edge  along one of the axis?

EDIT: Nevermind, i'm a moron, they ARE actually stretched, i just never noticed, this makes it all much simpler.
« Last Edit: March 25, 2014, 12:03:39 PM by DieAngel »

yeah but if you stretch it, won't you get a "thicker" edge  along one of the axis?
No, you stretch it further, larger than the face, making the edge have the exact width.

gotcha, is there a way to calculate that?

Also i am trying to understand how the bottom textures are constructed, any idea on these?

The bottom ones are made using 5 faces, the loop in the center and a edge on the 4 sides

I don't think it's possible to scale the brickSIDE texture on a model without it losing quality, the bricks have a special way of using it so that it doesn't blur when stretched to fit the brick

I know the Source engine has a thing like that where you can set a texture's Point Sample flag to make it pixelate instead of blur, people tend to use that flag for Minecraft textures and it works pretty well, but obviously Torque doesn't have such a feature, not even Milkshape 3D has such options in the DTS Plus exporter

There is no way to get texture extrusion on a dts shape. If all your faces are larger then 1 TU in every direction, you can get perfectly fitting side textures.