|
From: Roger H. <rog...@mi...> - 2009-08-24 12:35:04
|
On 22 Aug 2009, at 17:25, James W. Walker wrote: > > On Aug 22, 2009, at 1:48 AM, Roger Holmes wrote: > >> >> On 22 Aug 2009, at 01:25, James Walker wrote: >> >>> I thought I was correctly handling transparency with multiple >>> lighting >>> passes in QORenderer::Renderer::RenderTransparent, but it turns out >>> that >>> in some cases it can be visibly incorrect. I'll try to explain a >>> simplified scenario. >>> >>> Suppose we have an nearly-opaque object with color A, and in front >>> of >>> that there is a transparent object with color B. There are 2 >>> lighting >>> passes, contributing brightnesses L and M respectively. Then the >>> resulting color value ought to be B*(L+M) + (1-alpha)*A*(L+M). >> >> For the diffuse component of the lighting, shouldn't that be >> alpha*B*(L >> +M) + (1-alpha)*A*(L+M) ? > > > I was assuming premultiplied alpha. I see. I always try to keep the alpha channel separate. The saving in time is rather small in 3D. > > >> As my renderers are pure software ones, I'm not familiar with >> glBlendFunc so cannot comment on that but maybe it supports my >> version >> of the formula. > > > Maybe your renderer doesn't have a limit of 8 lights, so you don't > need multiple passes. No limit, but to store all the shadow depth buffers I do have to use multiple passes when there is insufficient memory to store them. I also sometimes have to band the image when high resolution/large image/ anti-aliasing. Separate scan lines can be done in separate processors if available. Must do a 64 bit version sometime. > > >> The specular component is just added on, not being affected by the >> alpha. > > > > I was omitting specular for simplicity. OK. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Quesa-develop mailing list > Que...@li... > https://lists.sourceforge.net/lists/listinfo/quesa-develop |