0
$\begingroup$

I am trying to generate UV coordinates automatically to map a texture on a sphere.

The problem is with seams when going from 0.8 to 0.2 there is a discontinuity and interpolation in fragment shader is incorrect. It should go from 0.8 to 1 and then from 1 to 0.2. But instead it will interpolate directly between 0.8 to 0.2.

https://en.wikipedia.org/wiki/UV_mapping

enter image description here

enter image description here

How to handle this discontinuity from 1 -> 0.

Here is what is currently happening at the seams enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

A few options:

  1. Make the 0-1 discontinuity explicit in the mesh. That is create a 2 sets of vertices that lie exactly on the line where the value would be 1 or 0 (one set gets 1 and one gets 0) then connect the vertices up like they would makes sense.

  2. Switch to a different texture mapping projection, I prefer a cubemap because it minimizes distortion at the poles and you don't need to have seams in the mesh.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.