#include "program.h"
#include "programbuilder.h"
#include "shader.h"
+#include "vertexformat.h"
using namespace std;
{ VERTEX, "eye_binormal", "vec3", "gl_NormalMatrix*binormal", "!r" },
{ VERTEX, "eye_binormal", "vec3", "transform_normal(binormal)", "r" },
{ VERTEX, "color", "vec4", "gl_Color", 0 },
- { VERTEX, "texture_coord", "vec2", "gl_MultiTexCoord0", 0 },
+ { VERTEX, "texture_coord", "vec2", "gl_MultiTexCoord0.xy", 0 },
{ ATTRIBUTE, "tangent", "vec3", 0, 0 },
{ ATTRIBUTE, "binormal", "vec3", 0, 0 },
prog.attach_shader_owned(new VertexShader(create_source(resolved_vars, VERTEX)));
prog.attach_shader_owned(new FragmentShader(create_source(resolved_vars, FRAGMENT)));
+
+ if(features.normalmap)
+ {
+ prog.bind_attribute(get_component_type(TANGENT3), "tangent");
+ prog.bind_attribute(get_component_type(BINORMAL3), "binormal");
+ }
}
string ProgramBuilder::create_source(const list<ShaderVariable *> &variables, VariableScope scope) const