=== modified file 'data/shaders/light-advanced.frag'
@@ -8,7 +8,7 @@
uniform vec3 MaterialAmbient;
uniform vec3 MaterialDiffuse;
uniform vec3 MaterialSpecular;
-uniform vec3 MaterialColor;
+uniform vec4 MaterialColor;
varying vec3 Normal;
varying vec3 Light;
@@ -32,5 +32,5 @@
// Calculate the final color
gl_FragColor = vec4(ambient, 1.0) + vec4(specular, 1.0) +
- vec4(diffuse, 1.0) * vec4(MaterialColor, 1.0);
+ vec4(diffuse, 1.0) * MaterialColor;
}
=== modified file 'data/shaders/light-basic.vert'
@@ -5,7 +5,7 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 NormalMatrix;
uniform vec4 LightSourcePosition;
-uniform vec3 MaterialColor;
+uniform vec4 MaterialColor;
varying vec4 Color;
varying vec2 TextureCoord;
@@ -21,7 +21,7 @@
// Multiply the diffuse value by the vertex color (which is fixed in this case)
// to get the actual color that we will use to draw this vertex with
float diffuse = max(dot(N, L), 0.0);
- Color = diffuse * vec4(MaterialColor, 1.0);
+ Color = diffuse * MaterialColor;
// Set the texture coordinates as a varying
TextureCoord = texcoord;
=== modified file 'src/scenebuild.cpp'
@@ -85,7 +85,7 @@
glUniform3fv(mShader.mLocations.LightSourceAmbient, 1, lightAmbient);
glUniform3fv(mShader.mLocations.LightSourceDiffuse, 1, lightDiffuse);
- glUniform3fv(mShader.mLocations.MaterialColor, 1, materialColor);
+ glUniform4fv(mShader.mLocations.MaterialColor, 1, materialColor);
mCurrentFrame = 0;
mRunning = true;
=== modified file 'src/sceneshading.cpp'
@@ -99,7 +99,7 @@
glUniform3fv(mShader[mCurrentPart].mLocations.MaterialAmbient, 1, materialAmbient);
glUniform3fv(mShader[mCurrentPart].mLocations.MaterialDiffuse, 1, materialDiffuse);
glUniform3fv(mShader[mCurrentPart].mLocations.MaterialSpecular, 1, materialSpecular);
- glUniform3fv(mShader[mCurrentPart].mLocations.MaterialColor, 1, materialColor);
+ glUniform4fv(mShader[mCurrentPart].mLocations.MaterialColor, 1, materialColor);
// Calculate and load the half vector
Vector3f halfVector = Vector3f(lightPosition[0], lightPosition[1], lightPosition[2]);
=== modified file 'src/scenetexture.cpp'
@@ -91,7 +91,7 @@
glUniform3fv(mShader.mLocations.LightSourceAmbient, 1, lightAmbient);
glUniform3fv(mShader.mLocations.LightSourceDiffuse, 1, lightDiffuse);
- glUniform3fv(mShader.mLocations.MaterialColor, 1, materialColor);
+ glUniform4fv(mShader.mLocations.MaterialColor, 1, materialColor);
mCurrentFrame = 0;
mRunning = true;