Slope texture stretch fix?

just wanted to see if there is a way to make it so any textures on a slope dont stretch, i do know that changing the face of the texture stops it from happening but its only for its length or height
for example


the right side has the texture on the front and the left has it on the top
is there any way to make it work for both or that isnt possible

2 Likes

f2b = size_of_wedge_front_to_back
t2b = size_of_wedge_top_to_bottom

– value that you choose (looks good for side-to-side size of texture)
s2s_spt = StudsPerTile_for_side_to_side_of_wedge

– if texture is projected down, then value for the other StudsPerTile value is
StudsPerTile_front_to_back = f2b * s2s_spt / math.sqrt( f2b^2 + t2b^2 )

In other words, multiply the front-to-back size of your wedge by the value you’ve chosen for StudsPerTile[U or V] that goes side to side across your wedge. Then divide that by the distance from the top of the slope to the bottom, which is the square root of the sum of the squares of the front-to-back and top-to-bottom sizes of your wedge. That will give the value that you paste into the other StudsPerTile[U or V] box.


For example, say you have a wedge with size 4x10x4 (much taller than deep). You apply a Texture object with a square grid texture like the one in your image to the top of the wedge (facing down). You set StudsPerTileU = 3 (since the ‘U’ direction seems to run side to side of your wedge and 3 looks good). How to find the value for StudsPerTileV then? Like this:

4 * 3 / math.sqrt( 4^2 + 10^2) = 1.11417203

That will make the squares on the texture look square when looking flat-on at the slope of the wedge.
Paste 1.11417203 in for StudsPerTileV and you’re done. No way to tell the game to do that automatically for you though.

1 Like

he tried it, i didnt check anything he did but this was the result.

ill read what u said sorry, ill try it

1 Like

No worries. Apply the texture to the top and then choose a StudsPerTile value that works. Note if it’s the U or the V StudsPerTile that has the side-to-side size you like.

Then mult the front-to-back size of the wedge by that StudsPerTile value. Divide that number by the square root of (that_same_front_to_back_size^2 + the_height_size^2). Paste that answer in for the other StudsPerTile value.

If it isn’t working can give me the size of the wedge and the repeat size you like for the StudsPerTile and I’ll double check it.

Then, if you want to apply the texture to the front instead of the top, you’ll need to use the height instead of the top-to-bottom value for the first number.

– texture applied to front of slope use
10 * 3 / math.sqrt( 4^2 + 10^2) = 2.78543007
– applied to top
4 * 3 / math.sqrt( 4^2 + 10^2) = 1.11417203

1 Like

Yo, Could you help me in my post please?

1 Like