Browse Source

gl_Tangent and gl_Binormal

rdb 14 years ago
parent
commit
8609b6e6b1

+ 1 - 5
panda/src/glstuff/glShaderContext_src.I

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

+ 18 - 0
panda/src/glstuff/glShaderContext_src.cxx

@@ -379,6 +379,24 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
             gsg->_glBindAttribLocation(_glsl_program, i, param_name);
             gsg->_glBindAttribLocation(_glsl_program, i, param_name);
             continue;
             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") {
           if (noprefix.substr(0, 13)  == "MultiTexCoord") {
             bind._name = InternalName::get_texcoord();
             bind._name = InternalName::get_texcoord();
             bind._append_uv = atoi(inputname->get_name().substr(13).c_str());
             bind._append_uv = atoi(inputname->get_name().substr(13).c_str());