Page 1 of 1

(#10)NormalMaps-- pitfalls

Posted: 01.09.2011, 05:24
by John Van Vliet
--- edit----

Re: NormalMaps-- pitfalls

Posted: 01.09.2011, 08:30
by t00fri
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...

Re: NormalMaps-- pitfalls

Posted: 01.09.2011, 09:43
by John Van Vliet
--- edit----

Re: NormalMaps-- pitfalls

Posted: 01.09.2011, 16:24
by t00fri
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

Re: NormalMaps-- pitfalls

Posted: 02.09.2011, 03:02
by John Van Vliet
--- edit----

Re: NormalMaps-- pitfalls

Posted: 02.09.2011, 12:42
by Fenerit
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.