Add support for vertex colors in splattig shader
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10455 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
5c52a4e855
commit
fd49ecb3d6
@ -8,6 +8,7 @@ uniform sampler2D tex_detail3;
|
||||
uniform sampler2D tex_detail4;
|
||||
varying vec3 normal;
|
||||
varying vec3 lightdir2;
|
||||
varying vec4 vertex_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
@ -23,5 +24,5 @@ void main()
|
||||
splatting.b * detail2 +
|
||||
(1.0 - splatting.r - splatting.g - splatting.b) * detail3 +
|
||||
(1.0 - splatting.a) * detail4)
|
||||
* min(1.0, 0.2 + dot(lightdir2, normal)); // 0.2 is the ambient light.
|
||||
* min(1.0, 0.2 + dot(lightdir2, normal)) * vertex_color; // 0.2 is the ambient light.
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
varying vec3 normal;
|
||||
|
||||
varying vec4 vertex_color;
|
||||
varying vec3 lightdir2;
|
||||
uniform vec3 lightdir;
|
||||
|
||||
@ -8,6 +8,7 @@ void main()
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_Position = ftransform();
|
||||
vertex_color = gl_Color;
|
||||
|
||||
//normal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
normal = normalize(gl_Normal);
|
||||
|
Loading…
x
Reference in New Issue
Block a user