Consider using other sphere texturing technique to avoid strong distortion at poles #22
Replies: 4 comments 2 replies
|
We're going to do something about this in v0.2. (That's in the works after near-future v0.1.2.) Click for Claude's analysis...The problem: three artifacts, not one"Pinched poles" bundles three separate defects with different causes and different fixes. Keeping them apart is the whole game:
What the close-up showsThe south-pole starburst above is artifact (2), sharpened by (3). An equirectangular map represents the pole as its single top row of texels, stretched across the full image width. Mapping that row back onto the sphere wraps it around the pole, where the meridians converge — so each texture column becomes a radial spoke. The hard, high-contrast spokes (rather than a soft blur) are (3): the per-fragment texture footprint near the pole is extremely anisotropic, and the sampler isn't filtering along it. Artifact (1) is underneath this but isn't what you see. Two consequences worth stating plainly:
How Core renders spheroids todayThree properties of the current pipeline constrain every option:
What each class of fix does to this starburst
The option set
✅ fixes · ~ partial/relocated · ◻️ doesn't fix. Note the top and third rows leave (2) empty — they make the geometry honest and tame the seam, but the starburst in the screenshot is (2), so on its own neither is the fix. HEALPix is out for body surfaces (astronomy data format, no hardware mip/aniso; even WorldWide Telescope chose octahedral TOAST over it) — relevant only if Core ever grows an all-sky background. A sketch of the polar-cap blend (schematic, Godot spatial shader): vec3 n = normalize(model_position); // object space (varying)
float lat = asin(clamp(n.y, -1.0, 1.0));
vec2 cap = n.xz / (1.0 + abs(n.y)); // azimuthal: each pole -> origin, no singularity
vec4 equirect = texture_bicubic(albedo, UV); // existing path, away from the poles
vec4 polar = texture(pole_cap, cap * 0.5 + 0.5); // small per-pole, per-body texture
float t = smoothstep(LAT_BLEND_LO, LAT_BLEND_HI, abs(lat));
ALBEDO = mix(equirect, polar, t).rgb;Difficulty, mapped to Core's architectureShader-only softening (assets untouched). Add object-space Stereographic polar caps (the targeted fix). A surface-shader change plus a small offline tool that re-projects each source map's polar bands into two azimuthal cap textures per body. The mesh and the bulk equirect pipeline are untouched; Full re-projection (cube-sphere / atlas). The mesh swap is an afternoon. The cost is the asset pipeline, identical in scope whichever layout we target:
High, and identical whether the target is a cubemap or the hcschuetz triangle atlas — which is why, if we go global, cube-sphere + cubemap beats the atlas: native Godot types, built-in conversion, a proven path (Sebastian Lague), no bespoke sampler to maintain. The hcschuetz icosahedral atlas only wins if we can obtain source data natively in that layout (removing its lossy re-bake). NetThe screenshot is artifact (2), so the cheap shader path is demoted to a cosmetic softener — worth doing for the seam and the hard spokes, but it won't remove the pinch. The two real candidates are:
References
|
|
Polar artifact is now fixed in the new v0.2 release, which uses Godot's built-in Cubemap instead of equirectangular wrapping. Note: There are cases like the Moon where poles are in deep shadow so no shadow-free images exists. I corrected these to some extent, but they're not perfect. You can see poles easily in the cubemaps: just look at faces 3 and 4 (upper-right and lower left) of the 3x2 PNG. |
|
Closing this as done now. The only thing to revisit at some point in the future is a better patch job of some polar regions in the images themselves (using cubemaps which place them in the center of a square), particularly the Moon. It can't be done by merging real images since these regions are in deep shadow. But it might be doable with real relief maps and some mildly fictional albedo. |


Uh oh!
There was an error while loading. Please reload this page.
Describe what is missing or deficient and why it should be included or improved.
For instance, take a look at the northern pole of the moon:

This project uses another approach to avoid such problems.
If this is a simulation or planetarium "content" proposal, describe how the content should appear and how users should interact with it.
No response
If this is a "code" or "development platform" proposal, describe how developers will use the new system. Provide detailed API if possible.
No response
If applicable, provide implementation code, pseudo-code, mock-ups, diagrams, or orbital maths. Do you have any helpful tips or gotchas to watch out for?
No response
Which of the following describes your feature? (1) A feature or content improvement for our Planetarium. (2) An improvement for game/app developers that should be in our core repositories. (3) An improvement for game/app developers that should be an optional addon.
I can imagine that this should be enabled for all projects, so it should go into the core repository.
All reactions