Author Topic: Caustics - Fireflies - again  (Read 7462 times)

2020-11-05, 13:55:12
Reply #15

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12764
  • Marcin
    • View Profile
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. :)



Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-11-05, 14:13:20
Reply #16

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12764
  • Marcin
    • View Profile
@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)

« Last Edit: 2020-11-05, 14:38:47 by maru »
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-11-05, 17:40:55
Reply #17

dj_buckley

  • Active Users
  • **
  • Posts: 875
    • View Profile
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?

2020-11-05, 17:55:23
Reply #18

dj_buckley

  • Active Users
  • **
  • Posts: 875
    • View Profile
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

2020-11-07, 00:28:31
Reply #19

mferster

  • Active Users
  • **
  • Posts: 523
    • View Profile
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.

2020-11-07, 19:05:59
Reply #20

dj_buckley

  • Active Users
  • **
  • Posts: 875
    • View Profile
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

2020-11-09, 09:35:57
Reply #21

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12764
  • Marcin
    • View Profile
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.

Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2020-11-09, 09:44:58
Reply #22

dj_buckley

  • Active Users
  • **
  • Posts: 875
    • View Profile
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 :)