Glass & Light Absorption

This browser seems not to support canvas. :(

Beer-Lambert Attenuation

As light travels through a transparent medium, it is absorbed at a rate of the distance traveled. this is described by Beer-Lambert law:

attenuation = exp(-absorptionColor * thickness / attenuationDistance)

Thinner regions such as the horns and hair transmit light with less color shift, while the thicker body absorbs more, producing a deeper hue.

What can I do with this demo?

Adjust the following properties to explorer how light interacts with glass:
  • Glass Color: The color the glass appears when light passes through it. It gets crystal clear when it's white.
  • Attenuation Distance: How quickly the color deepens. Lower values make the glass more opaque
  • IOR(Index of Refraction): How much light bends when entering the glass. Higher values produce stronger distortion