Light Propagation Volumes

Started by
12 comments, last by NekoCode 8 years, 2 months ago
This little demo applies Crytek's "Light propagation volumes" to generate real-time global illumination to illuminate a simple scene.
I implemented it according to the paper "Cascaded Light Propagation Volumes for Real-Time Indirect Illumination"
Full source code (C++/OpenGL) with comments and a description as well as movies and some related papers can be downloaded from this site:
LightPropagationVolumes

Click here to view the iotd
Advertisement
Great! I'm going to implement this into my game engine after I finish the semester!
I'm getting an error.

C:\Users\Steven\Desktop\lpv>lpv2.exe
Light propagation volumes demo
shader log:
0(94) : error C1059: non constant expression in initialization
0(95) : error C1059: non constant expression in initialization

failed to compile fragment shader shader/blur.fp
indirect_light_buffer::create_shader failed
failed to initialize application

C:\Users\Steven\Desktop\lpv>pause
Press any key to continue . . .[/quote]
You can edit the file "blur.fp", it is located in the "shader" sub directory and change the lines:
const vec2 sample_pos2 = d * 2.0;
const vec2 sample_pos3 = d;
const vec2 sample_pos4 = -sample_pos3;
const vec2 sample_pos5 = -sample_pos2;

to

vec2 sample_pos2 = d * 2.0;
vec2 sample_pos3 = d;
vec2 sample_pos4 = -sample_pos3;
vec2 sample_pos5 = -sample_pos2;

i.e just remove the "const".
I tested the shader with my GT330M and the ATI GPU Analyzer and they haven't reported any errors.
I will upload a new version with the fix as soon as I have access to my computer at home.
Tip: click inside this box to load the editor
Note that the latest NVIDIA SDK also contains an LPV demo. I haven't downloaded it yet since I don't have a DX11 compatible computer:
Diffuse Global Illumination
Thanks, RafWrobel! Why am I only getting 20 FPS though?
complex shaders make it so slow. I am also getting 20fps with my GT330M
Very nice demo, I get around 120-150 fps on my ati hd 4850 (around 3 year old card).

I noticed an artifact, the shader seem to produce some light in corners and edges where there should be none. It can be seen on the second and third screenshot. The floor on the left side, it becomes bright towards the wall. This is nice work nevertheless, the scene is definitely improved.
yes you are right, the propagation scheme should preserve the main intensity directions but I noticed (at least in my implementation) that after a few iterations some of the light comes back i.e. light gets reflected form a wall but some of that light comes back to that wall. The demo reduces light bleeding through thin objects and also prevents some of the light to go through objects by using blocking geometry.

This topic is closed to new replies.

Advertisement