"l!n", "varying vec3 v_normal;\n",
"l", "varying vec3 v_light_dir;\n",
"p", "varying vec3 v_eye_dir;\n",
+ "r", "vec4 transform_vertex(vec4);\n",
+ "lr", "vec3 transform_normal(vec3);\n",
0, "void main()\n",
0, "{\n",
- 0, "\tvec4 eye_pos = gl_ModelViewMatrix*gl_Vertex;\n",
+ "r", "\tvec4 eye_pos = transform_vertex(gl_Vertex);\n",
+ "!r", "\tvec4 eye_pos = gl_ModelViewMatrix*gl_Vertex;\n",
0, "\tgl_Position = gl_ProjectionMatrix*eye_pos;\n",
- "l", "\tvec3 eye_normal = gl_NormalMatrix*gl_Normal;\n",
+ "lr", "\tvec3 eye_normal = transform_normal(gl_Normal);\n",
+ "l!r", "\tvec3 eye_normal = gl_NormalMatrix*gl_Normal;\n",
"l!n", "\tv_normal = eye_normal;\n",
"n", "\tvec3 eye_tangent = gl_NormalMatrix*tangent;\n",
"n", "\tvec3 eye_binormal = gl_NormalMatrix*binormal;\n",
lighting(false),
specular(false),
normalmap(false),
- shadow(false)
+ shadow(false),
+ transform(false)
{ }
string Program::StandardFeatures::create_flags() const
}
if(shadow)
flags += 's';
+ if(transform)
+ flags += 'r';
return flags;
}
add("shadow", &StandardFeatures::shadow);
add("specular", &StandardFeatures::specular);
add("texture", &StandardFeatures::texture);
+ add("transform", &StandardFeatures::transform);
}
} // namespace GL