|
From: Roger H. <rog...@mi...> - 2007-05-11 11:27:39
|
On 11 May, 2007, at 00:08, James Walker wrote: > 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. You mean the interactive renderers in Quesa and QuckDraw3D are different? > > 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. Er, maybe I'm being thick (as usual), but alpha==0 means transparent, alpha ==1.0 (or 0xFF) means opaque. What's to not understand? > > 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. Sounds like a good idea to me, data can be imported into my programs so if you are going to support two types of alpha data, then the type needs to be bound to the data, how else could I render an image with a mixture of pre-multiplied and non pre-multiplied textures on many objects, pixmap markers, foreground and background images. When was the concept of pre-multiplied alpha invented? After QuickDraw3D? We should try to make existing data files to appear the same by default whenever possible. Roger. |