# Is there a way to do sphere caustics analytically?

I have a Shadertoy which renders the image below using ray tracing.

I'd like to add caustics, but am aware that in general they are a hard solution, especially without bidirectional ray tracing or photon mapping.

Does anyone know if there is a way to analytically calculate caustics, or at least some of the caustics (or plausible caustic effects) in a situation like this?

There is refraction going on here, not just transparency, in case that makes a difference.

• Just thinking out loud, it may be possible to use some equations for spherical lenses and treat it like calculating defocus blur. The caustic brightness would go like $1/r^2$ of the circle of confusion, or something like that. Jan 12 '17 at 22:04
• That sounds really promising. I like how that seems like it could be exact for spheres, whereas the answer about using surface normal and refractive index would be decent approximations for general shapes. Jan 12 '17 at 22:40