"e", "\tvec4 reflection = textureCube(environment, n_normal*(dot(n_normal, v_eye_dir)*2.0)-v_eye_dir);\n",
"t", "\tvec4 tex_sample = texture2D(texture, v_texcoord);\n",
0, "\tgl_FragColor.rgb = ",
- "!t!l!m", "vec3(1.0)",
+ "!t!m", "vec3(1.0)",
"t", "tex_sample.rgb",
"l|mt", "*",
+ "l!m!t", "*",
"!lm", "v_color.rgb",
"l", "((l_diffuse",
"lm", "*gl_FrontLightProduct[0].diffuse.rgb",
"e", "+reflection.rgb*reflectivity",
0, ";\n",
0, "\tgl_FragColor.a = ",
- "!m", "1.0",
+ "!t!m", "1.0",
+ "t", "tex_sample.a",
+ "tm", "*",
"!lm", "v_color.a",
"lm", "gl_FrontMaterial.diffuse.a",
- "t", "*tex_sample.a",
0, ";\n",
0, "}\n",
0, 0
{
init();
- attach_shader_owned(new Shader(VERTEX_SHADER, vert));
- attach_shader_owned(new Shader(FRAGMENT_SHADER, frag));
+ attach_shader_owned(new VertexShader(vert));
+ attach_shader_owned(new FragmentShader(frag));
link();
}
string flags = features.create_flags();
string vertex_src = process_standard_source(standard_vertex_src, flags);
string fragment_src = process_standard_source(standard_fragment_src, flags);
- attach_shader_owned(new Shader(VERTEX_SHADER, vertex_src));
- attach_shader_owned(new Shader(FRAGMENT_SHADER, fragment_src));
+ attach_shader_owned(new VertexShader(vertex_src));
+ attach_shader_owned(new FragmentShader(fragment_src));
}
string Program::process_standard_source(const char **source, const string &flags)
void Program::Loader::fragment_shader(const string &src)
{
- obj.attach_shader_owned(new Shader(FRAGMENT_SHADER, src));
+ obj.attach_shader_owned(new FragmentShader(src));
}
void Program::Loader::standard()
void Program::Loader::vertex_shader(const string &src)
{
- obj.attach_shader_owned(new Shader(VERTEX_SHADER, src));
+ obj.attach_shader_owned(new VertexShader(src));
}