Sign in to follow this  

RSM indirect Light flickering

This topic is 1382 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

Hey guys I have a little problem in my implementation of indirect illumination via Pixellights and RSM. The Problem is that when I move the light I can "see" the sampling points in the scene and it looks not so good. My implementation method is now: Render the RSM with 8*8 samples with a compute shader in a UAV and then in the final deferred shading pass sum the light influence from all 8*8 samples in each pixel. I use this formula: For one pixel: float3 irradiance = float3(0.0f,0.0f,0.0f); ... for(int i = 0; i < 8*8;i++) { irradiance += diffuse.rgb(the color map) * VPLBuffer[i].color.rgb(the sample color) * (saturate(dot(VPLBuffer[i].normal.xyz,position.xyz - VPLBuffer[i].position.xyz)) * saturate(dot(normal,VPLBuffer[i].position.xyz - position.xyz))) / pow(length(position.xyz - VPLBuffer[i].position.xyz),3); } .... return float4(diff + irradiance,1.0f); When I change the exponent of the pow function to 2 or 1 theflickering goes away, but then the light is reflected by a too big distance and it looks bad.... So how to filter that stuff ?? Here is a video of the problem I have and he/she solves it by an unknown filter. http://www.youtube.com/watch?v=nnZUYg5iToY

Share this post


Link to post
Share on other sites
float3 irradiance = float3(0.0f,0.0f,0.0f);
...
for(int i = 0; i < 8*8;i++)
{
float3 diff = position.xyz - VPLBuffer[i].position.xyz;
irradiance += VPLBuffer[i].color.rgb(the sample color) * (saturate(dot(VPLBuffer[i].normal.xyz, diff)) * saturate(dot(normal,-diff))) / pow(length(diff),3); 

}
irradiance *= diffuse.rgb(the color map);

Code reformatted to see meaning bit easier. Why you do double sided light equation?

Share this post


Link to post
Share on other sites

Oh thanks that makes sense. Well the double sided equation was my first idea of doing that. Is there an other way to do that ??

Share this post


Link to post
Share on other sites

Just try to use binary nDotL test to prevent backside lighting. Then use standard distance square fallof. This should be lot less flickery.

Share this post


Link to post
Share on other sites

But when do I do that ? My first idea was the standart way of indirect lighting with RSM : Create Vector a = reflect( Lightposition - rsm pixel position, rsm pixel normal). Now vector a is the vector which is (maybe) directed to our dest pixel. Now I do nDotL with the dest pixels normal and vector a. Now I have to multiply this float with the rsm color and divide it by the fallof. But I don't realy unterstand what you mean with the binary test. Maybe someone can give me his way of implementing that, because I thing my way is too expensive.

Share this post


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