Doing light shafts?

Started by
8 comments, last by Ysaneya 19 years, 1 month ago
I've watched several demoscenes lately and wondered how they do lightshafts in it. What I mean is that in those demos there's a very powerful light and some 3d geometry or clouds obscuring it, only that you're looking directly at those clouds and volumetric seamless light shafts stream through holes in those obstacles. I can think about extruding something like 'shadow volumes' for geometry, but how do they do that for arbitary textures-alpha masks?
Advertisement
If anyone knows how to create shafts of light with textures, god, PLEASE reply here. The only solution I have right now (which isn't extremely practical for the application I'm focusing on) is using shadow volume-style model generation and displaying in a similar manner as volumetric fog.
This might be a silly question, but has anyone tried emailing the authors of the demos in question and asking them?

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Quote:Original post by Halo Vortex
I've watched several demoscenes lately and wondered how they do lightshafts in it.

What I mean is that in those demos there's a very powerful light and some 3d geometry or clouds obscuring it, only that you're looking directly at those clouds and volumetric seamless light shafts stream through holes in those obstacles.

I can think about extruding something like 'shadow volumes' for geometry, but how do they do that for arbitary textures-alpha masks?


There are presentation slides online for "Volumetric Light Shaft Rendering" here: http://www.ati.com/developer/gdc/Mitchell_LightShafts.pdf

I hope this is helpful.

--Chris
Out of speculation, have you tried researching post processing pixel shaders? By setting up a triangle (shader applied) you could create some cool effects with light beams with the NVidia Shader Dev SDK.

I'm at a loss of how to explain how they did it in HL2 however ;)
Quote:Original post by chrisATI
Quote:Original post by Halo Vortex
I've watched several demoscenes lately and wondered how they do lightshafts in it.

What I mean is that in those demos there's a very powerful light and some 3d geometry or clouds obscuring it, only that you're looking directly at those clouds and volumetric seamless light shafts stream through holes in those obstacles.

I can think about extruding something like 'shadow volumes' for geometry, but how do they do that for arbitary textures-alpha masks?


There are presentation slides online for "Volumetric Light Shaft Rendering" here: http://www.ati.com/developer/gdc/Mitchell_LightShafts.pdf

I hope this is helpful.

--Chris


*jaw drops* Wow, that's precisely what I was looking for! Thanks!
Half life 2? Haha, its just a grid of 8x8 quads. The quads extend down and overlap each other in the grid pattern i was talking about. If you have "garry's mod" for half life 2 you can actually place these shafts of light and see what im talking about.
Hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
i remember asking this question to someone from here a long time ago. he showed me a demo and explained how it worked, it was way over my head at the time but i think if he explained it again i could figure it out, i do not can't remember his name but i think it was sagely or sages (i know it had something to do with sage.)
For realistic light shafts the volumetric fog kinda way is the way to go.. similar to the ati whitepaper.

But I think the in the "demos" they probably use some kind of (radial) blurring. I think one of Nehe's tutorial demonstrates it. You should check it out. This is very easily applied to arbitrary textures.
It's similar to shadow mapping, but projected on a set of layered quads in eye space.

This topic is closed to new replies.

Advertisement