Review uniform name
This commit is contained in:
parent
9417b9969d
commit
4dfffff19b
5 changed files with 10 additions and 10 deletions
|
@ -8,14 +8,14 @@ varying vec4 fragColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 fragTintColor;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// NOTE: Add here your custom variables
|
// NOTE: Add here your custom variables
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
// Texel color fetching from texture sampler
|
// 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
|
// Convert texel color to grayscale using NTSC conversion weights
|
||||||
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
|
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
|
||||||
|
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 fragTintColor;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// NOTE: Add here your custom variables
|
// NOTE: Add here your custom variables
|
||||||
|
|
||||||
|
@ -19,5 +19,5 @@ void main()
|
||||||
|
|
||||||
// NOTE: Implement here your fragment shader code
|
// NOTE: Implement here your fragment shader code
|
||||||
|
|
||||||
gl_FragColor = texelColor*fragTintColor;
|
gl_FragColor = texelColor*colDiffuse;
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@ in vec4 fragColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 fragTintColor;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// Output fragment color
|
// Output fragment color
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
@ -16,7 +16,7 @@ out vec4 finalColor;
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
// Texel color fetching from texture sampler
|
// 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
|
// Convert texel color to grayscale using NTSC conversion weights
|
||||||
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
|
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
|
||||||
|
|
|
@ -6,7 +6,7 @@ in vec3 fragNormal;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 fragTintColor;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// Output fragment color
|
// Output fragment color
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
@ -44,7 +44,7 @@ vec3 DiffuseLighting(in vec3 N, in vec3 L)
|
||||||
// Lambertian reflection calculation
|
// Lambertian reflection calculation
|
||||||
float diffuse = clamp(dot(N, L), 0, 1);
|
float diffuse = clamp(dot(N, L), 0, 1);
|
||||||
|
|
||||||
return (fragTintColor.xyz*lightDiffuseColor*lightIntensity*diffuse);
|
return (colDiffuse.xyz*lightDiffuseColor*lightIntensity*diffuse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate specular lighting component
|
// Calculate specular lighting component
|
||||||
|
|
|
@ -6,7 +6,7 @@ in vec4 fragColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 fragTintColor;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// Output fragment color
|
// Output fragment color
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
@ -20,5 +20,5 @@ void main()
|
||||||
|
|
||||||
// NOTE: Implement here your fragment shader code
|
// NOTE: Implement here your fragment shader code
|
||||||
|
|
||||||
finalColor = texelColor*fragTintColor;
|
finalColor = texelColor*colDiffuse;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue