gl_Tangent and gl_Binormal

This commit is contained in:
rdb 2011-11-28 16:21:21 +00:00
parent a09bb8a154
commit 8609b6e6b1
2 changed files with 19 additions and 5 deletions

View File

@ -39,15 +39,11 @@ valid() {
////////////////////////////////////////////////////////////////////
// Function: GLShaderContext::uses_custom_vertex_arrays
// Access: Public
// Description: Returns false in case of GLSL, true in case of Cg.
// Description: Always true, for now.
////////////////////////////////////////////////////////////////////
INLINE bool CLP(ShaderContext)::
uses_custom_vertex_arrays() {
#ifdef OPENGLES_2
return true;
#else
return (_shader->get_language() == Shader::SL_Cg);
#endif
}
////////////////////////////////////////////////////////////////////

View File

@ -379,6 +379,24 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
gsg->_glBindAttribLocation(_glsl_program, i, param_name);
continue;
}
if (noprefix.substr(0, 7) == "Tangent") {
bind._name = InternalName::get_tangent();
if (noprefix.size() > 7) {
bind._append_uv = atoi(noprefix.substr(7).c_str());
}
s->_var_spec.push_back(bind);
gsg->_glBindAttribLocation(_glsl_program, i, param_name);
continue;
}
if (noprefix.substr(0, 8) == "Binormal") {
bind._name = InternalName::get_binormal();
if (noprefix.size() > 8) {
bind._append_uv = atoi(noprefix.substr(8).c_str());
}
s->_var_spec.push_back(bind);
gsg->_glBindAttribLocation(_glsl_program, i, param_name);
continue;
}
if (noprefix.substr(0, 13) == "MultiTexCoord") {
bind._name = InternalName::get_texcoord();
bind._append_uv = atoi(inputname->get_name().substr(13).c_str());