Hi, I’m creating my world procedurally using geometries, and I want to avoid this:
I want the walls/floors to span across the room without being cut and stretched.
The picture is using WrapMode.Repeat and scaled 2 times.
I guess a possible way to do it is to calculate the proportion and set scaleTextureCoordinates() for each Quad independently, although I’m not sure about the necessary offset.
Also this isn’t going to be a blocky game, so the sizes are not a integer multiplication of a fixed unit.
Is there an out of the box solution or standard technique for this?
You will have to set the texture coordinates yourself. There is no other built in way (and indeed to cover all cases there would have to be a few thousand built in ways… so…)
You can set whatever texture coordinates you want. Easiest would be to use some form of the world coordinates… x, y for one direction and z, y for the other. Scale as needed.