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 #161by tech2000 » 26.04.2007, 00:25

danielj wrote:IT WASN??T TO REDOWLOAD vtgen.bat.
Now it??s not working anymore...

Relax Daniel. I'll have it out in a few minutes..

Anders

edit: vtgen.bat is updated.

Download here:
vtgen.bat

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

Sucess at least

Post #162by danielj » 26.04.2007, 02:41

After 2h40,I finnaly get all the levels and ctx generated.
What computer do you have ,Fridger.The only thing I remember is that ou have 3 GB.This make a huge difference to work with very big textures.
But about the images;it got dissapointing:
http://img217.imageshack.us/my.php?imag ... lemyz6.jpg
I am using Celestia the new normal map in Celestia 1.4.1.As soon as I put the normal map in the Extras folder,the alternate textures disappeared.I "forced",changing the solarsys.ssc and this is the result...

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

Re: Sucess at least

Post #163by danielj » 26.04.2007, 02:52

The path is BMNG>BMNG.ctx
BMNG>textures>hires>BMNG.ctx,BMNG_spec.ctx and Earth Normal.ctx
BMNG>textures>hires>BMNG
>BMNG_spec
>Earth Normal
BMNG>textures>hires>Earth Normal>hires>level 0-5

The code in BMNG.ssc:
AltSurface "64K Blue Marble Next Generation" "Sol/Earth"
{
Texture "BMNG.ctx"
NormalMap "Earth Normal.ctx
SpecularTexture "BMNG_spec.ctx"
HazeColor [ 1 1 1 ]
HazeDensity 0.25
SpecularColor [ 0.5 0.5 0.55 ]
SpecularPower 20.0
}



I forgot the code(solarsys.ssc):

"Earth" "Sol"
{
Texture "BMNG.ctx"
NightTexture "earthnight.*"

SpecularTexture "BMNG_spec.ctx"
Color [ 0.85 0.85 1.0 ]
SpecularColor [ 0.5 0.5 0.55 ]
SpecularPower 25.0
HazeColor [ 1 1 1 ]
HazeDensity 0.3
Radius 6378.140 # equatorial
# Oblateness 0.0034

Normalmap "Earth Normal.ctx"

Atmosphere {
Height 60
Lower [ 0.43 0.52 0.65 ]
Upper [ 0.26 0.47 0.84 ]
Sky [ 0.40 0.6 1.0 ]
Sunset [ 1.0 0.6 0.2 ]
# Sunset [ 0.3 1.0 0.5 ]
CloudHeight 12
CloudSpeed 0
CloudMap "clouds-121303-8k.dds"
}

CustomOrbit "vsop87-earth"
EllipticalOrbit {
Period 1.0000
SemiMajorAxis 1.0000
Eccentricity 0.0167
Inclination 0.0001
AscendingNode 348.739
LongOfPericenter 102.947
MeanLongitude 100.464
}

RotationPeriod 23.9344694 # 23.93419
Obliquity -23.45
RotationOffset 280.5 # offset at default epoch J2000

Albedo 0.30
}

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

BMNG in Blue Marble DDS

Post #164by danielj » 26.04.2007, 03:10


steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: BMNG in Blue Marble DDS

Post #165by steffens » 26.04.2007, 06:49


Congratulations, you've got a working normal map! You never thought you would, did you :wink:
The strange image of "wet islands" is a result of the specular map texture having a much lower resolution than the normal map. In the spec map, there are no islands, everything is water!
Now that we have this great normal map (thanks again to t00fri for his tools!), it's time to create a corresponding surface and spec texture. I can't wait to get my hands on txtools :lol:

steffens

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: Sucess at least

Post #166by steffens » 26.04.2007, 06:56

By the way...
danielj wrote:The code in BMNG.ssc:
AltSurface "64K Blue Marble Next Generation" "Sol/Earth"
{
Texture "BMNG.ctx"
NormalMap "Earth Normal.ctx
SpecularTexture "BMNG_spec.ctx"
HazeColor [ 1 1 1 ]
HazeDensity 0.25
SpecularColor [ 0.5 0.5 0.55 ]
SpecularPower 20.0
}


I forgot the code(solarsys.ssc):

"Earth" "Sol"
{
Texture "BMNG.ctx"
NightTexture "earthnight.*"

[---snip---]

Why do you change solarsys.ssc when you already defined an AltSurface for Earth? One of both would be sufficient, depending upon whether you would like the new texture to be the default or just selectable whenever wanted.

steffens

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

Re: Sucess at least

Post #167by t00fri » 26.04.2007, 08:41

danielj wrote:I am using Celestia the new normal map in Celestia 1.4.1.

Daniel,

since I am very busy, I did not follow in detail this "endless saga" of normalmap generation ;-).

But whenever I have a quick look, I see a lot of incorrect things going on. It seems you are always making the wrong choices if some have to be made...

Just a few things that struck my eye:

1) There was the option in the script by Anders between .dxt5nm and .png format for the nm tiles..

But OF COURSE, if you are still taking the outdated Celestia 1.4.1 version, .dxt5nm is NOT YET supported! I guess everyone was naturally assuming that you are using some pre1.5.0 Celelstia version since long.

2) Chris' 1.4.1 code for VT display also had some BAD bugs, leading to a strong instability and black regions with big-size tile sets. This is also fixed in pre1.5.0

3) When using the NVIDIA command-line tools, one has to be very careful. DXt5nm format involves a mapping of the red OR the green nm channel to the alpha channel. There is some confusion going on here, however:

-- Chris originally mapped the green channel to alpha, at a time when the old nvdxt tool still used red->alpha mapping. Meanwhile, the new NVIDIA DXT tools also use green->alpha mapping. However, these tools have a different set of parameters and a different name (nvcompress!). Hence using the wrong dxt5nm convention in the dxt5nm compression will give bad results, of course.

4)
danielj wrote:But about the images;it got dissapointing:
http://img217.imageshack.us/my.php?imag ... lemyz6.jpg
This is clearly YOUR problem and is NOT related to my code or Anders' script. I guess you also found your mistake, meanwhile.

5)
danielj wrote:What computer do you have ,Fridger.The only thing I remember is that ou have 3 GB.This make a huge difference to work with very big textures.

Another completely incorrect statement in case of my normalmap generation code. If you watch any tool displaying the memory consumption while my nmtiles program is at work, you will notice that memory consumption is VERY low. I have programmed things precisely such that only 1-2 lines of the big texture is read into memory at a time. So little memory is required for full-speed operation.

6)
danielj wrote:After 2h40,I finnaly get all the levels and ctx generated.

The reason for why it took you so long, was probably the use of the nvdxt tools, which are known to be VERY slow. It has NOTHING to do with my larger amount of memory or my nmtools code.

Since --given your use of the OLD Celestia 1.4.1-- only .png format is possible, you should use instead nconvert (XnView) to transform the .ppm tiles into .png format. Nconvert is VERY, VERY fast...

7)

You displayed images are really not good. Probably a number of the mistakes I listed above collaborated to make the result bad. Clearly, one also needs a well-matching 64k 'base' and >=32k 'spec' texture.
Fightspit's 64k base texture is unfortunately not very good and has some unclear pixel shifts.... If you use a smaller size than 64k for the base texture, the overall result will also be disappointing.


Bye Fridger
Image

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: Sucess at least

Post #168by steffens » 26.04.2007, 09:59

t00fri wrote:3) When using the NVIDIA command-line tools, one has to be very careful. DXt5nm format involves a mapping of the red OR the green nm channel to the alpha channel. There is some confusion going on here, however:

-- Chris originally mapped the green channel to alpha, at a time when the old nvdxt tool still used red->alpha mapping. Meanwhile, the new NVIDIA DXT tools also use green->alpha mapping. However, these tools have a different set of parameters and a different name (nvcompress!). Hence using the wrong dxt5nm convention in the dxt5nm compression will give bad results, of course.

What is the mapping currently used in CVS Celestia? I thought it was matching the old nvdxt tools, but I couldn't find a definitive message about this.

steffens

[Edit]:
t00fri, this is what you suggested in your nmtools tutorial:

Code: Select all

nvdxt -quality_highest -file *.ppm -nomipmap -dxt5nm

Does this still apply?
Last edited by steffens on 26.04.2007, 12:16, edited 2 times in total.

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

Post #169by Fightspit » 26.04.2007, 11:47

Danielj,

Try with a blank white) texture :wink:
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 #170by tech2000 » 26.04.2007, 12:17

Daniel: now that you got the slightest idea of how it works, keep doing more normalmaps and try to read yourself through the script to really understand what the script does.

If done, the knowledge gained from knowing what the script really does will later help you to be able to do what ever tiles you want with Fridger's tools. That would be good to keep in mind for the txtools release... You do want surface textures too right..?

Best regards, Anders

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

Re: Sucess at least

Post #171by t00fri » 26.04.2007, 12:35

steffens wrote:
t00fri wrote:3) When using the NVIDIA command-line tools, one has to be very careful. DXt5nm format involves a mapping of the red OR the green nm channel to the alpha channel. There is some confusion going on here, however:

-- Chris originally mapped the green channel to alpha, at a time when the old nvdxt tool still used red->alpha mapping. Meanwhile, the new NVIDIA DXT tools also use green->alpha mapping. However, these tools have a different set of parameters and a different name (nvcompress!). Hence using the wrong dxt5nm convention in the dxt5nm compression will give bad results, of course.
What is the mapping currently used in CVS Celestia? I thought it was matching the old nvdxt tools, but I couldn't find a definitive message about this.

steffens


Here is the definite CVS message, concerning a very small change in shadermanager.cpp
-------------------------Revision 1.45--------Oct 21, 2006------
Chris: "Changed mapping of compressed normal map components to match convention: x -> alpha, y -> green"
-----------------------------------------------------------------
so it's now r->alpha corresponding to the OLD NV commandline tools. This would be in conflict with the new, much better quality compression tool nvcompress. Since the latter is OpenSource, I always adapt my mapping to Chris' momentary code ;-) . I suppose Chris would want to return to his original g->alpha scheme, since also the quality becomes somewhat better (since green gets an extra bit of precision in the DXT5 compression = 5(r)6 (g)5 (b) )

Bye Fridger
Image

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: Sucess at least

Post #172by steffens » 26.04.2007, 12:47

t00fri wrote:Here is the definite CVS message, concerning a very small change in shadermanager.cpp
-------------------------Revision 1.45--------Oct 21, 2006------
Chris: "Changed mapping of compressed normal map components to match convention: x -> alpha, y -> green"
-----------------------------------------------------------------
so it's now r->alpha corresponding to the OLD NV commandline tools. This would be in conflict with the new, much better quality compression tool nvcompress. Since the latter is OpenSource, I always adapt my mapping to Chris' momentary code ;-) . I suppose Chris would want to return to his original g->alpha scheme, since also the quality becomes somewhat better (since green gets an extra bit of precision in the DXT5 compression = 5(r)6 (g)5 (b) )

Bye Fridger

OK, thanks for clarifying that.
In this case, the conversion to dxt5nm that is performed by the script should be correct (for now), as it is using the old tool.

steffens

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

Post #173by danielj » 26.04.2007, 12:53

Another thing.Maybe the normal map matches the BMNG better than the Blue Marble DDS.What do you think?

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

Post #174by t00fri » 26.04.2007, 13:30

danielj wrote:Another thing.Maybe the normal map matches the BMNG better than the Blue Marble DDS.What do you think?


The base texture MUST be 64k BMNG (VT's).

Bye Fridger
Image

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

Post #175by danielj » 26.04.2007, 16:51

Oh,no!Now I remember.Earth VTs (in DDS format) DON??T work very well with Celestia 1.5.0 pre2.I put it in Extras,the program EVEN load BMNG.ssc,but CAN??T find it.
I should have done the normalmap in png tiles!!
You should be working because you compile your versions of Celestia pre.
Mars VT works,but it is in PNG format.
So I have to do it AGAIN or wait for Celestia 1.5.0 pre3 or later...


t00fri wrote:
danielj wrote:Another thing.Maybe the normal map matches the BMNG better than the Blue Marble DDS.What do you think?

The base texture MUST be 64k BMNG (VT's).

Bye Fridger

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

Re: BMNG in Blue Marble DDS

Post #176by t00fri » 26.04.2007, 18:38

steffens wrote:
...
Now that we have this great normal map (thanks again to t00fri for his tools!), it's time to create a corresponding surface and spec texture. I can't wait to get my hands on txtools :lol:

steffens


Would you be interested to test my txtools?? It's all ready, waiting for the MAC part. But there won't be much of an instruction. There is also a much improved specmap generation...

Of course, it is to be understood that the tools remain PRIVATE for the time being!

What OS do you use? Win32?

Bye Fridger
Image

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

Post #177by danielj » 26.04.2007, 23:27

The BMNG DON??T work in Celestia 1.5.0 pre2.I will try in Celestia 1.4.1.
I generated the VT textures in PNG format in less than 2 hours,now.

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

Post #178by danielj » 27.04.2007, 01:33

Well,BMNG WORKS in Celestia 1.5.0pre2,albeit very slow.
I was wondering.Maybe 1 GB of RAM and 256 MB of video memory is NOT ENOUGH to handle this huge textures:BMNG,BMNG NM and more one or two textures.Maybe I have found the limit of my computer...

steffens
Posts: 162
Joined: 06.11.2003
With us: 21 years
Location: RP Germany

Re: BMNG in Blue Marble DDS

Post #179by steffens » 27.04.2007, 06:58

t00fri wrote:
steffens wrote:...
I can't wait to get my hands on txtools :lol:
steffens
Would you be interested to test my txtools?? It's all ready, waiting for the MAC part. But there won't be much of an instruction. There is also a much improved specmap generation...
Absolutely :!:
Recently I've got a new computer and I need something to heavily load it :lol:
I don't think I'll need a lot of instructions, the tools will be similar to the nmtools, I suppose? In addition, I read what's in Fridgers Column on CM.org. Much improved specmap generation sounds great to me, as my experiments have not turned out satisfactory until now...

t00fri wrote:Of course, it is to be understood that the tools remain PRIVATE for the time being!

What OS do you use? Win32?

Of course!
I'm using Linux most of the time and Win32 if I have to.

steffens

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

Post #180by t00fri » 27.04.2007, 11:24

OK, it may take a little while since I am quite busy these days. I have to first wrap up all the stuff after pausing with the tools for several weeks (waiting invain for a MAC volunteer...)


There are also several shell scripts with my distribution (Linux and Windows) that also serve as a perfect explanation of how to use the tools. Moreover, things are indeed quite analogous to the nmtools. Executing the tools without parameters also prints out a short help.

Finally, my nmtools have been tuned with Christophe's (Teyssier) various little code optimizations and now perform still a lot faster.

Bye Fridger
Image


Return to “Celestia Users”