Using the Nmtools package

General discussion about Celestia that doesn't fit into other forums.
danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #41by danielj » 03.01.2007, 12:58

Sorry,I confused because the keyboard have a not continous vertical line,but:
|



t00fri wrote:Daniel,

I am horrified: who buys a keyboard without a | key? (you apparently ;-) )

The | is a VERY frequent key in any kind of programming independent of the used operating system. So whoever sold you that keyboard, how could he have known that you never write programs?

Are you really sure that the | is missing on your keyboard? In my US English keyboard the | is on top of the \ key. What's over the \ key in your keyboard?

Is Daniel the only one without a | key?

The | is not only the pipe operator, but also in C/C++, there is

Code: Select all

 x | y              x bitwise ORed with y
 x | = y          assign  x | y to x
||                   logical OR


similarly in PERL, FORTRAN, MAPLE/LUA ... various other Programming languages that I know. Hence a keyboard without a | key is NOT a sensible keyboard for computer work.

Bye Fridger

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

Post #42by Johaen » 03.01.2007, 13:08

danielj wrote:Sorry,I confused because the keyboard have a not continous vertical line,but:
|


I assume what you mean is that on your keyboard they key has a vertical line with a gap in the middle. I've seen them before. As you can see, it shows up onscreen as a continuous vertical line.
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
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #43by t00fri » 03.01.2007, 13:15

Hey Daniel, John,

so it seems I can again recline and relax again ;-) (for a while).

-- Daniel has finally discovered his | key ...

--John seems to localize ImageMagick as the culprit for his observed large pixel shifts in the normalmap!

Bye Fridger
Last edited by t00fri on 03.01.2007, 13:46, edited 2 times in total.
Image

bh
Posts: 1547
Joined: 17.12.2002
With us: 21 years 11 months
Location: Oxford, England

Post #44by bh » 03.01.2007, 13:44

Phew Fridge man...that was a close one!
regards...bh.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #45by Christophe » 03.01.2007, 14:56

danielj wrote:Sorry,I confused because the keyboard have a not continous vertical line,but:
|


you mean ?¦ ;-)

I agree, it is confusing, [url=http://en.wikipedia.org/wiki/?¦]Wikipedia[/url] has an article on this.
Christophe

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

Post #46by t00fri » 03.01.2007, 15:42

Christophe wrote:
danielj wrote:Sorry,I confused because the keyboard have a not continous vertical line,but:
|

you mean ?¦ ;-)

I agree, it is confusing, [url=http://en.wikipedia.org/wiki/?¦]Wikipedia[/url] has an article on this.


Daniel,

you see without struggling with the nmtools tutorial, you would NEVER have learned about the subtle difference between

?¦ and | ;-)

Bye Fridger
Image

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

Post #47by Johaen » 03.01.2007, 15:48

Christophe wrote:
danielj wrote:Sorry,I confused because the keyboard have a not continous vertical line,but:
|

you mean ?¦ ;-)

I agree, it is confusing, [url=http://en.wikipedia.org/wiki/?¦]Wikipedia[/url] has an article on this.


Well sheesh. I had no idea you could make a ?¦. On my keyboard at home, the | key is a solid line, while here at work it is a broken line. Very odd.
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;

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #48by ElChristou » 03.01.2007, 15:52

What about moving all off topic stuff to a new thread called "Using nmtools" for example? Let's keep this thread only for Info about News in CM...
Selden?
Image

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

Post #49by t00fri » 03.01.2007, 16:01

ElChristou wrote:What about moving all off topic stuff to a new thread called "Using nmtools" for example? Let's keep this thread only for Info about News in CM...
Selden?


I would definitely welcome Christophe's proposal!

Bye Fridger
Image

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

Post #50by selden » 03.01.2007, 17:37

Unfortunately, I can find only one or maybe two posts, both at the very beginning of this topic, which actually are announcements about the new Web site. All of the rest are about using nmtools.

The easiest thing to do would be for Fridger to rename and un-sticky this topic and start a new sticky announcement topic -- which should include a statement that the topic is only for announcements and that all discussion should be in other topics.
Selden

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

Post #51by t00fri » 03.01.2007, 17:43

selden wrote:Unfortunately, I can find only one or maybe two posts, both at the very beginning of this topic, which actually are announcements about the new Web site. All of the rest are about using nmtools.

The easiest thing to do would be for Fridger to rename and un-sticky this topic and start a new sticky announcement topic -- which should include a statement that the topic is only for announcements and that all discussion should be in other topics.


Right, Selden, I was thinking about this procedure as well. Will proceed now...


[edit]

Done!

Bye Fridger
Image

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Post #52by abramson » 04.01.2007, 20:33

Wow! Just today I could try the new nmtools, and I can only express my deepest thanks for making this available, Fridger. They work like charm on the BMNG altitude file, and the result is so excellent! I will have to make a set of base VT from the BMNG flats, now (I already downloaded July).

For Daniel, and anybody else that needs some help to use the console utilities, I will share the script I used today to prepare my set of tiles. It's not the fastest, probably, but it was fast to put together, and then go have a "milanesa napolitana".

It assumes that you have the file srtm_ramp2.world.86400x43200.bin.gz in the same folder. Also, gzip and the nvidia tools installed as Fridger explained (and a little endian cpu). The result of the script is a 64K normal VT in 5 levels of TileSize 1024, TileType "dxt5nm", exaggeration 2.5 "alla Fridger". You only need to put them into an appropriate VT structure, with a .ctx (and a .ssc if it were used as an AltSurface). Come on, Daniel, pipe your way through this!

Cheers, and congratulations again to Fridger.

Guillermo

This is BMNG-normal-level5.bat (it seems that the system keeps wrapping the lines at incorrect places. I don't know how to make it clear where the linebreaks should go, for inexperienced people. Let's say just that each block of instructions after the mkdir's should have 6 lines, starting with the commands cd, gzip, nvdxt, ren, del, cd):

Code: Select all

mkdir level5
mkdir level4
mkdir level3
mkdir level2
mkdir level1
mkdir level0

cd level5
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | nmstiles 5 6378.140 65536 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

cd level4
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | halfsize 65536 | nmstiles 4 6378.140 32768 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

cd level3
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | halfsize 65536 | halfsize 32768 | nmstiles 3 6378.140 16384 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

cd level2
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | halfsize 65536 | halfsize 32768 | halfsize 16384 | nmstiles 2 6378.140 8192 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

cd level1
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | halfsize 65536 | halfsize 32768 | halfsize 16384 | halfsize 8192 | nmstiles 1 6378.140 4096 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

cd level0
gzip -dc < ..\srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 | halfsize 65536 | halfsize 32768 | halfsize 16384 | halfsize 8192 | halfsize 4096 | nmstiles 0 6378.140 2048 2.5
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
ren *.dds *.dxt5nm
del /q *.ppm
cd ..

echo Done!
echo Now put all the levels into a suitable virtual texture structure!

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

Post #53by t00fri » 04.01.2007, 21:27

Guillermo,

great to hear that you succeeded well with the nmtools. And many thanks for your script. I am sure this will be VERY useful for Windows users. I just didn't get round to writing one yet.

Bye Fridger
Image

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Post #54by abramson » 04.01.2007, 22:35

t00fri wrote:I am sure this will be VERY useful for Windows users. I just didn't get round to writing one yet.


Sure. If you wish, just put it also at CM. Perhaps one could complete it for the creation of the VT structure and ctx. I could look into it on the weekend.

Regards,

Guillermo

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

re

Post #55by John Van Vliet » 05.01.2007, 02:35

well the " bug " is with Image magick
when converting a .gray to a .tif or .png ( booth open in vips/nip2) and suport 16 bit

for those of you , besides me , that use nip2 i did a hack of nms
save the image as a 16bit sRGB .v
then rename to .rgb
ImageMagick -- convert -size 16384x8192+58 1.rgb -depth 16 -type Grayscale 1.gray
or in your fav. hex editor remove the headder , the last line is all 000 000 000 ... in bin
then use nmsu (unsined)
-------------------- for venus-- eddited 1.6.07 i had a " I should of had a v8 " moment
and this is much simpler
nmsu 6050 4096 5 1 < 4k.gray > 4knmsu.ppm
nmsu <bodyradius> <width> <exag> < lsb msb>

eddit line 51 aprox. and compile with " g++ nmsu.cpp -o nmsu "
---------------------------

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 ;
}

my sys is intel
so this code only works for lsb and unsined
and only tested for .v to .gray to ppm

-------------------------------------
Last edited by John Van Vliet on 06.01.2007, 07:55, edited 3 times in total.

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

Post #56by t00fri » 05.01.2007, 21:01

abramson wrote:
t00fri wrote:I am sure this will be VERY useful for Windows users. I just didn't get round to writing one yet.

Sure. If you wish, just put it also at CM. Perhaps one could complete it for the creation of the VT structure and ctx. I could look into it on the weekend.

Regards,

Guillermo


Guillermo,

I would indeed be happy to add your script to my tutorial at CelesltialMatters. Many thanks. I hope I can get this done already during the coming weekend.

Bye Fridger
Image

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #57by Fightspit » 06.01.2007, 10:15

After trying the 64K Normal MAP in PNG in Celestia 1.4.1, it also works succefully under Celestia 1.5.0 pre1 with DXT5nm :!:

Warning some big screenshots :!: (without antialiasing) :
Image

Image

Image

Image

Something interisting in Antartica is the different snow layers which can be seen but I don't know if it is due the fact of the height exageration (2.5) or maybe a bug ? (I also see it in 1.4.1 but I thought it is normal).

Here my ctx file:

Code: Select all

VirtualTexture
{
        ImageDirectory "normal"
        BaseSplit 0
        TileSize 1024
        TileType "dxt5nm"
}
Last edited by Fightspit on 06.01.2007, 14:41, edited 1 time in total.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Post #58by abramson » 06.01.2007, 13:27

Fightspit, you've got it wrong. I suspect an incorrect number of byteswaps. REad carefully Fridger's instructions, or have a look at my script above. The textures should appear much smoother than what you show, even with a 2.5 exaggeration. And certainly no "layers". See that you even have layers in the ocean, which should be completely flat.

Guillermo
Last edited by abramson on 06.01.2007, 13:51, edited 1 time in total.

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Post #59by abramson » 06.01.2007, 13:41

Fightspit:

This is how Antarctica looks like from approximately the same place, at the same time, and with 2.5 exaggeration.

Image

This is Western Europe:

Image

This is Northern Patagonia (where I live):

Image

Good luck.

Guillermo

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #60by Fightspit » 06.01.2007, 14:40

I used a .bat file like you but not the exactely same script and I am remember when I put a < and a > in the .bat file, I get a 0< and a 1> in the console (there is a number in front of < or >). I thought it wasa 'bug' of my console but there was no problem about generating of the normal map.
For exemple if a do in my script:

Code: Select all

halfsize 65536 < srtm_ramp2.world.64k.bin > srtm_ramp2.world.32k.bin

I get in my console:

Code: Select all

halfsize 65536 0< srtm_ramp2.world.64k.bin 1> srtm_ramp2.world.32k.bin

It is a little strange ... but it has worked.
I will retry again without the script.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits


Return to “Celestia Users”