I am trying to map a texture on a UV sphere. I created an algorithm to generate the vertices of the sphere and the UV texture coordinates for each vertex. How I do fix the distortion or aliasing? The formulas I used to generate the vertices of the sphere are: x = rsinΦcosθ y = rcosΦ z = -rsinΦsinθ
The formulas used to generate the UV texture coordinates for each vertex are: θ = arctan(z / x) / 2π Φ = arcos(y) / π
I am using Direct3D 12 to render the sphere.
x
, my first guess would be that you have a "division by zero" error. Turn on all compiler warnings and check the UV-values you are getting. $\endgroup$