grendizerufo / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

imgdiff doesn't process correctly normalmaps #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
look in imgdiff.cpp at line 116: void addSample(nv::Color32 o, nv::Color32 c)

the two normals "vo" and "vc" are not extracted correctly from colors.
the correct behavior should have been:
x=red*alpha
y=green
z=sqrt(1-x*x-y*y)

Original issue reported on code.google.com by marcoalt...@gmail.com on 11 Mar 2009 at 3:02

GoogleCodeExporter commented 9 years ago
addSample assumes that the normal has been decompressed and is encoded as a RGB
color. Decompression happens in loadImage. The DirectDrawSurface will detect 
normal
maps if the file was saved with the normal map flag. If the normal map flag was 
not
set, you can set it explicitly. See for example line 144 of decompress.cpp.

Closing as invalid.

Original comment by cast...@gmail.com on 18 Mar 2009 at 6:05