0
\$\begingroup\$

What is the best way to minimise stretch when bending a plane? I'm making a road kitbash to use in Unity and would like the road markings to remain a consistent size when the road bends (I'm using more complex markings than just lines). Here I've added a texture to a straight and curved section to illustrate the problem:

enter image description here

I've tried adding and sliding edge loops lengthwise but they have no effect. I've tried skewing the UVs (scaling the longer edge smaller and vice versa) which does correct the scale problem but then the shapes rotate and don't line up with a straight section if placed next to it.

Here's an example of what I'm trying to achieve - the markings are correctly oriented perpedicular to the road and are all of the same size:

enter image description here

I achieved this using a bunch of planes in an array but as there will be thousands of markers in the scene I'd prefer to use larger meshes for long sections of road to keep the draw count down. Also, the road has an asphault texture and any stretching would be noticeable close up, again this could be solved with seperate meshes for the roads but I'd then need transparent textures for the markings which would add tons of overdraw. I could use UV islands but again, extra draw calls.

\$\endgroup\$
8
  • \$\begingroup\$ What's your desired outcome here? Can you sketch it? If you want exact alignment at the ends, ie. the same number of texture repeats over the length, then there has to be stretching because the same amount of texture has to cover a longer distance at the outside edge. If you want no stretching, then the same amount of texture cannot cover both the shorter and longer edges, leading to a mismatch at one end or both. If you show us the road markings you're using, we may be able to suggest a more bending-friendly way to draw them than relying on conventional texture mapping over the road itself. \$\endgroup\$
    – DMGregory
    Aug 4 at 14:34
  • \$\begingroup\$ @DMGregory Thanks, updated the post with desired result. \$\endgroup\$
    – Absinthe
    Aug 4 at 18:48
  • \$\begingroup\$ Looks to me like you want three separate strips, each with a different number of texture repeats according to their length. \$\endgroup\$
    – DMGregory
    Aug 4 at 18:52
  • \$\begingroup\$ @DMGregory Sure, I was thinking that too and will probably go with it. The bulk of the texure is asphault though and the stretching is apparent on that too when the camera is close enough and there would be a visible seam by each marking. I updated the post again (last paragraph) to explain. \$\endgroup\$
    – Absinthe
    Aug 4 at 18:54
  • \$\begingroup\$ P.S. it's for Unity \$\endgroup\$
    – Absinthe
    Aug 4 at 18:57

0

You must log in to answer this question.

Browse other questions tagged .