Jump to content
  • Advertisement
Sign in to follow this  
simotix

Light Volumes

This topic is 3716 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Often when I am playing a game I will see a "light volume", or something that presents a lights direction (like how a spot light will have a cone). How exactly does this work?

Share this post


Link to post
Share on other sites
Advertisement
@DraganO:

Interesting approach, but what happens if the camera view is orthogonal to the light space planes? I guess this would lead to artifacts.
If I understood this right you need to fill the screen completely where the lightshaft is expected to be

So wouldn t it be simpler to pack all the lightplane textures into a texture array and draw the viewfrustrum of the lightsource and in the shader you decide which textures of the texture array to sample from


This would reduce the fillrate demand tremendously.

Share this post


Link to post
Share on other sites
I have to admit that I haven't implemented this yet. I just stumled upon the paper some time ago by accident and thought I was worth mentioning here. And I also don't really get your question. I guess you didn't fully understand how the algorithm works (but I'm also not so sure myself...).
You don't use any lightplane textures at all, the effect is completely generated by the pixelshader.

Take a look at this paper:
The original paper introducing this technique

You basicly just want to determine the length of the intersection between a ray from every pixel in view direction and the volume of the light shaft. Then use this length to attenuate this pixel. Since this would be too slow for a realtime application you project the light map of the light onto the sampling planes, which are always orthogonal to the view direction, and sample this light information to get an approximation. The more planes you use the more accurate your result is.
You can also do this by not using a light map but a shadow map. This is more complicated, but allows you to see shadows in the light shaft.

[Edited by - DraganO on July 20, 2008 3:58:15 PM]

Share this post


Link to post
Share on other sites
I have to admit I only looked at the pictures :)

So you render the line planes in the camera view and project the lightmap of the light source onto it and the light planes are clipped against the light frustrum's planes


But that still leads to the problem if the camera is orthogonal to the light direction, since the light planes are invisible from the side, or do you use billboards as light planes?

You need to cover the whole surface area of the light's frustrum otherwise you get gaps in the shafts

Share this post


Link to post
Share on other sites
Quote:
Original post by Basiror
You need to cover the whole surface area of the light's frustrum otherwise you get gaps in the shafts

It's not necessary:)

Share this post


Link to post
Share on other sites
First of all I am not really the right person to ask about this algorithm. I never implemented it and just read the paper once some time ago.

Quote:
But that still leads to the problem if the camera is orthogonal to the light direction, since the light planes are invisible from the side, or do you use billboards as light planes?

The sampling planes are always facing the camera, you can never see them from the side.

[Edited by - DraganO on July 20, 2008 4:05:51 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by DraganO
First of all I am not really the right person to ask about this algorithm. I never implemented it and just read the paper once some time ago.

Quote:
But that still leads to the problem if the camera is orthogonal to the light direction, since the light planes are invisible from the side, or do you use billboards as light planes?

The sampling planes are always facing the camera, you can never see them from the side.


In other words: they are billboards inside the light's frustrum

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!