(#10)NormalMaps-- pitfalls

All tutorials about Celestia go in here. For Celestia itself, add-ons, textures, scripting, etc.
Avatar
Topic author
John Van Vliet
Posts: 2940
Joined: 28.08.2002
With us: 21 years 9 months

(#10)NormalMaps-- pitfalls

Post #1by John Van Vliet » 01.09.2011, 05:24

--- edit----
Last edited by John Van Vliet on 18.10.2013, 10:44, edited 4 times in total.

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

Re: NormalMaps-- pitfalls

Post #2by t00fri » 01.09.2011, 08:30

John,

a few comments, perhaps. The adaptation from 16bit signed to 16bit unsigned integer input is a trivial 1-line change and thus barely worth big words. This modification has been discussed here and at CM repeatedly, and can be easily implemented by anybody knowing about the basic use of a C++ compiler.

The really strong aspect of my tools is their high speed, their optimizations and notably their memory handling that allows to deal with "monster" textures >=64k (in only about 15-20 minutes)! The gimp or NVIDIA normalmap plugins only work for much smaller "baby" sizes (<= 8k?). Also, how about LittleEndian and BigEndian machines? My tools work automatically for both (Intel PCs and certain MACs).

An important optimization concerns nm tiles that only contain parts of oceans. Since the sea is strictly flat (locally and neglecting waves ;-) ), the corresponding normalmap ( = gradient!) is monochromatic and hence can be replaced by a tiny 4x4 pixel (template) tile. Since e.g. Earth's surface consists predominantly of oceans, there are large savings indeed...

Last not least, the latest version directly outputs optionally the high-quality compressed, normalmap format .dxt5nm! Meanwhile, that format is indistinguishable visually from lossless .png, but is supported by the graphics hardware and by Celestia. This way "monster" VT sets appear "butter smooth" also on low-end computers...

Fridger

PS: my old nms and nmstile tools are about a factor of 2 slower than the more recent ones that Christophe, Dirkpitt and myself have jointly tuned with lots of tricks...
Image

Avatar
Topic author
John Van Vliet
Posts: 2940
Joined: 28.08.2002
With us: 21 years 9 months

Re: NormalMaps-- pitfalls

Post #3by John Van Vliet » 01.09.2011, 09:43

--- edit----
Last edited by John Van Vliet on 18.10.2013, 10:44, edited 2 times in total.

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

Re: NormalMaps-- pitfalls

Post #4by t00fri » 01.09.2011, 16:24

john Van Vliet wrote:
i like the ppm output for very large files. ( my personal preference )
I work on 64k and 128k maps in Nip and a png that size takes all night to load even with 8 gig ram .So a ppm works for me .

John,

you sure know that png and ppm are close relatives. The reason why the PNG output of nms (nmstiles) gives you slow loading for large file size is the fact that unlike ppm PNGs are usually highly compressed. The decompression then takes a long long time for large files!

In my nms (or nmstiles) you just modify one statement

png_set_compression_level(png, 4);

to no (or mild) compression

png_set_compression_level(png, 0);

and the loading will be fast as for ppm.

I chose png_set_compression_level(png, 4) because the level 4 is a good compromise between speed and size.

Fridger
Image

Avatar
Topic author
John Van Vliet
Posts: 2940
Joined: 28.08.2002
With us: 21 years 9 months

Re: NormalMaps-- pitfalls

Post #5by John Van Vliet » 02.09.2011, 03:02

--- edit----
Last edited by John Van Vliet on 18.10.2013, 10:44, edited 1 time in total.

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 2 months
Location: Thyrrenian sea

Re: NormalMaps-- pitfalls

Post #6by Fenerit » 02.09.2011, 12:42

john Van Vliet wrote:A thought ( i have not done this yet ) that might work
"Fictional Clouds Map" post points here
there is a possible solution to using the Photoshop nvidia plugin or the Gimp plugin on google code

John, I've linked here because its importance. I do not find clues about such issue on the GIMP's normalmap plug-in Google page.
Never at rest.
Massimo


Return to “Tutorials”