|
From: James W. <ja...@fr...> - 2007-05-10 23:09:18
|
Back in 2004, there was some discussion here about the fact that the Interactive Renderer essentially assumes that ARGB textures use premultiplied alpha, and questioning whether it ought to be an option. Yesterday I changed the OpenGL renderer to assume non-premultiplied alpha, but now I'm wondering if that was too rash. The QD3D manual doesn't seem to give any hint whether alpha should be premultiplied or not. I believe there was a claim in 2004 that QuickDraw 3D did use premultiplied alpha, but I can't confirm that today. When I loaded an ARGB texture test in Classic Geom Test, the result doesn't agree with either of our renderers. If you'd like to check it yourself, my test model is here: <ftp://ftp.frameforge3d.com/misc/texture-argbT.3dmf.zip>. It contains 2 flat TriMeshes. One is opaque and gray, another has an ARGB texture whose background has alpha = 0, color = white, intended for use as non-premultiplied. The opaque TriMesh looks transparent in Classic, which I don't understand at all. Anyway, in the previous discussion, it was suggested that the premultipled flag could be set with an object property on the renderer, or a new style object. It occurs to me now that it might make sense to set it at the level of individual textures... maybe a new pixel type constant like kQ3PixelTypeARGB32Premultiplied, maybe an object property or custom element. -- James W. Walker, Innoventive Software LLC <http://www.frameforge3d.com/> |