RE: [Algorithms] Depth of Field and Smoke Blurs
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2002-02-28 14:46:23
|
Yes, that works well. The way I did my depth-of-field effect was to render the scene a second time into a small (256x128) A8R8G8B8 texture, with the alpha channel based on the Z value using either a vertex shader, or a 1D planar-mapped texture if using the FFP. Alpha = 0 at the focus point, fading to 1 closer and further away. Then blend that texture over the main view, using the texture's alpha with a standard SRCLAPHA:INVSRCALPHA. Result - the in-focus depth is razor-sharp, and everything else is foggy. You have to be careful with alpha-blended effects, but otherwise it works well. And yes, you can use lower-LoD shapes for the render to the texture. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----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 > |