I am currently trying to scale down a texture pack for Quake to make it available as a smaller download (and for people with less than 1GB video cards - yeah, it's that big, 3.2GB of textures for
Quake, it even runs out of address space on Windows XP 32bit when used uncompressed).
Now, the problem comes when resizing the normalmap textures, where color and alpha are independent properties; RGB indicates surface angle, and alpha indicates height of displacement for reliefmapping
(a per-pixel raytracing shader that mushes the texture around as if it was an irregular surface, like making bricks 'stand out' from the wall on a brick wall texture).
Currently ImageMagick will do weighted filtering to try to preserve the color around a transparent area (behavior designed to prevent the "Halo Bug"), tragically in the case of this RGBA texture data
this color bleeding is not desired, and even worse the fully transparent pixels (fully 'deep' in the reliefmapping sense) are replaced by black, which is a completely erroneous surface direction.
My engine does resizing of such images for mipmapping (smaller versions of a texture used by the graphics hardware for walls further away from the viewer), and I am quite familiar with all issues in
this matter.
So what I am asking for is at least a -filter Box variant that preserves independent channels (Box works quite sufficiently for 50% scale-downs like this), if not a full-blown option to treat all
channels as independent.
I read the suggestion of -channel RGBA -separate -combine stuff in the
aforementioned thread, but even this seems kind of hacky when it is simply a
flag for a behavioral change that is desired.
As I do not expect anything significant to be done about this in the near
future I will have to write my own utility to process this texture pack.
I mention this issue on the mailing list because more and more game art (far more than just my engine) is using independent channels for special purposes, for example glossmaps (the reflected light
color of a surface - for example white on a plastic material, but yellow on a gold material) are beginning to use the alpha channel for specularity (hardness of the reflected light, I.E. hotspot
size), and skin shaders often use multiple channels such as vein masks under the skin, transparency of the skin surface, subsurface scattering hints, and other properties, which get packed into one
image and require this kind of channel processing.
--
LordHavoc
Author of DarkPlaces Quake1 engine and mod
http://icculus.org/twilight/darkplaces/
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo."
- James Klass
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users