Using the Nmtools package

General discussion about Celestia that doesn't fit into other forums.
tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #101by tech2000 » 19.04.2007, 20:31

selden wrote:What do you mean by "trash character"? Exactly what is it?

DOS format files always end with one or more Ctrl-Z (ASCII End-Of-File) characters and the remainder of that disk block should be filled with nulls.


Unfortunatly that doesn't do it since the trash character is a "" and that will break the ctx and ssc file. :cry:

Bye, Anders

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

Post #102by selden » 20.04.2007, 11:53

Unfortunately, whatever character you tried to quote isn't showing up here. There is nothing between the quote symbols. You'll need include the hex (or octal or decimal) value of the character. You might try doing a hex dump of a short file and include that text.
Selden

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #103by tech2000 » 20.04.2007, 12:13

I have now fixed the problem and included a menu...

It can't be easier to use Fridgers nmtools now. The menu let the user chose between dxt5nm or PNG tiles. One keypress will result in a finnished directory that has to manually be moved to Celestia/extras.

Hope some of you will have any use for it.

vtgen.bat

Code: Select all

prompt $g
cls
@echo off
echo ------------------------------------------------------------------------
echo  This script will generate a set of dxt5nm/PNG normalmaps for Celestia.
echo ------------------------------------------------------------------------
echo                1: dxt5nm tiles     or     2: PNG tiles

CHOICE /c 12 /N /m choices:
IF ERRORLEVEL 2 GOTO png
IF ERRORLEVEL 1 GOTO dxt5nm

:dxt5nm
cls
echo.
echo.
echo This will generate a set VT's in dxt5nm format from level 0 to level 5.
echo (1.480.691.760 bytes)
echo.
echo.
echo Preparing 64k RAW image from Nasa - srtm_ramp2.world.86400x43200.bin.gz.
echo.

echo on
gzip -dc < srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 > world64k.bin
@echo off

echo.
echo Halfsize RAW file, 64k to 32k image.
echo.

echo on
halfsize 65536 < world64k.bin > world32k.bin
@echo off

echo.
echo Generating dxt5nm level 5 tiles.
echo.

echo on
nmstiles 5 6378.140 65536 2.5 < world64k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world64k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 5 tiles to Earth Normal.
mkdir "Earth Normal"
mkdir level5
move *.dxt5nm level5
move level5 "Earth Normal"

echo.
echo Halfsize RAW file, 32k to 16k image.
echo.

echo on
halfsize 32768 < world32k.bin > world16k.bin
@echo off

echo.
echo Generating dxt5nm level 4 tiles.
echo.

echo on
nmstiles 4 6378.140 32768 2.5 < world32k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world32k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 4 files to Earth Normal.
mkdir level4
move *.dxt5nm level4
move level4 "Earth Normal"

echo.
echo Halfsize RAW file, 16k to 8k image.
echo.

echo on
halfsize 16384 < world16k.bin > world8k.bin
@echo off

echo.
echo Generating dxt5nm level 3 tiles.
echo.

echo on
nmstiles 3 6378.140 16384 2.5 < world16k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world16k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 3 tiles to Earth Normal.
mkdir level3
move *.dxt5nm level3
move level3 "Earth Normal"

echo.
echo Halfsize RAW file, 8k to 4k image.
echo.

echo on
halfsize 8192 < world8k.bin > world4k.bin
@echo off

echo.
echo Generating dxt5nm level 2 tiles.
echo.

echo on
nmstiles 2 6378.140 8192 2.5 < world8k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world8k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 2 tiles to Earth Normal.
mkdir level2
move *.dxt5nm level2
move level2 "Earth Normal"

echo.
echo Halfsize RAW file, 4k to 2k image.
echo.

echo on
halfsize 4096 < world4k.bin > world2k.bin
@echo off

echo.
echo Generating dxt5nm level 1 tiles.
echo.

echo on
nmstiles 1 6378.140 4096 2.5 < world4k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world4k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 1 tiles to Earth Normal.
mkdir level1
move *.dxt5nm level1
move level1 "Earth Normal"

echo.
echo Generating dxt5nm level 0 tiles.
echo.

echo on
nmstiles 0 6378.140 2048 2.5 < world2k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world2k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 0 tiles to Earth Normal.
mkdir level0
move *.dxt5nm level0
move level0 "Earth Normal"

echo.
echo Generating directory structure.
echo.

move "Earth Normal" hires

rem Generating the ctx file for dxt5nm tiles.
echo VirtualTexture {> ctx.1
echo         ImageDirectory "Earth Normal"> ctx.2
echo         BaseSplit 0> ctx.3
echo         TileSize 1024> ctx.4
echo         TileType "dxt5nm"> ctx.5
echo }> ctx.6

type ctx.1 > type ctx.2 > type ctx.3 > type ctx.4 > type ctx.5 > ctx.6 > "Earth Normal.ctx"
del ctx.*
rem
goto end

:png
cls
echo.
echo.
echo This will generate a set VT's in PNG format Normalmaps from level 0 to level 5.
echo (904.969.477 bytes)
echo.
echo.
echo Preparing 64k RAW image from Nasa - srtm_ramp2.world.86400x43200.bin.gz.
echo.

echo on
gzip -dc < srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 > world64k.bin
@echo off

echo.
echo Halfsize RAW file, 64k to 32k image.
echo.

echo on
halfsize 65536 < world64k.bin > world32k.bin
@echo off

echo.
echo Generating PNG level 5 tiles.
echo.

echo on
nmstiles 5 6378.140 65536 2.5 < world64k.bin
nconvert -out png *.ppm
@echo off

del /q world64k.bin
del /q *.ppm

echo.
echo Moving PNG level 5 tiles to Earth Normal.
mkdir "Earth Normal"
mkdir level5
move *.png level5
move level5 "Earth Normal"

echo.
echo Halfsize RAW file, 32k to 16k image.
echo.

echo on
halfsize 32768 < world32k.bin > world16k.bin
@echo off

echo.
echo Generating PNG level 4 tiles.
echo.

echo on
nmstiles 4 6378.140 32768 2.5 < world32k.bin
nconvert -out png *.ppm
@echo off

del /q world32k.bin
del /q *.ppm

echo.
echo Moving PNG level 4 files to Earth Normal.
mkdir level4
move *.png level4
move level4 "Earth Normal"

echo.
echo Halfsize RAW file, 16k to 8k image.
echo.

echo on
halfsize 16384 < world16k.bin > world8k.bin
@echo off

echo.
echo Generating PNG level 3 tiles.
echo.

echo on
nmstiles 3 6378.140 16384 2.5 < world16k.bin
nconvert -out png *.ppm
@echo off

del /q world16k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 3 tiles to Earth Normal.
mkdir level3
move *.png level3
move level3 "Earth Normal"

echo.
echo Halfsize RAW file, 8k to 4k image.
echo.

echo on
halfsize 8192 < world8k.bin > world4k.bin
@echo off

echo.
echo Generating PNG level 2 tiles.
echo.

echo on
nmstiles 2 6378.140 8192 2.5 < world8k.bin
nconvert -out png *.ppm
@echo off

del /q world8k.bin
del /q *.ppm

echo.
echo Moving PNG level 2 tiles to Earth Normal.
mkdir level2
move *.png level2
move level2 "Earth Normal"

echo.
echo Halfsize RAW file, 4k to 2k image.
echo.

echo on
halfsize 4096 < world4k.bin > world2k.bin
@echo off

echo.
echo Generating PNG level 1 tiles.
echo.

echo on
nmstiles 1 6378.140 4096 2.5 < world4k.bin
nconvert -out png *.ppm
@echo off

del /q world4k.bin
del /q *.ppm

echo.
echo Moving PNG level 1 tiles to Earth Normal.
mkdir level1
move *.png level1
move level1 "Earth Normal"

echo.
echo Generating dxt5nm level 0 tiles.
echo.

echo on
nmstiles 0 6378.140 2048 2.5 < world2k.bin
nconvert -out png *.ppm
@echo off

del /q world2k.bin
del /q *.ppm

echo.
echo Moving PNG level 0 tiles to Earth Normal.
mkdir level0
move *.png level0
move level0 "Earth Normal"

echo.
echo Generating directory structure.
echo.

move "Earth Normal" hires

rem Generating the ctx file for PNG tiles.
echo VirtualTexture {> ctx.1
echo         ImageDirectory "Earth Normal"> ctx.2
echo         BaseSplit 0> ctx.3
echo         TileSize 1024> ctx.4
echo         TileType "png"> ctx.5
echo }> ctx.6

type ctx.1 > type ctx.2 > type ctx.3 > type ctx.4 > type ctx.5 > ctx.6 > "Earth Normal.ctx"
del ctx.*
rem

:end
mkdir hires
move "Earth Normal.ctx" hires

mkdir textures
move hires textures

mkdir Earth
move textures Earth

rem Generating the ssc file.
echo AltSurface "Earth" "Sol/Earth" {> ssc.1
echo    NormalMap "Earth Normal.ctx"> ssc.2
echo }> ssc.3

type ssc.1 > type ssc.2 > type ssc.3 > Earth.ssc
del ssc.*
rem

move Earth.ssc Earth

echo.
echo VT's successfully generated.
echo.
echo done!
prompt $p$g

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

Post #104by t00fri » 20.04.2007, 12:34

Hi Anders,

GREAT! Many thanks for your efforts.

So now...perhaps...perhaps...Even Daniel wil become a happy owner of
a super-quality-monster-sized-incredibly-optimized NORMALMAP VT set ;-)

Cheers,
Fridger
Image

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #105by tech2000 » 20.04.2007, 14:57

t00fri wrote:Hi Anders,

GREAT! Many thanks for your efforts.

So now...perhaps...perhaps...Even Daniel wil become a happy owner of
a super-quality-monster-sized-incredibly-optimized NORMALMAP VT set ;-)

Cheers,
Fridger


It would be cool to add txtools to this too...
:wink:

So Daniel, save the script to vtgen.bat and copy it to c:, install gzip, nvdxt (for dxt5nm tiles), nconvert (for PNG tiles) & nmtools. Be sure to have srtm_ramp2.world.86400x43200.bin.gz in c: and open a cli-promt.

c:>vtgen.bat

move directory c:\Earth to "c:\program files\celestia\extras" depending on your instalation...

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #106by danielj » 20.04.2007, 14:59

Thanks,but I have to download all the file AGAIN.
Actually,what??s a cli-promt?

tech2000 wrote:
t00fri wrote:Hi Anders,

GREAT! Many thanks for your efforts.

So now...perhaps...perhaps...Even Daniel wil become a happy owner of
a super-quality-monster-sized-incredibly-optimized NORMALMAP VT set ;-)

Cheers,
Fridger

It would be cool to add txtools to this too...
:wink:

So Daniel, save the script to vtgen.bat and copy it to c:, install gzip, nvdxt (for dxt5nm tiles), nconvert (for PNG tiles) & nmtools. Be sure to have srtm_ramp2.world.86400x43200.bin.gz in c: and open a cli-promt.

c:>vtgen.bat

move directory c:\Earth to "c:\program files\celestia\extras" depending on your instalation...

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #107by tech2000 » 20.04.2007, 15:08

danielj wrote:Thanks,but I have to download all the file AGAIN.
Actually,what??s a cli-promt?


A DOS promt. CLI=Command Line Interface. I really don't know how to explain it any further.

Bye, Anders

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

Post #108by Fightspit » 20.04.2007, 15:12

A screenshot would be saying more than 1000 words :wink:

Here a "cli-promp"t or as know as "cmd":

Image
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

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #109by tech2000 » 20.04.2007, 15:17

Fightspit wrote:A screenshot would be saying more than 1000 words :wink:


Ofcourse it does, thank you..

Bye, Anders

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

Post #110by Fightspit » 20.04.2007, 15:20

I made in this topic (especially for danielj :wink:) at third page a small "tutorial" for using the "cmd" .

Content:

In DOS, to change directory is :

Code: Select all

cd yourfolder

Exemple: you are at C:\Documents and Settings\User and you want go to My Document, you just type:

Code: Select all

cd "My Document"


Note: If your folder name has a space, you must put a "..."

Also, instead of doing several cd you can put a \ after your folder like this:

Code: Select all

cd "My Document\folder1\folder2\...\folder26" and so on...


And more, you can press several time on tab (tabulation) after typing cd to chose several folder that you can go to.
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

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #111by danielj » 20.04.2007, 15:39

Ok,ok,but when can I download the file?
The NASA Arctic Server seem to be down...

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

Post #112by Fightspit » 20.04.2007, 15:43

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

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #113by tech2000 » 20.04.2007, 22:09

There are some small changes in this. Mainly better information.

vtgen.bat

Code: Select all

prompt $g
cls
@echo off
echo ---------------------------------------------------------------------------------------
echo.
echo    This script will generate an awesome set of dxt5nm / PNG normalmaps for Celestia.
echo.
echo ---------------------------------------------------------------------------------------
echo.
echo  This script need the following programs installed or present in the same directory as
echo  this batch file for generating the tiles.
echo.
echo      gzip   -   nmstiles   -   resc2pow2   -   halfsize   -   nvdxt   -   nconvert
echo.
echo  and ofcourse the RAW image to generate the tiles from.
echo  http://snowy.arsc.alaska.edu/nasa/nasa/topography/srtm_ramp2.world.86400x43200.bin.gz
echo.
echo ---------------------------------------------------------------------------------------
echo.
echo                Please select what kind of tiles you want to generate.
echo.
echo                        1: dxt5nm tiles     or     2: PNG tiles
echo.
echo ---------------------------------------------------------------------------------------
choice /c 12 /N /m "Your choice:"
goto answer%errorlevel%

:answer1
cls
echo.
echo.
echo This will generate a set VT's in dxt5nm format Normalmaps from level 5 to level 0.
echo (1.480.691.760 bytes)
echo.
echo.
echo Preparing 64k RAW image from Nasa - srtm_ramp2.world.86400x43200.bin.gz.
echo.
echo --------------------------------------------------------------------------------------
echo on
gzip -dc < srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 > world64k.bin
@echo off

echo.
echo Halfsize RAW file, 64k to 32k image.
echo.

echo on
halfsize 65536 < world64k.bin > world32k.bin
@echo off

echo.
echo Generating dxt5nm level 5 tiles.
echo.

echo on
nmstiles 5 6378.140 65536 2.5 < world64k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world64k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 5 tiles to Earth Normal.
mkdir "Earth Normal"
mkdir level5
move *.dxt5nm level5
move level5 "Earth Normal"

echo.
echo Halfsize RAW file, 32k to 16k image.
echo.

echo on
halfsize 32768 < world32k.bin > world16k.bin
@echo off

echo.
echo Generating dxt5nm level 4 tiles.
echo.

echo on
nmstiles 4 6378.140 32768 2.5 < world32k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world32k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 4 files to Earth Normal.
mkdir level4
move *.dxt5nm level4
move level4 "Earth Normal"

echo.
echo Halfsize RAW file, 16k to 8k image.
echo.

echo on
halfsize 16384 < world16k.bin > world8k.bin
@echo off

echo.
echo Generating dxt5nm level 3 tiles.
echo.

echo on
nmstiles 3 6378.140 16384 2.5 < world16k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world16k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 3 tiles to Earth Normal.
mkdir level3
move *.dxt5nm level3
move level3 "Earth Normal"

echo.
echo Halfsize RAW file, 8k to 4k image.
echo.

echo on
halfsize 8192 < world8k.bin > world4k.bin
@echo off

echo.
echo Generating dxt5nm level 2 tiles.
echo.

echo on
nmstiles 2 6378.140 8192 2.5 < world8k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world8k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 2 tiles to Earth Normal.
mkdir level2
move *.dxt5nm level2
move level2 "Earth Normal"

echo.
echo Halfsize RAW file, 4k to 2k image.
echo.

echo on
halfsize 4096 < world4k.bin > world2k.bin
@echo off

echo.
echo Generating dxt5nm level 1 tiles.
echo.

echo on
nmstiles 1 6378.140 4096 2.5 < world4k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world4k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 1 tiles to Earth Normal.
mkdir level1
move *.dxt5nm level1
move level1 "Earth Normal"

echo.
echo Generating dxt5nm level 0 tiles.
echo.

echo on
nmstiles 0 6378.140 2048 2.5 < world2k.bin
nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm
@echo off

ren *.dds *.dxt5nm
del /q world2k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 0 tiles to Earth Normal.
mkdir level0
move *.dxt5nm level0
move level0 "Earth Normal"

echo.
echo Generating directory structure.
echo.

move "Earth Normal" hires

rem Generating the ctx file for dxt5nm tiles.
echo VirtualTexture {> ctx.1
echo         ImageDirectory "Earth Normal"> ctx.2
echo         BaseSplit 0> ctx.3
echo         TileSize 1024> ctx.4
echo         TileType "dxt5nm"> ctx.5
echo }> ctx.6

type ctx.1 > type ctx.2 > type ctx.3 > type ctx.4 > type ctx.5 > ctx.6 > "Earth Normal.ctx"
del ctx.*
rem Done generating ctx file.
goto end

:answer2
cls
echo.
echo.
echo This will generate a set VT's in PNG format Normalmaps from level 5 to level 0.
echo (904.969.477 bytes)
echo.
echo.
echo Preparing 64k RAW image from Nasa - srtm_ramp2.world.86400x43200.bin.gz.
echo.
echo --------------------------------------------------------------------------------------
echo on
gzip -dc < srtm_ramp2.world.86400x43200.bin.gz | resc2pow2 86400 1 > world64k.bin
@echo off

echo.
echo Halfsize RAW file, 64k to 32k image.
echo.

echo on
halfsize 65536 < world64k.bin > world32k.bin
@echo off

echo.
echo Generating PNG level 5 tiles.
echo.

echo on
nmstiles 5 6378.140 65536 2.5 < world64k.bin
nconvert -out png *.ppm
@echo off

del /q world64k.bin
del /q *.ppm

echo.
echo Moving PNG level 5 tiles to Earth Normal.
mkdir "Earth Normal"
mkdir level5
move *.png level5
move level5 "Earth Normal"

echo.
echo Halfsize RAW file, 32k to 16k image.
echo.

echo on
halfsize 32768 < world32k.bin > world16k.bin
@echo off

echo.
echo Generating PNG level 4 tiles.
echo.

echo on
nmstiles 4 6378.140 32768 2.5 < world32k.bin
nconvert -out png *.ppm
@echo off

del /q world32k.bin
del /q *.ppm

echo.
echo Moving PNG level 4 files to Earth Normal.
mkdir level4
move *.png level4
move level4 "Earth Normal"

echo.
echo Halfsize RAW file, 16k to 8k image.
echo.

echo on
halfsize 16384 < world16k.bin > world8k.bin
@echo off

echo.
echo Generating PNG level 3 tiles.
echo.

echo on
nmstiles 3 6378.140 16384 2.5 < world16k.bin
nconvert -out png *.ppm
@echo off

del /q world16k.bin
del /q *.ppm

echo.
echo Moving dxt5nm level 3 tiles to Earth Normal.
mkdir level3
move *.png level3
move level3 "Earth Normal"

echo.
echo Halfsize RAW file, 8k to 4k image.
echo.

echo on
halfsize 8192 < world8k.bin > world4k.bin
@echo off

echo.
echo Generating PNG level 2 tiles.
echo.

echo on
nmstiles 2 6378.140 8192 2.5 < world8k.bin
nconvert -out png *.ppm
@echo off

del /q world8k.bin
del /q *.ppm

echo.
echo Moving PNG level 2 tiles to Earth Normal.
mkdir level2
move *.png level2
move level2 "Earth Normal"

echo.
echo Halfsize RAW file, 4k to 2k image.
echo.

echo on
halfsize 4096 < world4k.bin > world2k.bin
@echo off

echo.
echo Generating PNG level 1 tiles.
echo.

echo on
nmstiles 1 6378.140 4096 2.5 < world4k.bin
nconvert -out png *.ppm
@echo off

del /q world4k.bin
del /q *.ppm

echo.
echo Moving PNG level 1 tiles to Earth Normal.
mkdir level1
move *.png level1
move level1 "Earth Normal"

echo.
echo Generating dxt5nm level 0 tiles.
echo.

echo on
nmstiles 0 6378.140 2048 2.5 < world2k.bin
nconvert -out png *.ppm
@echo off

del /q world2k.bin
del /q *.ppm

echo.
echo Moving PNG level 0 tiles to Earth Normal.
mkdir level0
move *.png level0
move level0 "Earth Normal"

echo.
echo Generating directory structure.
echo.

move "Earth Normal" hires

rem Generating the ctx file for PNG tiles.
echo VirtualTexture {> ctx.1
echo         ImageDirectory "Earth Normal"> ctx.2
echo         BaseSplit 0> ctx.3
echo         TileSize 1024> ctx.4
echo         TileType "png"> ctx.5
echo }> ctx.6

type ctx.1 > type ctx.2 > type ctx.3 > type ctx.4 > type ctx.5 > ctx.6 > "Earth Normal.ctx"
del ctx.*
rem Done generating ctx file.

:end
mkdir hires
move "Earth Normal.ctx" hires

mkdir textures
move hires textures

mkdir Earth
move textures Earth

rem Generating the ssc file.
echo AltSurface "Earth" "Sol/Earth" {> ssc.1
echo    NormalMap "Earth Normal.ctx"> ssc.2
echo }> ssc.3

type ssc.1 > type ssc.2 > type ssc.3 > Earth.ssc
del ssc.*
rem Done generating ssc file.

move Earth.ssc Earth

echo.
echo VT's successfully generated.
echo.
echo done!
prompt $p$g

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #114by danielj » 20.04.2007, 23:21

It simply say that "vtgen.bat" is not a recognizable program.Neither is nmtools.
I have nmtools-1.0.1,DDS Utilities and XNView in C:\Program Files
The bin file is also in C:\Program Files.
What could be possible did wrong?

I didn??t have any vtgen.bat.I simply copied to Wordpad and named it vtgen.bat

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #115by tech2000 » 20.04.2007, 23:51

danielj wrote:It simply say that "vtgen.bat" is not a recognizable program.Neither is nmtools.
I have nmtools-1.0.1,DDS Utilities and XNView in C:\Program Files
The bin file is also in C:\Program Files.
What could be possible did wrong?

I didn??t have any vtgen.bat.I simply copied to Wordpad and named it vtgen.bat


Make it easy on yourself, copy all this files to c:\vtgen

gzip.exe
halfsize.exe
nconvert.exe
nms.exe
nmstiles.exe
nvdxt.exe
resc2pow2.exe
srtm_ramp2.world.86400x43200.bin.gz
vtgen.bat

Open CLI promt and navigate yourself to c:\vtgen\ where you already have stored away the list of files..

c:\vtgen> vtgen

Or the easiest way of them all: navigate with windows explorer to c:/vtgen/vtgen.bat and double click it...

Best of luck... You can't fail this time.

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #116by danielj » 21.04.2007, 02:09

Almost there,but there is something missing.In the vtgen folder,I have gzip.exe,nconvert.exe,nmstiles.exe,halfsize.exe,nms.exe,nvdxt.exe and the file "srtm_ramp2.world.86400x43200.bin".
Then,after I typed c:\program files\vtgen>vtgen,it appears the 2 choices:1.dxt5nm tiles and 2:PNG tiles

But immediatly after that,the prompt said that "the command choice is not an external or internal command,operational program or an archive in batches.The system cannot find the tag in the specified batch-answer 9009"

What??s wrong now?

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #117by tech2000 » 21.04.2007, 02:16

danielj wrote:"srtm_ramp2.world.86400x43200.bin"


I really hope you mean: srtm_ramp2.world.86400x43200.bin.gz

Bye.

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #118by danielj » 21.04.2007, 02:19

NO,I mean .bin.
Oh,no.Maybe the problem is that I shouldn??t unzipped and because of this,the script went crazy?

tech2000 wrote:
danielj wrote:"srtm_ramp2.world.86400x43200.bin"

I really hope you mean: srtm_ramp2.world.86400x43200.bin.gz

Bye.

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #119by danielj » 21.04.2007, 02:27

I substitute the .bin file for the bin.gz,but the SAME answer 9009 showed up.
So,I think there are 2 possibilities:I copied the vtgen script in the wrong form or there is something wrong with my Windows XP prompt.If it is the latter case,there is nothing I can do at all...

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

Post #120by bh » 21.04.2007, 07:58

Great stuff!
regards...bh.


Return to “Celestia Users”