Page 1 of 1

Rotation of mars textures

Posted: 22.12.2002, 23:57
by timcrews
Hello:

In other posts it has already been discussed that different Mars textures are out there with different assumptions about where the 0 meridian is located (either the middle of the bitmap, or the edge of the bitmap.)

This is wreaking havoc for me with the hi-res Mars textures, in particular. Even after I rotated my bump map 180 degrees to follow the same convention as my surface texture map, the resulting maps were mis-aligned by a slight amount both vertically and horizontally. And I am having a devil of a time getting the specular map aligned, too.

I would like to edit these files to "rotate" the meridians on all of my mars textures to the same place. (To be clear, I don't mean "rotate" clockwise or counter-clockwise, but rotate left-to-right, with wraparound.) However, I have found this to be very difficult to accomplish precisely in Photoshop Elements.

I am particular ignorant about .dds files containing MIP maps, since when I open these I am presented with multiple copies of the same image, decreasing progressively in size from left to right. Would I need to rotate/shift each sub-image?

Does anyone know of a macro or an easy automated way of rotating an image left-to-right by 180 degrees? For example, if an image looked like this before the rotation:

ABCDEFGH

It would look like this after the rotation:

EFGHABCD

I would actually love to find a command-line tool that would do this, so I don't even have to mess with Photoshop. I don't have enough memory to open 8k or 16K .dds files in Photoshop, so the command-line tools that don't pull the whole image into memory at once would be ideal for this. But I have not found any tools that provide this particular operation.

Thanks for any advice

Tim Crews

Posted: 23.12.2002, 22:30
by selden
Tim,

The command line utilities in the NetPBM package can be used to do an arbitary rotation like what you describe. I use pnmcut (twice to extract the two pieces of the original image on either side of what will be the new edge) followed by pnmcat to put them back together in the opposite order.

They don't include a .DDS format conversion utility, though. You'd have to use Nvidia's nvdxt utility to create the final .DDS file.

Does this help?

(At lower resolutions, Grant's variant of the Martian bumpmap does seem to put the volcanoes in the right places when used with a 0-centered surface map. I checked the results against pictures taken during the 1999 and 2001 oppositions, and the phase angles seemed right.)

Rotation of mars textures

Posted: 24.12.2002, 01:06
by t00fri
timcrews wrote:Hello:

In other posts it has already been discussed that different Mars textures are out there with different assumptions about where the 0 meridian is located (either the middle of the bitmap, or the edge of the bitmap.)

This is wreaking havoc for me with the hi-res Mars textures, in particular. Even after I rotated my bump map 180 degrees to follow the same convention as my surface texture map, the resulting maps were mis-aligned by a slight amount both vertically and horizontally. And I am having a devil of a time getting the specular map aligned, too.

I would like to edit these files to "rotate" the meridians on all of my mars textures to the same place. (To be clear, I don't mean "rotate" clockwise or counter-clockwise, but rotate left-to-right, with wraparound.) However, I have found this to be very difficult to accomplish precisely in Photoshop Elements.

I am particular ignorant about .dds files containing MIP maps, since when I open these I am presented with multiple copies of the same image, decreasing progressively in size from left to right. Would I need to rotate/shift each sub-image?

Does anyone know of a macro or an easy automated way of rotating an image left-to-right by 180 degrees? For example, if an image looked like this before the rotation:

ABCDEFGH

It would look like this after the rotation:

EFGHABCD

I would actually love to find a command-line tool that would do this, so I don't even have to mess with Photoshop. I don't have enough memory to open 8k or 16K .dds files in Photoshop, so the command-line tools that don't pull the whole image into memory at once would be ideal for this. But I have not found any tools that provide this particular operation.

Thanks for any advice

Tim Crews


If you use GIMP as many do here, you should have no problems whatsoever. GIMP exists both for Linux and Windows and it is not commercial. The dds conversion is very easily done with the NVIDIA command line utility 'nvdxt.exe'. If you'd play with the search engine in this forum you would find out that there are inumerous mails concerning precisely those issues.

Bye Fridger

Rotation of mars textures

Posted: 25.12.2002, 00:23
by timcrews
t00fri wrote:If you'd play with the search engine in this forum you would find out that there are inumerous mails concerning precisely those issues.

Bye Fridger


Fridger:

I understand that it is frustrating to answer frequently asked questions. In my own defense, I do not think my specific questions fit into this category. My specific questions were 1) What do I do with MIP maps, and 2) How do I rotate an image.

As for MIP maps, you can do a search on "mip" right now on this forum, and you will get about 20 hits. I have read every one of those threads. None of them says a single thing to describe what a MIP map is, or what you do with one. I still don't know, after reading them.

As for the image rotation, if you read my post carefully you can see that I was already aware of the existence of the command line tools, I just didn't know how to use them for this specific operation. The information about pamcut and pnmcat gets me further along, but I certainly don't think this is an answer to a FAQ. It was a fairly specific question about a specific operation. pamcut/pnmcut/pnmcat have never been mentioned in this forum.

Tim

Posted: 25.12.2002, 00:38
by timcrews
selden wrote:Tim,

The command line utilities in the NetPBM package can be used to do an arbitary rotation like what you describe. I use pnmcut (twice to extract the two pieces of the original image on either side of what will be the new edge) followed by pnmcat to put them back together in the opposite order.

They don't include a .DDS format conversion utility, though. You'd have to use Nvidia's nvdxt utility to create the final .DDS file.

Does this help?

(At lower resolutions, Grant's variant of the Martian bumpmap does seem to put the volcanoes in the right places when used with a 0-centered surface map. I checked the results against pictures taken during the 1999 and 2001 oppositions, and the phase angles seemed right.)


Selden:

This information gets me further along. Thanks!

The martian textures that I am starting with are already in .dds format. This leads to two additional questions:

1) Since netpbm does not work with .dds files, I will have to convert from .dds to a netpbm-supported format, and then back to .dds when finished. I understand that this will lead to image degradation. I am not excited about that. Do you have any feedback on how bad this degradation will be?

2) The .dds files that I am starting with contain MIP maps. As I have perhaps overstressed up to this point, I still don't know what a MIP map is. When I open a file with MIP maps using the Photoshop plugin, what I see is a series of decreasing size images. I am not sure if this is just the way Photoshop shows the file, or if these images really do exist physically side-by-side in the file. If I want to use the pnmcut/cat operation, will I have to individually cut each of the different sized images in half, and then concatenate them all together again?

And I also have another question, which is a new subject for this post: It turns out, that my bump-map is not just misaligned horizontally, but is also slightly misaligned vertically! I can rotate the bump map 180 degrees horizontally, and I will get an image that still appears to be about 1 degree off horizontally, but also 1 degree off vertically.

With a cylindrical projection, I don't think it would be valid to simply rotate the entire map top-to-bottom the way I did to solve the horizontal misalignment.

I agree with you that some images do line up correctly. In fact, of the 20 mars-related textures that I own, only two are aligned with the 0 meridian in the middle of the image (which, if I understand correctly, is supposed to be the standard arrangment.) All of the rest of the images have the 0 meridian at the left/right edge of the image.

Unfortunately, the only bump map I have for Mars (mars-bump4k.dds) is one of the non-matching files. And it is the one that is off by 181 degrees horizontally, and 1 degree vertically.

Hence all of these questions!

I notice that you called it "Grant's variant". Maybe this is not the one that I have. The one I got was down-sized to 4k from a 6k bump map that came from another web site. I will search for Grant's version, but if you have a URL handy, can you please provide one? Do you know of any 8k bump maps? Using lower-resolution bump maps with higher-resolution images makes a real speckly mess under dramatically-shadowed conditions.

Thanks for your assistance,

Tim

Rotation of mars textures

Posted: 25.12.2002, 01:55
by t00fri
timcrews wrote:Fridger:

I understand that it is frustrating to answer frequently asked questions. In my own defense, I do not think my specific questions fit into this category. My specific questions were 1) What do I do with MIP maps, and 2) How do I rotate an image.

As for MIP maps, you can do a search on "mip" right now on this forum, and you will get about 20 hits. I have read every one of those threads. None of them says a single thing to describe what a MIP map is, or what you do with one. I still don't know, after reading them.

As for the image rotation, if you read my post carefully you can see that I was already aware of the existence of the command line tools, I just didn't know how to use them for this specific operation. The information about pamcut and pnmcat gets me further along, but I certainly don't think this is an answer to a FAQ. It was a fairly specific question about a specific operation. pamcut/pnmcut/pnmcat have never been mentioned in this forum.

Tim


OK, here is a mip-mapping explanation in a "nut shell":
"mip-mapping" = swapping in different texture maps for a given object,
depending on how far away from it is your viewpoint.

Generally this belongs to the standard literature of 3d rendering. I
think you originally wanted to rotate your Mars maps rather than
entering a general discussion on Mip maps etc...;-)

The whole issue arose since you are taking not the right steps. The
latter are definitely explained in lots of previous mails. Since you
seem unable to find them, here is the essence again:

1) What you called misalignment, may be a visible black line where the
two ends of the texture meet. Right? This was a known issue with
certain Mars textures. Don't take these...

2) Therefore for seemlessly joined, /excellent/ hires Mars textures go to
the RedMars site (Space Graphics),
http://www.space-graphics.com/redmars.htm,
download the raw files with the resolution
of your liking and carefully reduce their size (with cubic
interpolation) to a power of two (e.g. 8k). Then you also
download the corresponding bump maps from the same site and reduce
their size also to a power of two.

3) Apply further corrections like unsharp masking, color or brightness
corrections or (horizontal)
displacements (GIMP!) to the cylinder maps (<=> rotation) and there
will be no 'misalignments' after rotations. Alternatively, you may
just go to my Texture Foundry site,
http://www.celestiaproject.net/~t00fri/texfoundry.php4,
and download my corrected RedMars jpg/png
files (up to 8k). They can be easily displaced in GIMP as needed in
the latest corrected solarsys.ssc.

4) If you are content with the result, convert it to *.tga format (GIMP)
and from there to DXT1c format using nvdxt.exe.
nvdxt -file <filename.tga> -dxt1c

Forget about Mip maps;-).

5) Just never do manipulations on dds files, go and get the respective
lossless tiff/png/tga originals or if necessary jpg's.

That's all.

Bye Fridger

Rotation of mars textures

Posted: 25.12.2002, 19:42
by timcrews
t00fri wrote:
OK, here is a mip-mapping explanation in a "nut shell":
"mip-mapping" = swapping in different texture maps for a given object,
depending on how far away from it is your viewpoint.

<snip>

1) What you called misalignment, may be a visible black line where the
two ends of the texture meet. Right? This was a known issue with
certain Mars textures. Don't take these...

2) Therefore for seemlessly joined, /excellent/ hires Mars textures go to
the RedMars site (Space Graphics),
http://www.space-graphics.com/redmars.htm

<snip>

3) <snip> Alternatively, you may
just go to my Texture Foundry site,
http://www.celestiaproject.net/~t00fri/texfoundry.html,
and download my corrected RedMars jpg/png
files (up to 8k). They can be easily displaced in GIMP as needed in
the latest corrected solarsys.ssc.

<snip>

Forget about Mip maps;-).

5) Just never do manipulations on dds files, go and get the respective
lossless tiff/png/tga originals or if necessary jpg's.

That's all.

Bye Fridger


Fridger:

Thank you for your response. I judiciously snipped my quote above, just to keep this thread as short as possible.

I understand now the basic concept of MIP mapping. However, I can see that it is really an issue that doesn't matter much to me, once I find source material that doesn't have the MIP maps, I will just avoid them. I will explicitly swap texture resolutions using r/R in Celestia.

1) The mis-alignment I am alluding to is not a black line, just an incompatibility of where the 0 meridian is on different versions of the textures.

2) I agree with you all of the difficulties will be avoided if I start with the right source material. The link you provided is excellent. There is only one part of the equation missing, which is a specular map. I have a 4k dds spec map already, which may be adequate. I don't think it has MIP maps, so hopefully I won't have trouble rotating it to match the space-graphics maps.

[I wonder, though, what is the source of the specular texture? Really, I even wonder about the physical, real, source of specularity on Mars. Why are some areas "shinier" than others? Is this a real observable phenomenon, or would my Mars simulation be more accurate without it?]

3) I have used the textures from your site before. I appreciate you making these available. However, one thing I am very excited about is dynamic bump-mapping. I think that Mars in particular really benefits from this technique. I don't see any content on your site that is suitable for this purpose, because there are no separate bump map textures, and the main textures are lit/shadowed from the east. Have I missed the non-shadowed main textures and separate bump maps?

Also, the .dds files on your site _do_ have MIP maps, right? So it would still seem that it is not so easy to rotate these images, even with GIMP or pnmcut/pnmcat. Wouldn't it require multiple cuts/cats for each of the different-sized MIP maps? Of course, this is a moot point since I am obtaining the original lossless images as we speak, but I would like to know the answer just to be sure I understand correctly.

5) I agree, I am downloading the source material right now.

Thank you everybody for your help. I am sure I will have spectacular results soon that will make this all worth it.

Tim Crews

Rotation of mars textures

Posted: 25.12.2002, 23:07
by t00fri
timcrews wrote:
[I wonder, though, what is the source of the specular texture? Really, I even wonder about the physical, real, source of specularity on Mars. Why are some areas "shinier" than others? Is this a real observable phenomenon, or would my Mars simulation be more accurate without it?]

3) I have used the textures from your site before. I appreciate you making these available. However, one thing I am very excited about is dynamic bump-mapping. I think that Mars in particular really benefits from this technique. I don't see any content on your site that is suitable for this purpose, because there are no separate bump map textures, and the main textures are lit/shadowed from the east. Have I missed the non-shadowed main textures and separate bump maps?

Also, the .dds files on your site _do_ have MIP maps, right? So it would still seem that it is not so easy to rotate these images, even with GIMP or pnmcut/pnmcat. Wouldn't it require multiple cuts/cats for each of the different-sized MIP maps? Of course, this is a moot point since I am obtaining the original lossless images as we speak, but I would like to know the answer just to be sure I understand correctly.

5) I agree, I am downloading the source material right now.

Thank you everybody for your help. I am sure I will have spectacular results soon that will make this all worth it.

Tim Crews


As I said, do never use the dds files e.g. on my site for image manipulations. Just pretend initially (when entering my site), that your card does not support DXT then you will be offered jpg/png files for everything that is in the archive. These you can easily rotate...and at the end convert them to DXT format.

Moreover, although I am using 4k SPEC files for Mars, that I made myself, this issue is a matter of taste...I have not uploaded these.

You are right that the material on my site should be eventually updated for the aera where separate bump, spec files are supported in Celestia. I simply did not have the time yet to do it.

Bye Fridger