O'Reilly logo

Blender 2.49 Scripting by Michel J. Anders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Soap bubbles—a view-dependent shader

Some materials change the way they look depending on the angle at which we look at them. Bird feathers, some fancy car paints, oil spills on water, and soap bubbles are some examples. This phenomenon of changing colors is known as iridescence. If we want to implement something like that we need access to the view vector and the surface normal. In our soap bubble shader we see one way of doing this.

First some mathematics: Why is it that soap bubbles show all those different colors? Soap bubbles are basically curved sheets of water (with a little soap), and at the interface between air and water, light is reflected. An incident ray will therefore be partially reflected when it hits the outer surface of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required