Texture pinching

Report bugs, bug fixes and workarounds here.
Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Texture pinching

Post #1by ajtribick » 11.01.2004, 18:13

Some of the supplied textures have "pinching" at the poles.

Examples are Earth cloudmap, Pluto, Charon. These textures are missing data at the poles.

I take it Celestia uses a spherical projection to map the textures onto the surface, so if the textures are created with say a cylindrical projection, it will cause pinching.

Oh yes, and there's a vertical yellow line in the Jupiter texture.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 11.01.2004, 19:01

Chaos,

You need to be somewhat more precise in your terminology. :)

Celestia uses the "simple cylindrical" map projection, also known as "equidistant cylindrical" and "Plate Car?e". When you use the term "cylindrical," you have to provide an appropriate modifier: there are several different types of cylindrical map projections.

At any rate, the pinching could be caused by using simple cylindrical maps that didn't include the areas nearest the poles (e.g. only went to +/- 85 degrees) or because the wrong conversion was used when converting maps into simple cylindrical, so that the polar regions weren't projected properly.
Selden

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #3by Rassilon » 11.01.2004, 19:44

pole pinch can be done away with by using adobe photoshop or the gimp....polar coordinates filter
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #4by selden » 11.01.2004, 20:06

Ras',

A quibble: adding horizontal distortions may be inappropriate if the map image actually is missing the polar regions. It may be more accurate to add several rows of pixels to the image at the top and bottom. Although this would create blank polar regions, the existing features would be drawn at the correct latitudes when the revised map is projected onto a sphere.
Selden

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #5by granthutchison » 11.01.2004, 23:17

Buie's occultation albedo maps for Pluto and Charon (which Fridger used to prepare the Celestia maps) aren't missing data at the poles, so that can't be the explanation.
I confess I've always assumed that the pinch at the poles was an artefact produced by Celestia's texture handling - it seems to be present in most textures if you look closely enough (unless this is specific to my graphics card). Compare, for instance, the north polar cap of Mars as it appears on the Celestia texture and when Mars is displayed in Celestia - on my machine, I see the polar ice very visibly sucked towards the pole into a triangular wedge, very different from how it should appear. My old coarse grid textures had a line of contrasting pixels at their northern and southern edges, intended to appear as circular dots at the poles, but they never showed up as more than a smear of colour.

The yellow line on Jupiter is unpleasant - we should replace that.

Grant

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #6by Rassilon » 12.01.2004, 01:52

Pole pinch is an artifact of texture mapping a sphere...The only way to have a clean polar cap is by doing what I stated above...or some third party plugin...

If you have an image of the polar region of said planet it is as simple as blending the two textures together...When you set polar regions in Photoshop you can skew the polar image you have to overlay to a rough 'oval' shape due to the distortion of the overall texture...If the texture was a perfect square you would only need apply the polar cap texture to the target planet texture while polar distortion is enabled...

1st step - rectangular to polar
2nd step apply polar texture (maybe distort a bit)
3rd step - polar to rectangular
4th step rotate 180°
5th step repeat 1 - 3

There are certain instances where there will still be a small pinch at the top but overall is not really noticable unless you get real close...Most of my worlkds so far Ive made I dont really notice any pinching...but on occasion Ive seen some small residue of this...All in all its the best way as of yet...unless chris changes the spheres for planets to a geosphere format...which I believe is alot larger to render...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #7by Rassilon » 12.01.2004, 02:06

this is a sample of a geosphere polar region rendered in 3d studio max with one of my planet textures...

Image

it reduces it to null in my book...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Post #8by ajtribick » 12.01.2004, 13:39

Are you sure it is equidistant cylindrical projection being used?

I've been examining the textures in POV-ray and mapping the textures on to spheres using spherical projection (map_type 1) and equidistant cylindrical projection (map_type 2)

This is the comparison:

Image

Top = Celestia (colours enhanced)
Middle = POV-ray, equidistant cylindrical projection
Bottom = POV-ray, spherical projection

Looks like the Mars texture is a spherical projection. Similarly for Mercury, Io...

The Charon and Pluto textures seem to be in some completely different type of mapping, or are missing data, similarly Enceladus.

That's all the textures I've tested, but I haven't found any which seem to be in cylindrical equidistant projection.

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #9by granthutchison » 12.01.2004, 15:25

Chaos:
The problem here is that what POVray and other similar packages call a spherical texture mapping is what cartographers call a simple cylindrical projection. You and Selden are just having a nomenclature mismatch for the same thing.
Your demonstration with POVray proves my point, though - the texture pinch is a product of Celestia, not (necessarily) the textures themselves.

The Enceladus map is a simple cylindrical projection - find the original here, named as such by the cartographer who created it. The fact that the surface features line up with the labels in the IAU locations file for that body confirms that the map projection is correct. Similarly, Buie's Pluto and Charon maps are simple cylindrical projections.
In both cases I think the polar difficulties are because of low-res, low-angle photometric/photographic data failing to resolve perfectly at the pole - compounded in the case of Enceladus by an imaginary fill for the south pole.

Grant

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #10by selden » 12.01.2004, 16:05

My current suspicion is that there may be a bug in how Celestia maps textures onto spheres. Whether it's in Celestia, OpenGL or the display hardware, I dunno.

I don't have access to the images right now (they're at home and I'm not), but one of the projections of an all-sky map that I'm working on looked quite bad at the poles. As I recall, its appearance could be explained by the mapping simply drawing triangular regions from the top and bottom of the texture instead of scaling the full length of the scanline.

One complication is that the visual representation is affected by the structure of the model that the image is being projected onto. The positions of the edges and the sizes of the facets can make a significant difference. I dunno if Celestia is trying to use some kind of idealized sphere (as POVRay does) or a model that approximates it.
Selden

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #11by granthutchison » 12.01.2004, 16:36

Chaos:
Rereading your post, I'm puzzled by:
chaos syndrome wrote:Middle = POV-ray, equidistant cylindrical projection
I haven't used POVray for a year or two now, but my recollection was that the terminology at that time was an unmodified "cylindrical", not "equidistant cylindrical". If they've changed the name in the meantime it's an odd and misleading innovation, since the POVray cylindrical mapping is equidistant when mapped on to an appropriately orientated cylinder or prism, but far from equidistant when it's being mapped onto anything else.

Grant

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #12by Rassilon » 12.01.2004, 17:55

Selden said:
My current suspicion is that there may be a bug in how Celestia maps textures onto spheres. Whether it's in Celestia, OpenGL or the display hardware, I dunno.


Considering that the same thing happens in any program that tries to map a texture to a sphere I hardly think its a problem with celestia, openGL or the display drivers... but a problem with the texture itself...considering that the triangles near the poles are different than near the equator it is prudent to say that the texture may be manipulated in such a way to fix this problem...Even on a geosphere a plain 1024 x 512 or larger texture with no pole editing will pinch at the poles and look awful...Most of the maps Ive come across on the net do not use the method I described above but some other method of scaling...I think the mars image is a good example of this...

The moon texture however is one that was developed using the method I stated above and I notice no pinch at the poles using this texture...

Im not sure the terms but simple cylindrical projection is one I think uses scaling the other may use the method I describe...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #13by granthutchison » 12.01.2004, 18:27

Rassilon wrote:Considering that the same thing happens in any program that tries to map a texture to a sphere I hardly think its a problem with celestia, openGL or the display drivers...
Rass', it doesn't happen in POVray, as chaos syndrome has just nicely shown above. And I haven't seen it in VRMLs I've built in the past. There's no logical necessity for it to happen, if the pixels are laid down correctly (linearly) in the vicinity of the poles - unfortunately, this isn't happening in Celestia, which is what I think Selden is commenting on. I agree with him.

Which moon texture are you talking about, BTW? I see a horrible pinch at both poles of the current Celestia distribution texture.

Grant

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #14by Rassilon » 12.01.2004, 19:36

The moon texture may be one that wasnt included with the original distribution...I think its Jens actually...

Most engines Ive used do the same pinching effect I see in celestia Including 3d Studio Max...The above example I shot was of course with a texture I corrected using my method and a geosphere...

Are the two textures above used in POV different textures or are they the same texture applied with a different mapping modifier?
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #15by Rassilon » 12.01.2004, 20:12

I think I need to clarify what exactly the textures are being referenced here and what thier correct labels are...

A. Cylindrical Projection? With the poles sort of scaled smaller?
Image

B. Spherical Map?
Image

B is the types of textures I create...I am guessing this is a spherical map and they are the ones that work best in celestia...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #16by selden » 12.01.2004, 21:08

Ras',

Yes, your example B appears to be the type of projection we're discussing: a simple cylindrical map aka "spherical".

Your example B shows the pinching problem, too. It's just not so obvious because the colors are pastels. Here's how one of its poles looks on my system. Note all the thin triangles pointing toward the center of the screen (toward the pole). Apparently Celestia is using an OpenGL Sphere definition routine, specifying many "slices". This, as well as your comment about 3DSMax having similar symptoms, leads me to suspect that it's caused by a design problem within OpenGL.

Image
(as usual, this links to a much larger image)

Added slightly later: here's a view of the wireframe using the Ctrl-W command.

Image
(I'm slightly amused by the moire pattern. But sometimes I'm easily entertained.)
Selden

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #17by Rassilon » 12.01.2004, 21:28

Yes it appears to be a pixelation of sorts...Of course the worst the compression of the texture the worst the pinch looks...That texture I supplied was compressed 60%...

And the CTRL W option sheds some light on the dilemma...The type of sphere Celestia uses is the same type that gives me problems in any other program Ive used it in...A Geosphere would be a better model to use in Celestia...Maybe Ill look at the rendering code for the sphere and see if I can convert it to a geosphere...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #18by selden » 12.01.2004, 21:36

I was wrong about Celestia using an OpenGL sphere definition. Chris wrote his own. See http://cvs.sourceforge.net/viewcvs.py/celestia/celestia/src/celengine/spheremesh.cpp?annotate=1.3
Selden

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #19by Rassilon » 12.01.2004, 21:41

Second thought...I think Ill leave that one alone...

Damn you guys now that I really look at the tops of some of my planets Im starting to see these triangles :P Not all of them just a few...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Post #20by ajtribick » 12.01.2004, 22:07

Could someone please explain what a "geosphere" is, I seem to remember the term from OpenFX but I no longer have that program installed, and I've lost the installer...

I think there was the term "isosphere" as well, but I'm not sure...


Return to “Bugs”