Using the Nmtools package

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Post #221by t00fri » 22.05.2007, 08:39

cartrite wrote:I haven't got a chance to use the nm tools yet because of storage issues but I just installed a 500 gb sata drive that so as soon as I find the time...

Anyhow my first try will be with the 84k by 43k file the tools were meant for but I also was thinking of using srtm-3 data (version 2) I downloaded last year. Will the tools be able to use this data? This data is in 1201x1201 files with 16 bit signed integers as the 84k file is but there are over 10,000 of them.
cartrite


I found this pretty horrible that they only present the version 2 data in form of such tiny tiles. Just try the format with one tile and you will know for sure. I suppose it will work. But you will have to write code that joins the tiles together, since the subdivisions of the VT tiles are different, notably also due to the many optimizations.

Bye Fridger
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #222by cartrite » 22.05.2007, 21:50

I think I'll stick with the 84k file for now til I can figure out what to do with the srtm-3 data. I should have some time this weekend.

A 90 meter / pixel map would be pretty big :wink:
I think it would have to be done file by file without trying to combine them into one file. No matter how it's done it would be a major job. 8O

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

jaimela
Posts: 1
Joined: 16.05.2007
With us: 17 years 6 months

Post #223by jaimela » 23.05.2007, 14:40

bh wrote:Awesome screens Johaen... looking forward to getting my head around using this for mac!



Those shots are indeed awesome. I'm going to be getting a Mac in the next month and hope I can duplicate the results. Some of this seems a bit beyond me though, to be frank.

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #224by cartrite » 26.05.2007, 23:26

Fridger,

The tools worked like clockwork. :D Truly amazing!!!
A strange thing happened though. I created a simple script as follows.

Code: Select all

#!/bin/sh

halfsize 65536 < srtm_ramp2.world.64k.bin > srtm_ramp2.world.32k.bin
halfsize 32768 < srtm_ramp2.world.32k.bin > srtm_ramp2.world.16k.bin
halfsize 16384 < srtm_ramp2.world.16k.bin > srtm_ramp2.world.8k.bin
halfsize   8192 < srtm_ramp2.world.8k.bin   > srtm_ramp2.world.4k.bin
halfsize   4096 < srtm_ramp2.world.4k.bin   > srtm_ramp2.world.2k.bin
cd /home/cartrite/level5
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.64k.bin /home/cartrite/level5/
nmstiles 5 6378.14 65536 1.5 < srtm_ramp2.world.64k.bin
cd /home/cartrite/level4
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.32k.bin /home/cartrite/level4/
nmstiles 4 6378.14 32768 1.5 < srtm_ramp2.world.32k.bin
cd /home/cartrite/level3
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.16k.bin /home/cartrite/level3/
nmstiles 3 6378.14 16384 1.5 < srtm_ramp2.world.16k.bin
cd /home/cartrite/level2
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.8k.bin /home/cartrite/level2/
nmstiles 2 6378.14 8192 1.5 < srtm_ramp2.world.8k.bin
cd /home/cartrite/level1
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.4k.bin /home/cartrite/level1/
nmstiles 1 6378.14 4096 1.5 < srtm_ramp2.world.4k.bin
cd /home/cartrite/level0
mv /home/cartrite/share/celestia/tools/srtm_ramp2.world.2k.bin /home/cartrite/level0/
nmstiles 0 6378.14 2048 1.5 < srtm_ramp2.world.2k.bin



The strange thing that happened was that I opened the level5 folder and ppm files were being written while halfsize was still running on the 32k to 16k. The terminal was outputting the file names of the level5 ppm files while halfsize was still running. In fact all the ppm files were finished and the terminal was still outputting level5 file names. When it got to level4 and all the lower levels, there was a pseudo error generated on the terminal screen saying that the 32k file did not exist. 8O

I believe all this mayhem may have been due to something called Native Command Queuing. The sata drive I installed Suse 10.2 on supports that technology. :?:

Thanks for all your efforts and thanks to all that helped you.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Post #225by t00fri » 26.05.2007, 23:37

cartrite,

great to see that nmtools worked fine for you!

The new (not yet released) version is still much faster and outputs PNG tiles (instead of PPM format) that may then be directly converted to highest quality DXT5nm with nvcompress (squish).

Bye Fridger
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #226by cartrite » 28.05.2007, 22:33

Has anyone done a normalmap of Mars with the tools? If so, What file was used?

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Johaen
Posts: 341
Joined: 14.01.2006
With us: 18 years 10 months
Location: IL, USA

Post #227by Johaen » 28.05.2007, 23:33

cartrite wrote:Has anyone done a normalmap of Mars with the tools? If so, What file was used?

cartrite


I searched for several hours on the internet and I could not find an appropriate base texture.
AMD Athlon X2 4400+; 2GB OCZ Platinum RAM; 320GB SATA HDD; NVidia EVGA GeForce 7900GT KO, PCI-e, 512MB, ForceWare ver. 163.71; Razer Barracuda AC-1 7.1 Gaming Soundcard; Abit AN8 32X motherboard; 600 watt Kingwin Mach1 PSU; Windows XP Media Center SP2;

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #228by cartrite » 29.05.2007, 00:03

I took a go at creating a single file from the 4 megtxxnxxxgb.img files from meg064 folder at http://pds-geosciences.wustl.edu/geodat ... mgsl_300x/ with ISIS3. Ran into some problems though. I can create a 16 bit signed integer height map but it chops the tops off the highest peaks on Mars. Not sure why yet. I guess I could always run nms on the 128 pixel per degree files one at a time and VT them. That's how I used to do it with nm16.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #229by cartrite » 29.05.2007, 08:09

From what I'm seeing in the output ppm's after running nms on the individual files in the meg128 folder at http://pds-geosciences.wustl.edu/geodat ... mgsl_300x/ it seems that the code that corrects for spherical bodies requires that the input file cover the whole planet? Correct ?
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #230by cartrite » 29.05.2007, 08:37

Not sure what I was doing wrong with ISIS3 but I am now able to mosaic the files from the meg128 folder at the above site. That will produce a file that covers mars from 88n to 88s. Not sure how I'm going to get the data for the poles into the file yet.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

re

Post #231by John Van Vliet » 31.05.2007, 00:38

hi the mola .img's are 16 bit UNSIGNED not signed
to use the nm tools either move the white point of the 16bit signed ( -32768 to 32768 ) unsigned is ( 0 to 65536 ) .

converting a unsigned to singed only leaves you with 32768 shades and not
65536 . set the offset in nip http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS
or image magic to -32768
or
edit the txtools nms.cpp , halfsize.cpp , resc2pow2.cpp
see this post
http://www.celestiaproject.net/forum/viewtopic ... highlight=

rename them - after editing them to nmsu.cpp , halfsizeu.cpp , resc2pow2u.cpp

Code: Select all

short readS16(FILE *in)
{
    short b2;
   
    fread(&b2, 2, 1, in);

    if (byteSwap == 1)
     
       b2 = (((b2 & 0xff00)) >> 8) | (((b2 & 0x00ff)) << 8);
   
    return (short) (b2 +32767);
}
-------------------------------------- orig-------------------------------------
short readS16(FILE *in)
{
    short b2;
   
    fread(&b2, 2, 1, in);

    if (byteSwap == 1)
     
       b2 = (((b2 & 0xff00)) >> 8) | (((b2 & 0x00ff)) << 8);
   
    return (short) b2 ;
}

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #232by cartrite » 31.05.2007, 14:22

Hey John,
I'm kind of past that point because the first thing I do with the files is run pds2isis on them which changes them to signed 32bit .cub files. Then i can use a program called automos to put the file sections together to mosaic a complete map of mars. Then I run isis2raw and create a 16bit signed integer file for input for nms. What I need to do know is how to pad zero's for 90 north to 88n and 90s to 88s to fill in the missing data in the meg128 files. Then I could create a 32k map. I've already created a 16k map with meg064 files.

The above programs are from ISIS3 software which runs on linux systems put out by USGS.

cartrite
Last edited by cartrite on 02.06.2007, 09:27, edited 1 time in total.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Post #233by ANDREA » 31.05.2007, 14:43

cartrite wrote:...What I need to do know is how to pad zero's for 90 north to 88n and 90s to 88s to fill in the missing data in the meg128 files. cartrite

Cartrite, probably this is a stupid suggestion, but these maps cannot be used? :oops:
http://pds-geosciences.wustl.edu/geodat ... 00x/polar/
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

re

Post #234by John Van Vliet » 31.05.2007, 15:38

for the 128 map i added the 64 map ( resized to 128 ) for the 2 poles
because of the size of the maps i needed to work on it in 4096 x4096 tiles

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #235by cartrite » 01.06.2007, 02:50

Andrea wrote:
Cartrite, probably this is a stupid suggestion, but these maps cannot be used?
They can be used if they can be reprojected from "POLAR STEREOGRAPHIC" to "SIMPLE CYLINDRICAL". Ive tried that the other day but got an error. I'm going to give it a better try this weekend when I got more time.
John wrote:
or the 128 map i added the 64 map ( resized to 128 ) for the 2 poles
I was also thinking about doing that. I may end up doing just that.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Post #236by ANDREA » 01.06.2007, 06:48

cartrite wrote:Andrea wrote:
Cartrite, probably this is a stupid suggestion, but these maps cannot be used?
They can be used if they can be reprojected from "POLAR STEREOGRAPHIC" to "SIMPLE CYLINDRICAL". Ive tried that the other day but got an error. I'm going to give it a better try this weekend when I got more time. cartrite

Perhaps this link can give you some help, I hope: :wink:
http://isis.astrogeology.usgs.gov/IsisS ... d5c5a836c8

But this Matlab addon can be even more interesting:
http://www.eos.ubc.ca/~rich/map.html

and Geographic Transformer looks like the right thing,
http://www.bluemarblegeo.com/products/t ... op=details
and here is the evaluation free download:
http://www.bluemarblegeo.com/products/t ... d&file=212
My little cent.
Good luck, I'm VERY interested on Mars hi-res textures for my shows.
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #237by cartrite » 02.06.2007, 04:03

I ended up cropping out 128 lines ( top and bottom ) from the finished 16k bin file and enlarging it to 256 lines and added it to the 88n-88s file and got a 32k 16 bit signed integer file for nmstiles. Once the file was created the nmtools ran great.

Image


Here is a link to the other screen shots I took of the 32k normalmap. There are some problems around the poles but I can live with it. Some day I may try to reproject the polar files to see if I can improve it.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

woody
Posts: 8
Joined: 04.06.2007
With us: 17 years 5 months
Location: Saint-Brieuc, France

Post #238by woody » 04.06.2007, 06:31

Hi everybody,

I just discoverd Celestia and Nmtools yesterday.

I already achieve to produce the .dxtEn tiles from gebco_bathy.21601x10801.bin.gz.

What is the next step to use them with Celestia ?

I read about some .ctx and .ssc configuration files, but didn't find any clear explanation.

So I need your help.

In advance, thanks a lot,

Regards,

--
Woody

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #239by cartrite » 04.06.2007, 08:01

woody,
Here is a place to read about the files you mentioned. The Virtual Textures section provides a pretty good explanation. It shows the directory structure and the contents of the files. The second link for the main page will explain other things about using Celestia you may find interesting.

http://www.lns.cornell.edu/~seb/celesti ... .html#13.0
http://www.lns.cornell.edu/~seb/celesti ... notes.html

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

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

Post #240by selden » 04.06.2007, 11:25

See also
http://www.lepp.cornell.edu/~seb/celest ... s.html#2.5
and the document "Virtual Textures for Dummies" on the MotherLode at
http://celestiamotherlode.net/catalog/d ... ation.html
Selden


Return to “Celestia Users”