🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How to make blurry reflections without using LODs?

Started by
14 comments, last by MJP 2 years, 11 months ago

Hi @JoeJ,

Yeah, so if I set the sample count to even 2000, it matches the reference pretty well.

But if the Environment Map is an HDR, I get a lot of fireflies in a very distinct spiral pattern(I think that's because of the Fibonacci Function).

Even if I bring the samples up to 6000, the fireflies are still there, but less noticeable.

But still 2000 samples is a bit expensive, is there any way to use less samples and still get a decent result?

I had an idea to multiple each sample by the inverted dot product between the original reflection vector and the one made with the new Normal.

And also create an accumulator to add all of the values of the non inverted dot product.

So then after the loop, and after I divide the color accumulator by the number of samples, I would then multiply the result with the dot weight accumulator.

That way the end result will have a weight of 1, I haven't tried this out yet, but I think it will work to reduce the fireflies.

I'll report how that goes ?

Thanks again!!

I really appreciate it!!

Advertisement

Well, if you only you could add converstaion to mip mapped cube map. Then you could do what games do and trade for some better accuracy by doing some more samples than just one.

I guess the fireflies come from some small but very bright spots in the env. map, like the sun or other light sources. Some pixels hit it by luck, others don't. One way to address this is 'denoising' (blurring in image space, or identifying and removing outliers). The other way is to importance sample the env. map, as proposed by the paper (which may be out of date).

Yeah, I wish I could use mipmaps for this, it seems like a very good solution.

I am pretty sure that you're right about the bright spots causing fireflies.

I'll keep trying and see if there is a faster way to deal with this.

Thanks again!!

IBL (image-based lighting) is another story. It uses pre-calculated rays directions, environment image (typically HDRI) is first sub-divided into pieces with “same energy”. The result is an interested combination of directional and environment illumination There is no ovstacles to do this on GPU, but again, with only maps (no rays) the abilities are very limited, in fact no any shadow.

But it's “illimiation” that has no relation with “blurred reflections” ;-)

“IBL” just means you're getting lighting from an image. Any method for sampling lighting from an image is IBL, what the OP is doing here definitely qualifies. There are of course many other options for implementing IBL, such as pre-filtered cubemaps and other related techniques.

If your image has small, bright spots it makes sense that it will cause fireflies. In simple terms your odds of a sample landing on a bright spot are low, and so they don't end up properly combining with rest of the result. You can improve this by using importance sampling the image itself, which roughly boils down to “take more samples at the brighter spots of the image and apply appropriate weighting”. If you then combined this with the BRDF sampling you already have by using multiple importance sampling, you can get better results in less samples. Any kind of traditional IBL importance sampling typically requires some kind of pre-processing of the image to find the important spots and compute weighting factors, although there is some good recent research into building up that kind of information on-the-fly as you're taking samples.

This topic is closed to new replies.

Advertisement