|
From: <jo...@st...> - 2007-05-10 23:25:46
|
On May 10, 2007, at 23:08 UTC, 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. I'd say so. :) First, you don't want to break existing software; and second, premultiplied alpha can be very useful in making (for example) "glow" effects. > 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. Hmm. That's surprising. It's been a while, of course, but I was sure that textures have worked the same way in Quesa as in QD3D from the beginning. Certainly neither I nor my artist partner (Jeff Quan) have ever noticed the difference -- and he's even written a tutorial on the proper use of premultiplied alpha. That was for Meshwork users, and was years ago, so I'd think he/we would have tested it under QD3D. > 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. That'd be OK, but for the sort of thing I've done, it would be overkill. An object property on the renderer would be fine, and a style object would be even finer. I don't see a need to be more granular than that. Most objects either need to glow, or they don't -- and it's certainly not hard to premultiply some of the textures if needed. Best, - Joe -- Joe Strout -- jo...@st... Strout Custom Solutions |