Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: dj_buckley on 2020-10-11, 21:46:17

Title: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-11, 21:46:17
I cannot get rid of the fireflies created by reflective caustics.  Simple scene, sunlight, pool, building.  It's a villa on a tropical island so think white walls, clear blue sky, bright sunlight.

The annoying part is the refractive pool caustics looks great, it's the reflective caustics onto the building from the pool causing the fireflies.

I've tried sun/sky, hdri, environment caustics on, environment caustics off, caustics adaptivity on, caustics adaptivity off, still frame computation, animation computation.

Fireflies always there regardless of what I do.

I can't post many screenshots due to NDA's, but I've mocked up the scene setup, the blue bubble is where I get the fireflies

 
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-10-13, 15:17:58
There was a very similar thread in the past, check out the suggested solutions in it:
https://forum.corona-renderer.com/index.php?topic=30091.msg173280#msg173280

If you are able to reproduce the issue in a simpler scene and share it here, that would be awesome.
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-16, 00:03:53
Thanks Maru but none of that made any difference at all I'm afraid.

It's worth noting I'm using a HDRI (I believe Recent Spaces have also never had an issue with an HDRI) - so I need to leave the 'Caustics from Environment' checked.  I'll try and set up a mini scene and upload it
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-10-16, 17:29:56
Sure, I'll be waiting for a scene. Please let me know where you've uploaded it and what's the file name.
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-21, 09:24:50
It's uploading now via dropbox called 'Caustic Testing' - this is the exact scene with all the heavy stuff (furniture/trees) stripped out.  Just hit the render button and you'll see the issue.
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-21, 16:24:04
Forget to let you know it had finished uploading.

To add a few bits - the only solution I've found is to render twice, once with caustics and once without and merge then painting the caustics back in in photoshop.

Far from ideal - especially as the notes regardarding caustics say they are problematic with region rendering.

It's really frustrating as this is the one 'setup' where I was expecting caustics to shine, really hope it's me doing something wrong :)
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-21, 19:21:35
Me again - so I've replicated the exact HDRI setup with Sun and Sky.

The small bright sun is the problem.  As soon as you untick 'Visible to Reflection' on the Sun, the problem completely disappears.  This still isn't a solution though as I need the sun visible to reflection for the specular of every single other element in the scene.

It's quite evident in the image which one has the sun visible in reflections - although both are really low quality renders, they were both rendered for exactly the same amount of time and the only difference was that checkbox.

On a side note - let's say render time isn't an issue - how would you have the settings set in the Experimental/Debug Caustics Rollout for maximum quality?

Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-21, 19:34:57
And this is how it looks if you leave it rendering to "clean up"
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-10-21, 19:43:55
I will check the provided scene ASAP. I have it on my todo. Sorry for the delay.
Just to make sure - you are not using region / crop rendering here? If so, it is not supported with the caustics solver and will produce splotches that never go away.
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-21, 20:16:59
Great, appreciate it.

Is that the case with every single region/scene regardless?  The notes suggest just a slow down or different appearance "Caustics may render slower/differently when using render regions (this will be improved)."

Also how is it possible to test Caustics without doing a full res render if that's the case - are caustics resolution dependant?  I could test at 1000px but if it's likely to change when I blow up to 5000px then ... I ask this because some of the settings in the experimental section refer to pixels i.e. initial lookup radius etc
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-10-22, 10:57:56
Left it running last night for 500 passes.  It cleaned up to a degree.  But was still noisy to the point of being unacceptable to issue as a final image to a client.  I've ended up blending two renders together.  Is there any documentation for the correct compositing of the Caustic pass?  Also my other questions re: caustics and resolution still apply.

Another interesting point.  The render with caustics on took 8* longer than without
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-11-04, 15:45:06
Just bumping this as it's been 2 weeks without a response
Title: Re: Caustics - Fireflies - again
Post by: alexyork on 2020-11-04, 18:44:43
We really do desperately need an include/exclude caustics receive system. Perhaps a straightforward "receive caustics" checkbox in the corona material would deal with this issue so well. That and caustics adaptivity to be fixed so we can avoid these black NAN squares.
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-11-05, 11:16:22
Just bumping this as it's been 2 weeks without a response

Sorry for that. Our todo lists are super long. I am downloading the scene right now and will look into it. I will definitely have some results today.


We really do desperately need an include/exclude caustics receive system. Perhaps a straightforward "receive caustics" checkbox in the corona material would deal with this issue so well. That and caustics adaptivity to be fixed so we can avoid these black NAN squares.

I am not sure if "receive caustics" will be possible at all with Corona, which does not like fakes. But we know that many users requested this, and it's logged for the devs to review.
What "black NAN squares" do you mean? The "caustics adaptivity" thing?
Title: Re: Caustics - Fireflies - again
Post by: alexyork on 2020-11-05, 11:21:46
I am not sure if "receive caustics" will be possible at all with Corona, which does not like fakes. But we know that many users requested this, and it's logged for the devs to review.
What "black NAN squares" do you mean? The "caustics adaptivity" thing?

Yes the black squares that appear pretty much any time caustics adaptivity is left enabled.

Regarding "receive caustics" and faking, that's totally understandable. But I think this is clearly one of those cases where a balance has to be struck between usability and reality. Right now caustics work but with rather a lot of work-arounds and issues.

I mean if you think about it right now you're already "faking" things by allowing the user to control when caustics are generated - we're made to check a box that says "make this behave realistically". That's fake already. So is it such a leap to allow us to control where those caustics can be received too with a similar checkbox?

Would a different solution be more practical, such as allowing the user to limit the distance caustics can be "thrown" from a surface? The default is seemingly infinite, so you get caustics splotches thrown many meters away from a water surface. If we could limit it in the settings for that scene to something like 2m/3m then we could keep those caustics under some kind of control. Basically a more aggressive falloff.  It wouldn't deal with the issue but it would help.
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-11-05, 13:55:12
Regarding "receive caustics" and faking, that's totally understandable. But I think this is clearly one of those cases where a balance has to be struck between usability and reality. Right now caustics work but with rather a lot of work-arounds and issues.

I mean if you think about it right now you're already "faking" things by allowing the user to control when caustics are generated - we're made to check a box that says "make this behave realistically". That's fake already. So is it such a leap to allow us to control where those caustics can be received too with a similar checkbox?

Would a different solution be more practical, such as allowing the user to limit the distance caustics can be "thrown" from a surface? The default is seemingly infinite, so you get caustics splotches thrown many meters away from a water surface. If we could limit it in the settings for that scene to something like 2m/3m then we could keep those caustics under some kind of control. Basically a more aggressive falloff.  It wouldn't deal with the issue but it would help.

Sorry, I just typed my message too quickly. I just thought that making a specific surface not receive caustics may be technically impossible with Corona, pretty much like telling a specific surface "do not reflect this object". This is only possible the other way around - a specific object is invisible in reflections globally. But let's leave this to the developers. My brain is definitely too small for this. :)



Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-11-05, 14:13:20
@dj_buckley - back to the original issue.

I did an investigation, but unfortunately I do not have a satisfying solution. Only some possible workarounds:

1) The most important question - do you really need those reflective caustics from the water in the shaded areas?

If you do not need to keep the reflective caustics in the shaded areas: you can plug a rayswitch map like in the attached image into the water material's reflection color slot. This will keep the reflections visible in other reflections (e.g. when the water is reflected in glass), in refractions, and when they are seen directly, but will tell Corona "this material is non-reflective for GI rays" which basically means removing reflective caustics.
Reflective caustics generated by other materials will be still visible, which leads us to another thing: most of the materials in your scene have reflections enabled, including walls, floors, etc. This is not a mistake, and I can understand that for example the Corona Material Library features materials like this, but this will definitely slow down caustics, since they will be calculated for everything, rather than just for the water material (or other reflective/refractive materials where you need them). The solution here would be to either remove the reflectivity in the materials where it is not absolutely required, or to use the rayswitch map again to make the reflections appear visible directly but invisible to the caustics solver.

If you do need to keep the reflective caustics visible in the shaded areas:

2) The only thing I can recommend is radically changing the render settings to get faster caustics rendering at the cost of everything else. Here is a list of what I was able to come up with:

Scene:
- Enable denoising

Performance:
- Use Path Tracing + UHD Cache (originally your scene was using the 4K Cache - this is fine, but the UHD Cache is the more "secure" solution)
- Set GI vs AA balance to 4 (this will render each pass very quickly, with a lot of noise, but since caustics are calculated between each pass, this will dramatically improve caustics quality)
- Set light samples multiplier to 1
- Set Max Sample Intensity to 10 (you can try setting it even lower, but at some point it will basically kill any light bounces)
- Set Max Ray Depth to 8 (this may be considered blasphemy by some, but it should result in faster rendering at some cost of the lighting quality)

In the caustics solver settings (you need to have the Development/experimental rollout enabled):
- Set initial lookup radius to 1.5 px (you can try with a higher value, but 2 seemed too high for me - the caustics will become softer, more blurry, but will render faster)
- Max photons/iteration - the default value is 5000 and you can set it to as high value as possible. I tried with 15000 (3x the default) and it was fine. You can even try with values as high as 50000 (10x the default) but most likely you will run out of RAM and Max can easily crash.

System:
- Make sure that you are using the High quality image filter (it simply gives the best rendering quality)
- You can try enabling highlight clamping (set it to a value other than 0) but remember that this will clamp all the brightest areas in your image so you will not be able to take advantage of high-bit depth (this is important if you are planning to adjust your image in post). It should make the rendering a bit faster.

I will share some before/after images with you via PM.

I will also log this as a report for our devs, since it's yet another case where the caustics solver could be definitely improved.


(Internal ID=589850917)

Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-11-05, 17:40:55
Thanks Maru

I've just replied to your email before seeing this.

This type response is exactly what I was referring to in another thread (the one about DR/RAM), whenever I have an issue the 'solutions' always seem to result in a 'downgrade' so to speak. 

My goal is to create the absolute best images I'm capable of, I select my software based on whichever one allows me to achieve that.  If a company tells me they have a '1 click caustic' solution I'd expect at the very least for a 1 click caustic solution, not a 1 click caustic solution providing you do X and Y which will result in a worse image than the one you started with.

I thought Corona had a heavy focus on allowing us to achieve physically correct photorealistic results and that you weren't about 'fakes' etc. 

With that in mind, to answer your first question, no, i don't need those reflective caustics because they don't look particularly great but unfortunately they're not optional, but I absolutely need my materials to look as good/realistic as they possibly can. 

Querying whether I need reflections on my materials seems like such an odd thing in a world where we're striving to achieve CGI's that are as realistic as possible and pushing the boundaries with PBR etc.  If I didn't need reflections etc I may as well just jump back to 1986 and whip out my crayons.

Out of interest do you have a list of real world materials that don't have reflections?
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-11-05, 17:55:23
Also just +1 everything Alex said, I missed his messages before typing mine out.

I think the biggest disappointment for me was this was the one scenario where I thought caustics would shine as it's the one used in all the demos/tutorials/sample scenes/documentation whatever.  It's the most basic caustic setup really. 1 direct light, 1 refractive object.  Doesn't get any simpler in terms of scene setup - obviously I can't comment on the technical aspect
Title: Re: Caustics - Fireflies - again
Post by: mferster on 2020-11-07, 00:28:31
It's wholly unpractical, But I've had more success when you render the main objects you want to receive caustics separately and then comp them together in post.

When there are more objects around the samples get spread out and you get the goofy looking dots that don't really resolve like you've shown in your example.

In my quick example below you can see the difference when one of the caustics components are isolated from the rest.
Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-11-07, 19:05:59
That's what I've ended up having to do, rendered the image twice once with and once without caustics. 

The downside to this is that the devs say Caustics don't work with regions, so you have to render the full res image.  The full res image is 5000 pixels and with caustics turned on it takes 8x longer to render than without
Title: Re: Caustics - Fireflies - again
Post by: maru on 2020-11-09, 09:35:57
This type response is exactly what I was referring to in another thread (the one about DR/RAM), whenever I have an issue the 'solutions' always seem to result in a 'downgrade' so to speak.
- I am afraid this is the best response I can currently deliver.

My goal is to create the absolute best images I'm capable of, I select my software based on whichever one allows me to achieve that. If a company tells me they have a '1 click caustic' solution I'd expect at the very least for a 1 click caustic solution, not a 1 click caustic solution providing you do X and Y which will result in a worse image than the one you started with.
- I agree that the "1 click" does not apply to all kinds of scenes. If the complexity is too high, the render time needed to get reasonable image quality will grow. But still, in many cases the "1 click" is relevant, and we always did explain that additional render time will be needed. Isn't it the same with many other features? (think of refraction, SSS, volumetric fog, displacement - if you throw too much at the renderer, it will need more resources to finish the job)

I thought Corona had a heavy focus on allowing us to achieve physically correct photorealistic results and that you weren't about 'fakes' etc.
- Correct. The fakes here are to get as fast rendering as possible and as good quality as possible at the cost of some realism, which should be hard to spot anyway. I don't think it's something uncommon though.

With that in mind, to answer your first question, no, i don't need those reflective caustics because they don't look particularly great but unfortunately they're not optional, but I absolutely need my materials to look as good/realistic as they possibly can.
- As explained in my post, you can disable them using the rayswitch map while keeping the water's refractive caustics enabled.

Querying whether I need reflections on my materials seems like such an odd thing in a world where we're striving to achieve CGI's that are as realistic as possible and pushing the boundaries with PBR etc. If I didn't need reflections etc I may as well just jump back to 1986 and whip out my crayons.
Out of interest do you have a list of real world materials that don't have reflections?

- Sure. It is again a matter of "realism vs performance" and how much you are willing to sacrifice. That's why I asked if you need those reflections, rather than ordered to disable them to get reasonable performance.

Also just +1 everything Alex said, I missed his messages before typing mine out.
I think the biggest disappointment for me was this was the one scenario where I thought caustics would shine as it's the one used in all the demos/tutorials/sample scenes/documentation whatever. It's the most basic caustic setup really. 1 direct light, 1 refractive object. Doesn't get any simpler in terms of scene setup - obviously I can't comment on the technical aspect

- I understand this. Please just note that it's not the number of lights or objects that decides about the caustics quality/speed. I can easily imagine a scene with just 1 object and 1 light which would produce persistent noise with caustics. It is more about the overall complexity of the scene.


And again, just to avoid any misunderstandings - I am not arguing with you, just explaining how things work and trying to provide as much help as possible. We are aware of various issues with the caustics solver, and we have them logged with good examples so that our developers can improve it in the future.

Title: Re: Caustics - Fireflies - again
Post by: dj_buckley on 2020-11-09, 09:44:58
No problem Maru - thanks for the assistance on this and your work looking for solutions.  It's appreciated even if I don't sound like it is :)