4 ms·
Texture pinching at the poles is an extreme version of a form of distortion that is actually present on the whole surface. The distortion is usually only obviou
by modeless 2y ago
Texture pinching at the poles is an extreme version of a form of distortion that is actually present on the whole surface. The distortion is usually only obvious at the poles but it can also become visible elsewhere if you use adaptive subdivision of the sphere into triangles because the distortion will change as the subdivision changes.
The problem is the sphere is divided into quads which are represented by two triangles, which each have equal area in UV space, but one of the triangles is smaller than the other in 3D space (the one with its horizontal edge closer to the pole). Despite this difference, the UVs are interpolated linearly across the triangle, which means half of the texture is shrunk and half is stretched. At the pole this becomes extreme because one of the triangles actually has zero area in 3D space, so only half of the texture is actually rendered, which causes obvious seams between the triangles.
The right solution is to calculate the UV coordinates per pixel in the pixel shader, instead of per vertex with linear interpretation. If done properly the poles will be seamless.
- spoiler 2y agoHi! Could you provide some more information please (either in hints/keywords to help search, or links if you have them handy)? I've recently started dabbling a bit rendering, shaders and game dev. So I'd love to know more!
- GrantMoyer 2y agoSee the Rasterisation algorithms[1] section of Wikipedia's Texture mapping article. [1]: https://en.wikipedia.org/wiki/Texture_mapping#Rasterisation_algorithms https://en.wikipedia.org/wiki/Texture_mapping#Rasterisation_...
- spoiler 2y agoThank you!
- adolph 2y agoAre spheres ever rendered with multiple rendering poles to decrease the pinching you describe? As an example a sphere with a “true north” pole that is rendered with one rendering pole at “true north” and another at 0',0’. When the user is looking at the sphere sidelong the former is used and if the user looks at it from closer to the “true north” pole, the equatorial render is used.
- lainga 2y agohttps://en.wikipedia.org/wiki/Cube_mapping https://en.wikipedia.org/wiki/Cube_mapping
- o11c 2y agoDoesn't scaling W (instead of leaving it as 1 in the XYZ entries) fix this?
- modeless 2y agoYes, I think it could probably be fixed this way, if you calculate the W coordinates appropriately.