Removed colTint, tint color is colDiffuse
Tint color could be applied to colDiffuse... but what's the best way? Replace it? Multiply by? A point to think about...
This commit is contained in:
parent
cac2a66deb
commit
302ec438dd
7 changed files with 19 additions and 26 deletions
|
@ -6,7 +6,7 @@ in vec4 fragColor;
|
|||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 fragTintColor;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// Output fragment color
|
||||
out vec4 finalColor;
|
||||
|
@ -16,7 +16,7 @@ out vec4 finalColor;
|
|||
void main()
|
||||
{
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor = texture(texture0, fragTexCoord)*fragTintColor*fragColor;
|
||||
vec4 texelColor = texture(texture0, fragTexCoord)*colDiffuse*fragColor;
|
||||
|
||||
// Convert texel color to grayscale using NTSC conversion weights
|
||||
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
|
||||
|
|
|
@ -11,7 +11,6 @@ uniform sampler2D texture0;
|
|||
uniform sampler2D texture1;
|
||||
uniform sampler2D texture2;
|
||||
|
||||
uniform vec4 colTint;
|
||||
uniform vec4 colAmbient;
|
||||
uniform vec4 colDiffuse;
|
||||
uniform vec4 colSpecular;
|
||||
|
@ -55,7 +54,7 @@ vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s)
|
|||
spec = pow(dot(n, h), 3 + glossiness)*s;
|
||||
}
|
||||
|
||||
return (diff*l.diffuse.rgb*colDiffuse.rgb + spec*colSpecular.rgb);
|
||||
return (diff*l.diffuse.rgb + spec*colSpecular.rgb);
|
||||
}
|
||||
|
||||
vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)
|
||||
|
@ -74,7 +73,7 @@ vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)
|
|||
}
|
||||
|
||||
// Combine results
|
||||
return (diff*l.intensity*l.diffuse.rgb*colDiffuse.rgb + spec*colSpecular.rgb);
|
||||
return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);
|
||||
}
|
||||
|
||||
vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)
|
||||
|
@ -150,5 +149,5 @@ void main()
|
|||
}
|
||||
|
||||
// Calculate final fragment color
|
||||
finalColor = vec4(texelColor.rgb*lighting*colTint.rgb, texelColor.a*colTint.a);
|
||||
finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue