RE: [Algorithms] Depth of Field and Smoke Blurs
Brought to you by:
vexxed72
From: Willem H. de B. <Wi...@mu...> - 2002-02-28 14:47:24
|
I think you could do that. Render the scene a second time into an offscreen buffer in black (vertex colours set to 0 perhaps, although that would mean touching your vertex buffers. Maybe use a one-by-one black texture instead), with white depth-based fog. But, after you've done that, how would you go about blitting that scene into the frame buffer's destination alpha channel? I haven't done any PC stuff lately, so I don't know whether or not it's possible to mask/shift a colour channel into the destination alpha channel before blitting it.. Prolly not. The PS2 version uses some very clever hardware hacks to get the job done. Maybe you could do some clever pixel shader tricks. So instead of rendering the scene into an offscreen buffer, render it on top of the existing one and have a pixel shader shove one of the colour channels of the black+white render into the destination alpha channel of the framebuffer... This is just speculation on my behalf. I have little to no experience when it comes to pixel shader coding. Cheers, Willem MuckyFoot Goat Boy -----Original Message----- From: Garett Bass [mailto:gt...@st...] Sent: 28 February 2002 14:31 To: GDA...@li... Subject: RE: [Algorithms] Depth of Field and Smoke Blurs I'm curious, on the PC, could you create the same or similar destination alpha effect by rendering the scene into destination alpha in black (or white) with white (or black) depth-based fog? I'm thinking the color of each pixel in the range of black to white would be equivalent to z-based alpha. I'm not familiar with the workings of destination alpha, so I don't really have any idea whether this would work or whether it could be done in some usefull parallel to normal rendering to make it even feasible. Perhaps you could reduce the LOD ranges dramatically when using depth of field, or even totally alter the LOD regions to minimize the tesselation in unfocussed areas to make up for the extra draw time the effect requires? Garett Bass -----Original Message----- On PS2 we convert the zbuffer into one big 32-bit RGBA texture, and draw the 8-bit green colour component into the alpha channel of our frame- buffer [bilinear filtering off]. The green channel proved to be the most useful one for depth-of-field stuff. We then scale down our framebuffer to a quarter of its original area [half-size offscreen buffer blit with bilinear filtering on] and draw it on top of the original framebuffer with destination alpha testing on. Willem MuckyFoot Goat Boy _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 |