Textual Inline Expressions



Conventions of gluShaderExpr are:


//--- Texture coordinate generators
glActiveTexture(GL_TEXTURE0);
gluTexGenParabolic(GL_H0,GL_T,GL_S,GL_N);
glActiveTexture(GL_TEXTURE1);
gluTexGenParabolic(GL_L0,GL_T,GL_S,GL_N);

//--- Shader expression
glBeginShader(1);
  // Multiply a and b
  gluShaderExpr("a[0]*b[1]",a,b);

  // Load and convert c and d and multiply
  gluShaderExpr("(c[0] - 0.5)<<1 * (d[0] - 0.5)<<1",c,d);

  // Add two products, multiply by irradiance, scale
  gluShaderExpr("(E0 * (S0 + S1)) << 3");
glEndShader();

//--- Activate shader
glShader(1);