GLSL Programming/Blender

Blender is a popular open source modeling and animation tool for Windows, MacOS X, Linux, and FreeBSD that includes a game engine. (Via GameKit it might also support game development for Android and iOS in the future.) Since meshes, textures, light sources, etc. can be edited in a graphical user interface, it is easier to define complex scenes than in an OpenGL (ES) or WebGL application. Blender supports vertex and fragment shaders in GLSL (i.e. “GLSL programs”; not to be confused with the built-in “GLSL material” or “GLSL shading”).

First, Blender's Python API (which is necessary to specify GLSL programs and OpenGL states) has been dramatically changed in version 2.5 of Blender; thus, most of the tutorials and examples about GLSL programming in Blender that you might find in the internet won't work with the current version.

Second, Blender's Python API supports only a single render pass and it is unclear to me how to set OpenGL states (other than blending and uniform variables) for specific materials or objects. Thus, the possibilities are somewhat limited.

Third, GLSL programs are limited to Blender's game engine; thus, they are only displayed when the game is started. (This is particularly inconvenient when editing shader parameters.)

Note that the tutorials assume that you read them in the order in which they are presented here, i.e. each tutorial will assume that you are familiar with the concepts and techniques introduced by previous tutorials. If you are new to GLSL or Blender you should at least read through the tutorials in the “Basics” section.