Fast Dispersion Glass

Description

This is a faster dispersion glass shader.

Instead of using three refraction/glass shaders, one each covering R, G and B - it uses a very small scale brick texture to set wavelength dependent colour/IOR at the sub pixel level.

Because we are only using one refraction/glass shader - this results in much better performance - and possibly much better accuracy too since we are setting IORs based on the actual colour, rather than trying to interpolate between pure R, G and B values.

The second image is a comparison with a traditional additive R, G, B glass/refraction dispersion shader. This shader renders in about half the time of a dispersion shader adding R, G and B refraction/glass shaders (in the shown examples - 32 seconds vs 56 seconds)

Comments (3)

I
IAMCUBEMAN about 8 years ago

Would you be okay if I were to include your implementation in my Better Glass Shader?

M
Moony about 8 years ago

Sure - no problem.

I
IAMCUBEMAN about 8 years ago

Awesome, Thanks!

Sign in to leave a comment.