Download presentation
Presentation is loading. Please wait.
Published byΝαβαδίας Ανδρέου Modified over 6 years ago
1
Real-time Volumetric Lighting in Participating Media
Balázs Tóth Tamás Umenhoffer Good afternoon everyone! I'm Balazs Toth from the Technical University of Budapest I'd like to present a realtime method to compute volumetric lighting in participating media
2
Motivation The main goal is to reproduce the light effects with scattering taken account. On this slide you can see some real world example of volumetric lighting.
3
Motivation Single scattering Good approximation for many materials
Easily calculable Ray marching Shadow maps Interleaved sampling Feasible on GPU We are modelling single scattering only, becouse it's a good approximation for many materials, like dust, smoke, etc. Huge advantage of this simplification is that it can be computed realtime on the modern GPUs, even with some light occluders in the scene. Our method is based on the classic ray marching approach with some extensions. We are using shadow maps to detect the occlusion in the light beams, and interleaved sampling to reduce the computation cost.
4
Ray marching Radiance calculation in the visible surface point
Iteration from the surface to the camera Illumination Absorption Summation of their product The main idea behind the ray marching technique is to determine the visible surface point in a given camera pixel then calculate the radiance at the surface point without the participating media. That will be the starting point and energy of the ray marching. To determine the decrease of the energy between the surface and the camera, we iterate along the ray and calculate the decrease of illumination and the absorption at given ray segment. The final illumination would be sum of their products.
5
Ray marching The aggregate radiance stored in every pixel
Geometry in the light frustrum Visibility factor from the shadow map If there are some occluders present in the light beam, we take in account them through the ray marching. We can calculate the visibility factor in every step through the ray using regular shadow maps generated from the light source position. The final radiance is stored in every pixel of the scattering image.
6
Ray marching Shadow map from the light source Surface map
from the camera The left picture is the shadow map generated from the pov of light source. That's used for the visibility factor calculations. The right picture is basicaly a depth map generated from the camera. That's used for the surface point calculations. The bottom picture is the final scatter image generated with ray marching. Scatter image
7
Ray marching Image without Scattering image scattering Final image
Compositing Image without scattering Scattering image The left picture generated without taking scattering into account. That's the basic image and it can be calculated with arbitrary techniques. The right picture is the scattering image. We can get the final image with the composition of the two image. You can see the result on the third image at the bottom. Final image
8
Ray marching N sample per pixel
The computation time is proportional to the number of samples With too few samples there will be artifacts at the volume boundaries Unfortunately there are some problem with the ray marching that should be sorted out if we want to use it for realtime rendering. The most important thing is the number of steps along the iteration. The computation time is proportional to the number of samples. So we should do as few steps as we can, not to slow down the rendering. But if we take too few samples there will be artifacts at the volume boundaries. We have to balance somehow between speed and quality.
9
Interleaved sampling The surface and the scattering are similar in the neighbouring pixels N samples in n*n pixels The N samples are approximated by the sum of the distributed samples A good compromise is to use interleaved sampling for the ray marching. The main idea behind that is the surface and the scattering are similar in the neighboring pixels. So we can distribute the samples equally between them. To put it the other way around, we can use the information calculated in the neighboring pixels to refine the calculation. In our algorithm we distribute the N sample points of the ray to n times n rays. Then the original N samples are approximated by the sum of the distributed samples.
10
Interleaved sampling Periodic pixel groups
To avoid the periodic artifact caused by this approach, we should distribute the samples along the rays that way that no repetition allowed in any n times n rays. This can be easily achieved when the rays are grouped by four. You can see this distribution on the picture. Periodic pixel groups No repetition in any n*n samples
11
Interleaved sampling 8 samples 8 samples, interleaved 128 samples
The bottom left picture is the reference image generated by using hundredtwentyeight samples along a ray. The upper left picture is generated by only eight samples per ray without interleaved sampling. And the upper right picture is generated by using the same number of rays but with interleaved sampling. The difference is quite visible. 128 samples
12
Summary NVidia 8800GTX GPU, DirectX9
The scene contains triangles Viewport size 800x600 110 fps without scattering 42 fps with scattering 100 fps with scattering and interleaved sampling We tested our algorithm on an Nvidia 8800GTX GPU with DirectX 9. The test scene contains triangles and the viewport size is 800x600. The reference renderer without scattering achieved 110 frame per second. If we turned on the scattering calculation with the naive approach the fps dropped to 42. With interleaved sampling we could achieve the 100fps again.
13
Results Here are some demonstration pictures of our highly occluded test scene.
14
Video And here is a video.
15
Thank you for your attention!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.