cartrite wrote:I can't find anything in the code from the latest cvs or official source code of nm16 that writes any data. When I compiled it and ran it all it did was print the header in the ppm file and quit.
Cartrite,
the input data are read from the STDIN file handle and the output goes to STDOUT. These filehandles are called "standard input (STDIN)" and "standard output(STDOUT)". This is a very handy setup, since one may use redirection
to (>) and
from (<) files.
eg.
nm16 <options> < elevations16bit.bin > normalmap.ppm
So the program reads from elevations16bit.bin and writes to normalmap.ppm in this example.
The best with programs using STDIN and STDOUT instead of filenames is that they may be
piped (|) together. Suppose you have a tool called 'halfsize' that reduces the size of your texture by a factor of two, then you may write e.g.
halfsize < elevations16bit.bin | halfsize | halfsize > out16bit.bin
got it?
The file out16bit.bin then only has 1/8 size of the input texture elevations16bit.bin
Unfortunately under Win32 this all works not well for
binary files. But for Linux it's wonderful!
There are hacks for Win32, however.
Bye Fridger