Class ShaderProgram

java.lang.Object
rosequartz.gfx.ShaderProgram

public class ShaderProgram extends Object
Represents a shader program, consisting of a vertex shader and a fragment shader. Each shader may be made from a resource or a string containing the GLSL source code. Shader source code must be written for "#version 300" (GLSL ES & OpenGL ES 3.0), so using
#version {version}
or
precision {precision} {type};
inside the shader source code is illegal.
OpenGL Wiki on GLSL
Every shader contains additional functions provided by rosequartz:

 float getLightDiffuse(vec3 light_position, vec3 position, vec3 normal)
 float getLightDiffuse(float ambient, vec3 light_position, vec3 position, vec3 normal)
 float getLightDiffuse(vec3 light_position, float light_strength, vec3 position, vec3 normal)
 float getLightDiffuse(float ambient, vec3 light_position, float light_strength, vec3 position, vec3 normal)
 float random(vec2 xy, float seed) { return fract(tan(distance(xy * PHI, xy) * seed) * xy.x); }