How to UV map to a quad instead of a triangle?

I have a face I’m UV mapping. The face has four corners, and all four vertices are co-planar. The face is mostly rectangular, but one side is slightly shorter than the other (many of these faces combine to form a ring, so the inside of the “circle” is necessarily shorter than the outside). Because I’m mapping the face to floor tiles, the seam between faces is very noticeable if I project the face onto the UV map.

So the plan was to simply stretch the UV map a little, so each floor tile would be slightly distorted, but the face could be mapped to an integer number of floor tiles, and the seam would seem natural.

The problem is the face is rendering as two separate triangles with independent UV mapping, instead of a single quad face. I’ve tried converting tris to quad, but it seems to still UV map as tris.

Is there any way to UV map a quad so the texture location is determined by the distance to all four points, instead of just three points?

Here’s an example of a UV map that’s skewed. Clearly, we’d expect some distortion, but it’s not a complex shape.

Here’s the quad I’m trying to map to. We can clearly see the left half of the quad is being mapped as one triangle, while the right half is a second triangle. (The screenshot has a mapping node, so the mapping is being repeated. But setting the scale back to 1 so it’s a direct mapping gives the same skewed result.)

Because the two triangles are skewed, the image is skewed. What I’d like to see is a mapping where straight lines across the quad are mapped to straight lines on the texture. Something like this: the four corners (purple) obviously map to the corners. Points about 25% from the bottom (red) would map across the texture proportionally, near the bottom, and points about 2/3rds up (blue) would likewise map across a different line on the texture.

Is there a way to what I’m wanting? I feel like this is probably stupidly obvious, but I’m not understanding what to call this so I can properly search for it.

Try with the “follow active quads” option.

you will have to mark a seam or 2 for it to unwrap.

Select a quad next to the seam, then select all (A), U to unwrap and hit reset, U again and select follow active quads. You will have to scale the UV’s on one axis to give the UV quads a rectangular shape.

There will be a bit of distortion as your faces are not rectangular but in your case it should not be as noticeable as this:

1 Like

That’s helpful for mapping the vertices from the quads to the UV map, but it doesn’t change the fact that points on the quad are being rendered as though there are two triangles, rather than mapping to an actual quad.

For now, I’ve manually cut the quad the opposite direction, so the camera only sees one triangle from each quad, minimizing the number of seams shown on camera. It would still be nice if there was a proper general solution for mapping quads to textures.

I know we’ve had algorithms to render quads as quads, even when not co-planar, since the 80s. But maybe Blender just doesn’t do that.

I suppose sub-dividing the mesh a bunch would lower the error until it’s barely noticeable, but that seems like it shouldn’t be necessary. I wouldn’t think my use case is terribly unusual.

Since there’s just a few vertices, you can place them where you want them on the UV map manually

Maybe ;
https://youtu.be/xOsUaW3OlWo?t=12

Uv Squares
https://github.com/Radivarig/UvSquares

Project From Normal [UV Unwrap]
https://blenderartists.org/t/project-from-normal-uv-unwrap/1206128

The problem isn’t mapping the vertices onto the texture. The problem is when the system paints the texture onto the face.

If the ray lands on one of the face’s vertices, it draws whatever color is on the texture at the location of the the mapped vertex. If the ray lands on an edge between two vertices, it draws a color along that edge. If the ray lands in the middle of the face somewhere, the system has to calculate what part of the texture relates to the intersection point of the face.

The calculations for triangles are different for the calculations for quads, so if the system renders using the wrong method, it looks distorted. For natural objects, like faces or rocks, the distortion isn’t noticeable, especially with high face counts. But for regular, squared-off textures, the seam is more obvious.

I ended up re-making the entire thing with a bunch more faces. I was having issues with lighting anyways. The distortion is unnoticeable now, as I suspected.

This one was nice for re-mapping everything, so thanks. :slight_smile:

I’d still like to know if it’s possible to render as a quad, but I don’t need to in this case.

1 Like