Skip to main content
2 of 2
added 102 characters in body
lightxbulb
  • 2.7k
  • 1
  • 8
  • 16

You can refer to the available literature on the topic. The papers I am aware of are:

Ray Tracing in Non-Constant Media

Interactive Rendering of Non-Constant, Refractive Media Using the Ray Equations of Gradient-Index Optics

and

Refractive radiative transfer equation

The general algorithm for handling a varying index of refraction is ray-marching, where the size of the steps is related to the accuracy of your solution.

lightxbulb
  • 2.7k
  • 1
  • 8
  • 16