Explorar el Código

Fixed shader for duplicate skinning code

seanpaultaylor hace 12 años
padre
commit
e19224c602

+ 1 - 1
gameplay/res/shaders/lighting.frag

@@ -10,7 +10,7 @@ vec3 computeLighting(vec3 normalVector, vec3 lightDirection, vec3 lightColor, fl
     vec3 vertexToEye = normalize(v_cameraDirection); 
     vec3 vertexToEye = normalize(v_cameraDirection); 
     vec3 halfDirection = normalize(lightDirection + v_cameraDirection);
     vec3 halfDirection = normalize(lightDirection + v_cameraDirection);
     float specularAngle = max(dot(halfDirection, normalVector), 0.0);
     float specularAngle = max(dot(halfDirection, normalVector), 0.0);
-    vec3 specularColor = pow(specularAngle, u_specularExponent);
+    vec3 specularColor = vec3(pow(specularAngle, u_specularExponent));
 
 
     return (diffuseColor + specularColor) * attenuation;
     return (diffuseColor + specularColor) * attenuation;
 
 

+ 0 - 27
gameplay/res/shaders/skinning.vert

@@ -82,30 +82,3 @@ vec3 getBinormal()
 
 
 #endif
 #endif
 
 
-#else
-
-vec4 getPosition()
-{
-    return a_position;    
-}
-
-#if defined(LIGHTING)
-
-vec3 getNormal()
-{
-    return a_normal;
-}
-
-#if defined(BUMPED)
-vec3 getTangent()
-{
-    return a_tangent;
-}
-
-vec3 getBinormal()
-{
-    return a_binormal;
-}
-#endif
-
-#endif

+ 0 - 2
gameplay/src/Effect.cpp

@@ -253,8 +253,6 @@ Effect* Effect::createFromSource(const char* vshPath, const char* vshSource, con
         replaceIncludes(vshPath, vshSource, vshSourceStr);
         replaceIncludes(vshPath, vshSource, vshSourceStr);
         if (vshSource && strlen(vshSource) != 0)
         if (vshSource && strlen(vshSource) != 0)
             vshSourceStr += "\n";
             vshSourceStr += "\n";
-            
-        //writeShaderToErrorFile(vshPath, vshSourceStr.c_str());   // Debugging
     }
     }
     shaderSource[2] = vshPath ? vshSourceStr.c_str() :  vshSource;
     shaderSource[2] = vshPath ? vshSourceStr.c_str() :  vshSource;
     GL_ASSERT( vertexShader = glCreateShader(GL_VERTEX_SHADER) );
     GL_ASSERT( vertexShader = glCreateShader(GL_VERTEX_SHADER) );