Thread: [Algorithms] volumetric spotlight
Brought to you by:
vexxed72
From: Jeff R. <je...@8m...> - 2010-03-24 16:24:19
|
Hey, anybody have any cool reference for how to render a volumetric spotlight effect? I realize that full correct shadowing with volumetric lighting might be kind of heavy duty, so I'm willing to try something a little dirtier or with no shadows. Regards, Jeff -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com |
From: Darren G. <dg...@ke...> - 2010-03-24 19:19:39
|
I don't have references but here are a few techniques in increasing complexity: For viewers at a distance it is hard to beat the simplicity of billboard sprites. Just lock a billboard to the spotlight cone axis and use alpha blending to make the texture glow. Fade it out when the viewer gets close enough to make the effect cheesy. Create an umbra mesh, a skirt that resembles the spot cone and fix it to the spotlight in space. Simple vertex coloring to fade the skirt at the far end can be very effective. Again render using alpha blending. Some simple pixel shader work using normal averaging and dot product can help to hide the edges of the mesh. If you have access to the depth buffer values, you can also fade out pixels that approach the near plane so they don't clip noticeably as the viewer passes through the cone. The most complex approach is to write a ray-casting shader that integrates over distance travelled by each eye ray through the umbra volume. It is hard to get the results to overlap and intersect correctly with the rest of the scene unless you have some sort of unified rendering architecture built around ray-casting. Very pretty if you get it working, but very difficult to deploy without limitations coming back to get you later. Cheers, Darren At 09:24 AM 3/24/2010, Jeff Russell wrote: >Hey, anybody have any cool reference for how to render a volumetric >spotlight effect? I realize that full correct shadowing with >volumetric lighting might be kind of heavy duty, so I'm willing to >try something a little dirtier or with no shadows. > >Regards, > >Jeff > > >-- >Jeff Russell >Engineer, 8monkey Labs ><http://www.8monkeylabs.com>www.8monkeylabs.com >------------------------------------------------------------------------------ >Download Intel® Parallel Studio Eval >Try the new software tools for yourself. Speed compiling, find bugs >proactively, and fine-tune applications for parallel performance. >See why Intel Parallel Studio got high marks during beta. >http://p.sf.net/sfu/intel-sw-dev >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |
From: Jeff R. <je...@8m...> - 2010-03-24 19:52:53
|
That third option is kind of what I'm leaning toward - ray tests vs a cone are mathematically simple, so that combined with a screen depth lookup (already available) I'm hoping to be able to swing something cool today. Jeff On Wed, Mar 24, 2010 at 2:19 PM, Darren Grant < dg...@ke...> wrote: > I don't have references but here are a few techniques in increasing > complexity: > > For viewers at a distance it is hard to beat the simplicity of billboard > sprites. Just lock a billboard to the spotlight cone axis and use alpha > blending to make the texture glow. Fade it out when the viewer gets close > enough to make the effect cheesy. > > Create an umbra mesh, a skirt that resembles the spot cone and fix it to > the spotlight in space. Simple vertex coloring to fade the skirt at the far > end can be very effective. Again render using alpha blending. Some simple > pixel shader work using normal averaging and dot product can help to hide > the edges of the mesh. If you have access to the depth buffer values, you > can also fade out pixels that approach the near plane so they don't clip > noticeably as the viewer passes through the cone. > > The most complex approach is to write a ray-casting shader that integrates > over distance travelled by each eye ray through the umbra volume. It is hard > to get the results to overlap and intersect correctly with the rest of the > scene unless you have some sort of unified rendering architecture built > around ray-casting. Very pretty if you get it working, but very difficult to > deploy without limitations coming back to get you later. > > > Cheers, > Darren > > > > > > At 09:24 AM 3/24/2010, Jeff Russell wrote: > > Hey, anybody have any cool reference for how to render a volumetric > spotlight effect? I realize that full correct shadowing with volumetric > lighting might be kind of heavy duty, so I'm willing to try something a > little dirtier or with no shadows. > > Regards, > > Jeff > > > -- > Jeff Russell > Engineer, 8monkey Labs > www.8monkeylabs.com > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com |
From: David N. <da...@re...> - 2010-03-24 20:13:47
|
Hi Jeff, Just shooting off an idea that may be useful, I'd imagine you could render the front facing polygons and then the back facing polygons with depth testing on. That difference in depth of the two distance the light travels through the cone at that point. You could then use that information to calculate how much light scattering has occurred. -= Dave From: Jeff Russell [mailto:je...@8m...] Sent: Wednesday, March 24, 2010 12:53 PM To: Game Development Algorithms Subject: Re: [Algorithms] volumetric spotlight That third option is kind of what I'm leaning toward - ray tests vs a cone are mathematically simple, so that combined with a screen depth lookup (already available) I'm hoping to be able to swing something cool today. Jeff On Wed, Mar 24, 2010 at 2:19 PM, Darren Grant <dg...@ke...> wrote: I don't have references but here are a few techniques in increasing complexity: For viewers at a distance it is hard to beat the simplicity of billboard sprites. Just lock a billboard to the spotlight cone axis and use alpha blending to make the texture glow. Fade it out when the viewer gets close enough to make the effect cheesy. Create an umbra mesh, a skirt that resembles the spot cone and fix it to the spotlight in space. Simple vertex coloring to fade the skirt at the far end can be very effective. Again render using alpha blending. Some simple pixel shader work using normal averaging and dot product can help to hide the edges of the mesh. If you have access to the depth buffer values, you can also fade out pixels that approach the near plane so they don't clip noticeably as the viewer passes through the cone. The most complex approach is to write a ray-casting shader that integrates over distance travelled by each eye ray through the umbra volume. It is hard to get the results to overlap and intersect correctly with the rest of the scene unless you have some sort of unified rendering architecture built around ray-casting. Very pretty if you get it working, but very difficult to deploy without limitations coming back to get you later. Cheers, Darren At 09:24 AM 3/24/2010, Jeff Russell wrote: Hey, anybody have any cool reference for how to render a volumetric spotlight effect? I realize that full correct shadowing with volumetric lighting might be kind of heavy duty, so I'm willing to try something a little dirtier or with no shadows. Regards, Jeff -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com ------------------------------------------------------------------------ ------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-lis t ------------------------------------------------------------------------ ------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-lis t -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com |
From: Bob <ma...@di...> - 2010-03-25 00:37:51
|
If you are using the texture-based method, an additive blend would be more effective than an alpha blend or mask. --B From: Darren Grant To: Game Development Algorithms ; Game Development Algorithms Sent: Wednesday, March 24, 2010 2:19 PM Subject: Re: [Algorithms] volumetric spotlight I don't have references but here are a few techniques in increasing complexity: For viewers at a distance it is hard to beat the simplicity of billboard sprites. Just lock a billboard to the spotlight cone axis and use alpha blending to make the texture glow. Fade it out when the viewer gets close enough to make the effect cheesy. Create an umbra mesh, a skirt that resembles the spot cone and fix it to the spotlight in space. Simple vertex coloring to fade the skirt at the far end can be very effective. Again render using alpha blending. Some simple pixel shader work using normal averaging and dot product can help to hide the edges of the mesh. If you have access to the depth buffer values, you can also fade out pixels that approach the near plane so they don't clip noticeably as the viewer passes through the cone. The most complex approach is to write a ray-casting shader that integrates over distance travelled by each eye ray through the umbra volume. It is hard to get the results to overlap and intersect correctly with the rest of the scene unless you have some sort of unified rendering architecture built around ray-casting. Very pretty if you get it working, but very difficult to deploy without limitations coming back to get you later. Cheers, Darren At 09:24 AM 3/24/2010, Jeff Russell wrote: Hey, anybody have any cool reference for how to render a volumetric spotlight effect? I realize that full correct shadowing with volumetric lighting might be kind of heavy duty, so I'm willing to try something a little dirtier or with no shadows. Regards, Jeff -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev |
From: Sebastian S. <seb...@gm...> - 2010-03-25 09:54:29
|
Try this one: http://www.vis.uni-stuttgart.de/~dachsbcn/download/espmss10.pdf On Wed, Mar 24, 2010 at 4:24 PM, Jeff Russell <je...@8m...>wrote: > Hey, anybody have any cool reference for how to render a volumetric > spotlight effect? I realize that full correct shadowing with volumetric > lighting might be kind of heavy duty, so I'm willing to try something a > little dirtier or with no shadows. > > Regards, > > Jeff > > > -- > Jeff Russell > Engineer, 8monkey Labs > www.8monkeylabs.com > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- Sebastian Sylvan |
From: Bert P. <be...@bp...> - 2010-03-28 15:03:48
|
Darren Grant schreef: > The most complex approach is to write a ray-casting shader that > integrates over distance travelled by each eye ray through the umbra > volume. It is hard to get the results to overlap and intersect correctly > with the rest of the scene unless you have some sort of unified > rendering architecture built around ray-casting. Very pretty if you get > it working, but very difficult to deploy without limitations coming back > to get you later. I'd give that a try too. There's some good shadowmap based stuff in ShaderX7 as well for easier integration with scene geometry (p. 331). Also check out I3D10's update to Crytek's Light propagation volumes. hth, bert |
From: Jeff R. <je...@8m...> - 2010-03-29 01:57:07
|
OP here, thought I'd share my results. Thanks to Miles in particular for being helpful. http://i44.tinypic.com/2h4algx.jpg Determined the distance through the fog cone by tracing the eye vector to the far side of the cone, then clipping that distance against the depth buffer. With the entry and exit points inside the volume, it turned out to be fairly easy to evaluate the falloff integral implicitly. All told compiles into about 50 shader instructions, one texture lookup, and no overdraw. I might be able to squeeze the shader down a little more, but that will come later. Thanks guys, Jeff On Sun, Mar 28, 2010 at 9:18 AM, Bert Peers <be...@bp...> wrote: > Darren Grant schreef: > > > The most complex approach is to write a ray-casting shader that > > integrates over distance travelled by each eye ray through the umbra > > volume. It is hard to get the results to overlap and intersect correctly > > with the rest of the scene unless you have some sort of unified > > rendering architecture built around ray-casting. Very pretty if you get > > it working, but very difficult to deploy without limitations coming back > > to get you later. > > I'd give that a try too. There's some good shadowmap based stuff in > ShaderX7 as well for easier integration with scene geometry (p. 331). > > > Also check out I3D10's update to Crytek's Light propagation volumes. > > > hth, > bert > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- Jeff Russell Engineer, 8monkey Labs www.8monkeylabs.com |