smart ibl on yafaray

Project:YafaRay
Version:development
Component:Code
Category:feature request
Priority:normal
Assigned:David Bluecame
Status:closed
Description

Currently yafaray has ibl lighting from the hdr you place on.
The same hdr is seen on the background if premultiply is not checked.
When you have a high resolution hdr with a sun and lots of clouds you will need lots of samples to clear the noise and as a consequence lots of time. :?

If we could inside world settings assign each texture to each setting you will reduce the noise:
- a medium resolution texture just for reflections
- a blured texture just for ibl samples
- a hi res texture just for the background

This is the smart ibl workflow simplified.

There is also a file discribing all the settings wich could be used to do the process automatically with a script and even having a sun and some other lights according to the hdr image.

But doing it manually would be perfect as well.
I think this is the spirit of biased renders. Doing it perfectly and fast without loosing quality.
You have sharp shadows and colored light.


-You have a full description here:
http://www.hdrlabs.com/sibl/how_it_works.html
-The .ibl file with parameters description is here:
http://www.hdrlabs.com/sibl/formatspecs.html
-sibl-gui is open source and can be integrated in any 3d app (blender yafaray would be even perfect since they are open source too)
http://www.hdrlabs.com/sibl/framework.html
-developers corner:
http://www.hdrlabs.com/cgi-bin/forum/Ya ... =smart_ibl

 

Tests explaining the potential of a blurred hdr

See this two first blured examples. One is blured but the light is correctly centered and shadows are sharper. The other is just blured and the light is bad.
The third is the same render with a hi res version and same samples as the first two. I think we can improve yafaray behaviour on this. (Of course some may say that with adaptative sampling we can remove the noise and that is true. But I was just suggesting more control and more speed.)

blur.png
blured hdr light. The light is awesome. Low noise and shadows are sharp.



blur2.png
bad blured hdr. The hdr is blured but shadows are not sharp.



ref.png
great hdr with noise. The hdr has very good resolution, but we have noise and the shadow is not as good as the firs example.

Comments

#1

Version:0.1.2-beta1» development
Status:active» postponed

#2

Status:postponed» active

#3

Assigned to:Anonymous» David Bluecame

#4

Hi David if you don't mind I would like to open a bug report on the last issue described here, which is "wild" pixels in IBL, since I have encountered several examples of it. It is a relatively important issue since these wild pixels increases a lot sampling requirements for scenes even when only direct lighting is used.

#5

Status:active» ready to commit

Hello,

This feature will be available in the upcoming YafaRay v3.0.0.

I've added a new World IBL parameter: "SmartIBL Blur factor". When this factor is higher than 0.0, YafaRay will internally create a "blurred" version of the World Background Texture and will use it for lighting. However, for reflections it will still use the original detailed texture.

All this will be automatic. The user will only need to specify the blur factor. I've set it to 0.2 by default, which I believe will give reasonable results.

#6

I'm testing it with this image.

https://hdrihaven.com/hdri.php?hdri=mpumalanga_veld

I've tested with Lightwave and I'm getting no shadow with yaf3.

Note that with yaf2 I get correct results. (with fireflies).

 

I'm also unable to upload correctly to this thread.

Thanks

AttachmentSize
lightwave.jpg 122.34 KB
yaf3.jpg 29.01 KB
yaf2.jpg 124.39 KB

#7

David, noticed this?

Thanks!

#8

Please try alpha 11 with blur 0.05 or 0.10

#9

Hi,

I've tested with alpha 11 and now the shadow is correct, but I'm getting a lot of fireflies; changing the blur factor does not solve the problem with them.

Can anybody confirm ?

Thanks

#10

Hello,

 

The sun in that HDR image has a small part that is extremely bright.It's an extreme and interesting case. The fireflies are not a bug but just samples coming from that very bright spot.

Maybe we can combine a small blur with a bit of clamp in the render panel. Or maybe I could introduce a texture clamping so that bright spot max brightness is limited to avoid the fireflies.

I'm not sure how Lightwave deals with this but I think the ball illumination is not as bright as in yaf2 example, maybe they are clamping down the max brightness in the texture?

#11

In LW case, it seems that importance sampling does the trick. I post here different global ilum. options and the results (preview mode).

As far I know, without hdr image hard shadows would be impossible.

Edit: Clamp is disabled

AttachmentSize
Screenshot - 08_07_2016 , 23_37_01.jpg 91.12 KB
Screenshot - 08_07_2016 , 23_37_33.jpg 47.84 KB
Screenshot - 08_07_2016 , 23_37_54.jpg 48.46 KB

#12

And this is cycles after 4000 samples no clamping.

It starts with fireflies, but with lots of samples it cleans. Maybe with yaf... I'll test.

EDIT: Increasing samples in yaf does not solve it. Blurring a lot blurs the fireflies, but the shadow is also blurred.

AttachmentSize
Screenshot - 08_07_2016 , 23_55_36.jpg 36.84 KB

#13

Well, this one is with yafaray and clamping 1 and 1 ibl sample.

I don't know why lightwave is working fine without clamping and I have to enable clamping for this (also set ibl samples to 1, because with maximum ibl sambles, fireflies appear another time). This makes sense?

The problem is that normally is better to render on HDR, to adjust tonemapping on postpro. If we set clamping to 1, we lost the extra information.

Regards.

 

 

AttachmentSize
Screenshot - 09_07_2016 , 0_17_14.jpg 32.37 KB

#14

This is luxrender's after 1000 samples, a lot more brighter. No clamping.

AttachmentSize
Screenshot - 09_07_2016 , 0_30_20.jpg 46.27 KB

#15

And yafaray with clamping 1 and photon mapping.

edit:At this point, I think that playing with clamping can do the trick, what I don't understand why it's better to set ibl samples low.

Thanks

AttachmentSize
Screenshot - 09_07_2016 , 0_35_16.jpg 32.66 KB

#16

Status:ready to commit» needs work

Hello,

Thank you for your tests. I'm investigating this now.

#17

Status:needs work» ready to commit

Hello,

First of all, thank you for the data and HDRI file, they were very useful.

Second: I have to admit I'm not sure if these "fireflies" are caused by:

* A possible bug in YafaRay sampling?

* Perhaps a better sampling algorithm should be implemented?

* Maybe this is just how it is, when you have such a high brightness values in a very small area (sun)?

I've looked into the code but I'm still uncertain.

 

In any case I agree that all these fireflies can be a big problem. In this case using SmartIBL/blurring does not help, and it's true that Blur would always cause issues with the sharpness of the shadows.Additionally, the current global "clamp" parameter could help but would also clamp the reflections, etc, which is not desirable.

 

So, I've decided to implement a new "trick" in the World-IBL settings. Next to the Blur parameter, I will add a "IBL sampling clamp" parameter. Using such IBL sampling clamp would avoid those fireflies while still not affecting the reflections. Of course this clamping will lead to an inexact overall brightness, so the scene would not be "physically correct", but I'm certain this is needed to achieve a nice result in a reasonable amount of time.

 

I've done a test with an scene including also some caustics. The IBL sampling clamp helped for the diffuse, but the caustics still caused fireflies due to the very bright samples from the sun. So, for this example I also used Indirect Clamping (which does not affect reflections) and the result was nice and quick.

Finally I enabled the v3 denoise and these are the results:

* Original scene, without any clamping nor denoise:

firefly1a - IBL example IBL Blur 0.0, IBL clamp 0.0, indirect clamp 0.0, denfirefly1a - IBL example IBL Blur 0.0, IBL clamp 0.0, indirect clamp 0.0, den

* Same scene, with IBL sampling clamp=3.0, Indirect clamp=3.0 and denoise enabled. You can see it rendered a bit faster to a much nicer result:

firefly1d - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, denfirefly1d - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, den

#18

Just for your reference, these are the intermediate images:

Original, without any "tricks"

firefly1a - IBL example IBL Blur 0.0, IBL clamp 0.0, indirect clamp 0.0, denfirefly1a - IBL example IBL Blur 0.0, IBL clamp 0.0, indirect clamp 0.0, den

Original, without any "tricks" (exposure = -5 to see the highlights)

firefly1a (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 0.0, indirectfirefly1a (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 0.0, indirect

 

With the new IBL sampling clamp = 3.0

firefly1b - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 0.0, denfirefly1b - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 0.0, den

With the new IBL sampling clamp = 3.0  (exposure = -5 to see the highlights)

firefly1b (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 3.0, indirectfirefly1b (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect

With the new IBL sampling clamp = 3.0 plus the already existing Indirect Clamp = 3.0

firefly1c - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, denfirefly1c - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, den

With the new IBL sampling clamp = 3.0 plus the already existing Indirect Clamp = 3.0 (exposure = -5 to see the highlights)

firefly1c (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 3.0, indirectfirefly1c (exposure -5) - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect

 

Same image as before, with with denoise enabled (denoise only available when saving LDR formats)

firefly1d - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, denfirefly1d - IBL example IBL Blur 0.0, IBL clamp 3.0, indirect clamp 3.0, den

#19

Great tests.

Ibl clamping it's very interesting, have you tried with path tracing? With some samples it might do good caustics.

I think ibl clamping reduces the range of ev of the image, so some information it's wasted, I would like to know if these hdris were created also to make caustics. Bidirectional, now depreacated, might work fine.

Edit-I will test with luxrender, but for now I think the issue is somewhat solved, I will check what happens with caustics here, or should be happen.

Regards!

#20

Status:ready to commit» fixed

Fixed in v3.0.0-beta: http://www.yafaray.org/community/forum/viewtopic.php?f=15&t=5173

#21

Status:fixed» ready to commit

Hello,

I think I found the fundamental reason for the wild pixels. This commit should fix most of them:

https://github.com/YafaRay/Core/commit/543e2a447742ad1f6d2b9f9a5197f2ded...

This will be available in the upcoming YafaRay v3.0.1-beta

#22

Status:ready to commit» fixed

IBL sampling fixed in v3.0.1-beta: http://www.yafaray.org/community/forum/viewtopic.php?f=15&t=5173

#23

Status:fixed» closed

Marked as "fixed" for more than 3 weeks without any further user comments. Closing.