Caustics by photons in Cycles?

I add the caustic map as an emmisive material, so it will interact with other objects in the scene. Notice that this method is not in real time, you have to render a specific image first, with the camera locked in the position of the light, and specific materials for the refraction object and the object to receive the caustics. Then you can run an algorithm which will convert this into a caustic map, let’s say, for the plane. Then you add this map to the plane material and re-render the scene.

Oh yes, i miss the part of ‘emission’ shader. But noneless, you would see it in gi and ref**ctive materials, but as you stated, where is accuracy? You’re making emit something that just reflects. How to take into account shadows projected on the caustics?

1 Like

Any part not highlighted by the caustic map you could leave as a shadow. However I think this method gives thicker shadows than it should, because it doesn’t take into account more indirect rays contibutting for the caustics, so maybe you can mix this with the shadow ray trick. The good thing this method gives is that protion of caustics which are outside the boundaries of the shadow, and reflective caustics as well, so I think it should be a nice addition. As Nubnubbud noted, we also have the problem of the conservation of energy. You can try to reduce this problem by tinkering with the strenght of the emmisive material, or you could change that 400 setting in the code, this number kind of control the “strenght” of the caustic

Still, the method doesn’t determine the correct light amount that hits the diffuse area… it just produces some cool caustic map, but not correct nor complete. That is just unfeasable to incorporate into Cycles.

though-!

you could use it as a guide for a second round of rays to shoot! find the areas that sending photons to will produce caustics, and send a LOT more to just those areas. (and average them with the rest of the samples of course) I’m not sure how you would stop this method from inflating the brightness of the caustics without giving the areas the photons end up, or the entire scene in general, the same treatment.

I got these using scrambling distance.

4 Likes

Nice, I already saw this on the other thread.
I think I know how you set it, but I challenge you to use those same settings in a production scene with many lights and bounces.

That’s a very nice result!!
Does this work in animations too, or is there some flickering?

Er…, seems like I can’t reproduce your result in a reasonable time. So can you share your settings?

I’d like to know as well…

A thought: Is it possible to expose caustic effects to the Light Path node? That way users could come up with node-based “fake” caustic lighting on the object that gets hit by the caustic.

Also, is it possible to make light-portals for caustics? The trouble with caustics is that they’re hard to sample, so what if instead of trying to make them sample faster, we give users a way to hint at where to look? I don’t know if this is doable, just my two cents.

First part, I guess no.
Second part could be a cool idea. Thinking further: a material option could turn on a special ‘caustic’ treatment where the user sets which light(s) should be looked for samples. A sort of ‘concentrate the efforts on this’

Hello, I’m interested in this technique. Could you share details to reproduce it?
Thanks

One possible option would be to generate a composition pass with only the caustics so that the user can then compose them as he wishes in composition.

But they wouldn’t appear in reflections/refractions, and wouldn’t contribute to diffuse illumination

I’ve created a new addon, after modifying the old povray addon. Now I can:

  • press a button (“Setup”) => adds photon properties of objects in scene and prepares the compositor;
  • setup photon properties of objects, lights and scene;
  • press a button (“Build”) => Blender creates two povray files, one for saving the photon map, the other for rendering the scene (always in povray) and loading the photon map without any other light source
  • press a button (“Render”) => Blender launches the two povray files. The povray rendered image containing only the photon map is saved.
  • Now I can run the Blender render; the compositor will add the Blender image to the povray image.

This is an example of the result:

It can manage media as well.
@lsscpp is right: the caustics wouldn’t appear in reflections/refractions, and wouldn’t contribute to diffuse illumination. Nevertheless, the process is simple and the results are quite interesting.

Now, I would like to share my addon with the community. But I want to do it in the right way:

  1. my script is built using part of the old povray addon => I need someone to help me managing the old code usage rights
  2. my script is very rough, so more work is needed to obtain a good addon.

Please, send me pm if you are interested on working on this addon.

Thank you

4 Likes

This is the “Photon Spacing Multiplier” in POV addon

Sorry for replying this old thread, but I want to ask some questions @brecht

Does this mean bidirectional path tracing is acceptable if someone shows up and take the job? I am confused, because I have heard that bidirectional path tracing comes with a lot of flaws including not compatible with Light Path node. In fact, this is what LuxCore render shows when using Bidirectional mode:
image

Is this really acceptable? I want to know the attitude the devs have towards this, because from what you said it kind of sound like it is acceptable?

Light tracing and photon cache are so far the best way to go right now, LuxCore and Corona use them, however Vray has a different technique (I wonder what is it) and provide Progressive Caustics, I imagine is something similar to Light Cache but with SDS support.

BiDir is in general slower and not so compatible with many things, so I think a better bet is to implement some of the more modern techniques compatible with Path Tracing and not include a fully different algo that will require reimplementation of different things :slight_smile:

However a dev is needed for this, I wish we could count with an additional dev that focuses on that type of improvement, because the inside devs need to focus in other priorities first I think.

5 Likes

I think BiDir has two broad problems:

  • it’s difficult to get to work on GPU (both because it’s harder to parallelize in a way suitable to the GPU, and because it takes a lot more memory per path, afaik
  • it is likely to break the various Light Path inputs

Less importantly, it actually isn’t a panacea either. There are BiDir failure cases. In particular, it has big troubles with Specular-Diffuse-Specular. I.e. paths where you go from one sharp reflection to another with a diffuse object in between. Roughly because there is only a single path that will do so as opposed to infinitely many that don’t.

So it might be interesting to look at somewhat more modern techniques which will allow for such paths as well. (That said, most of them are either very complicated, making them even harder to run on GPU, or rather slow. There’s certainly a reason why these techniques are less common than plain Path Tracing)
One particular technique just simply (as far as I can tell) extends BiDir to explicitly search for such paths:


But there are other techniques that can do it
3 Likes