GLSL Programming/Blender

< GLSL Programming

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”).

Preliminaries

Blender can be downloaded at the Blender Foundation's download page. Some points should be noted:

Tutorials

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.

Basics

Transparent Surfaces

Basic Lighting

Basic Texturing

Advanced Texturing


The most important documentation for programming GLSL in Blender appears to be:

There is a script to export the vertex and fragment shaders of Blender's internal GLSL programs. However, these shaders (and the uniforms they use) are generated automatically; thus, they are not very readable and not well suited for learning GLSL: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Game_Engine/Export_GLSL

GLSL Shaders for Image Postprocessing


< GLSL Programming

Unless stated otherwise, all example source code on this page is granted to the public domain.
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.