瀏覽代碼

Merge pull request #1218 from seanpaultaylor/next

Fixed shader for duplicate skinning code
Sean Taylor 12 年之前
父節點
當前提交
49ab0866ca
共有 3 個文件被更改,包括 1 次插入30 次删除
  1. 1 1
      gameplay/res/shaders/lighting.frag
  2. 0 27
      gameplay/res/shaders/skinning.vert
  3. 0 2
      gameplay/src/Effect.cpp

+ 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 halfDirection = normalize(lightDirection + v_cameraDirection);
     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;
 

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

@@ -82,30 +82,3 @@ vec3 getBinormal()
 
 #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);
         if (vshSource && strlen(vshSource) != 0)
             vshSourceStr += "\n";
-            
-        //writeShaderToErrorFile(vshPath, vshSourceStr.c_str());   // Debugging
     }
     shaderSource[2] = vshPath ? vshSourceStr.c_str() :  vshSource;
     GL_ASSERT( vertexShader = glCreateShader(GL_VERTEX_SHADER) );