For advanced effects, you can program GPU shaders in OpenGL Shading Language (GLSL) and apply them to your object in Ygdrasil. This lets you do neat things like Toon Shaders, advanced fog, terrain multitexturing, etc.

A GPU shader is a program that runs on the graphics card itself. In GLSL, there are two types of shaders: Vertex Shaders, which are applied to the vertices of an object; and Fragment Shaders, which are applied to every fragment (pixel) of the object.

the Lighthouse3D GLSL Tutorial is a good introduction to GLSL.

To create a shader and use it in YG:

  1. Write a vertex shader, called "myshader.vert", or similar
  2. Write a fragment shader, called "myshader.frag"
  3. If needed, create a "uniform variables" file, called "myshader.uniform" which has parameters for the shaders
  4. Add them all to your B3D object. This goes into the "Shader" part of the b3d file:
    Shader lambert1 { diffuse 0.5 0.5 0.5 ambient 0 0 0 emissive 0 0 0 specular 0 0 0 transparency 0 reflectivity 0 alphaMode best alphaTest greater alphaThreshold 0.1 shaderLanguage GLSL vertexShader myshader.vert fragmentShader myshader.frag uniformFile myshader.uniform

    (c) Ben Chang