Caustics and Raytracing

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 04, 2012 at 21:33

Is there a way (or multiple ways) to produce caustics with a raytracer?

Thanks.

17 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 May 04, 2012 at 22:17

Yes, photon mapping is a common way to do it. For caustics you don’t want to use final gathering, but rather visualize the photon map directly. Often times, people have two photon maps, one for caustics and one for diffuse indirect illumination. The one for caustics is built a little bit differently than the general-purpose one. Henrik Wann Jensen’s original paper describes how to do it (so does his book on photon mapping).

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 04, 2012 at 22:53

Thanks Reedbeta, but what about for a raytracer, not using photons? You know, just the good old raytrace.

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 May 05, 2012 at 02:03

I’m thinking about how to implement efficient & unbiased raytracer with caustics (I call it pseudo-photonmap assisted raytracer). So I can say: there is no easy way to produce caustics from small light sources. Something like caustics solver required.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 05, 2012 at 04:14

I know what you mean, I’ve been trying too. I’m only using area lights, no point lights. I thought maybe there is a way to, when shooting rays to lights, have a ray from the light back to the point, and if the point isn’t the same, find which pixel on the screen it belongs to, or something like that!

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 05, 2012 at 07:37

Wouldn’t a bidirectional path tracer do caustics well? I never tried it with my own, mostly because I only implemented spheres and planes.

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 May 05, 2012 at 14:14

Bidirectional tracer can do some types of caustics but not all. The most hard type is caustics on the bottom of the pool and there is no good algorithm for that case.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 05, 2012 at 15:41

Except photons?

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 05, 2012 at 17:18

@}:+()___ (Smile)

Bidirectional tracer can do some types of caustics but not all.

Why? A bidirectional path tracer uses photons, so what would be the problem?

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 06, 2012 at 00:54

@geon

Why? A bidirectional path tracer uses photons, so what would be the problem?

They do? I thought it cast a ray from the cam to the scene at point X, and then from a light to point X!!!

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 06, 2012 at 06:21

@Alienizer

They do? I thought it cast a ray from the cam to the scene at point X, and then from a light to point X!!!

First they trace a bunch of thotons from each light, then path trace and finally shadow ray test each photon. More or less.

Avtually, you would save tthe positions of all ray and photon BOUNCES, then take the average of all combination of ray and photon bounce, filtered by shadow ray testing. Or something. It was a while ago.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 06, 2012 at 15:23

hmmm, so how does this differe from photon mapping??

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 May 06, 2012 at 16:43

In photon mapping you trace forward & backward to the same surface and then approximately connect hit points. In bi-dir tracing you trace forward & backward to different surfaces then connect hit points with additional ray. Only photon mapping can efficiently (to the certain degree) render caustics in the bottom of the pool while bi-dir can work in case of direct viewed caustics.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 06, 2012 at 17:49

oh I see! Is there any bounces on the photons?

How come photon mapping can do caustics only to a certain dergree? I thought photon mapping could do caustics at 100%

6eaf0e08fe36b2c23ca096562dd7a8b7
0
__________Smile_ 101 May 06, 2012 at 18:04

I mean efficiently to the certain degree, it’s still heavy algorithm with large number of stored photons.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 06, 2012 at 18:36

oh ok.

So on the BDPT, you cast a ray from the cam (CamRayHitPoint), and one from each lights (PhotonsHitPoints), then cast rays from CamRayHitPoint to each PhotonsHitPoints?

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 May 06, 2012 at 21:23

Actually you’ll also get caustics on the bottom of pool with bidir path tracing, but after a lot longer time than with photon mappings.

So some technical stuff:
Light tracing - tracing photon from light, bouncing it around and waiting till it strikes camera plane. (can be optimized by testing each light path point against camera and accumulate energy)
Path tracing - tracing photon from eye and waiting till it strikes light (can be optimized by testing each path point whether it hits all of lights and accumulate energy)
Bidirectional path tracing - first you perform light tracing, remembering all light path points with their energy. Then you perform path tracing from camera and test against all light tracing points.

See some images here - http://www.cescg.org/CESCG97/csebfalvi/node8.html

Thats the basic idea on this.

You can further extend algorithms with Importance sampling (which greatly helps in number of steps to finish the computation) - with good Importance sampling, one can even compute caustics in just few steps.

Of course you can migrate all the stuff to GPU and do it at interactive speeds :P

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 May 06, 2012 at 21:58

ok, so which way is the fastest that produces fairly descent output?