Home > Back-end >  Deformed sprites in line renderer
Deformed sprites in line renderer

Time:08-19

I am trying to create rectangle using line renderer (corner vertices is set to 0, texture mode to tile, wrap mode for texture to repeat), but sprites are deformed:
deformed sprites in line renderer

Material is simple (URP/Unlit with Tiling X:1 Y:1)
When I set corner vertices to value greater then 0, then it looks good, but without corners:
nondeformed sprite in line renderer but without corners

How to setup line renderer to draw sprite (dots) also in corners?

CodePudding user response:

The line renderer doesn't generate the right type of topology for your use case.

Comparison between the Unity line renderer topology and the desired square face topology. Two squares with holes in the middle with different geometries on the corners. The faces of the left mesh are trapezoid and the faces of the right are perfect squares

It's a bit more tricky, but you'll have much better control if you generate your own mesh with your own UV.

  • Related