ec3fd4fa13
The specular map is embedded in the alpha component of texture. Alpha value of 1. means no specular, alpha of 0. means 100% specular. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14786 178a84e3-b1eb-0310-8ba1-8eac791a3b58
18 lines
455 B
GLSL
18 lines
455 B
GLSL
uniform sampler2D diffuse;
|
|
uniform sampler2D specular;
|
|
uniform sampler2D ambient_occlusion;
|
|
uniform sampler2D specular_map;
|
|
uniform vec3 ambient;
|
|
|
|
void main()
|
|
{
|
|
vec2 texc = gl_TexCoord[0].xy;
|
|
|
|
vec3 diffuse = texture2D(diffuse, texc).xyz;
|
|
vec3 spec = texture2D(specular, texc).xyz;
|
|
float specmap = texture2D(specular_map, texc).x;
|
|
float ao = texture2D(ambient_occlusion, texc).x;
|
|
|
|
gl_FragColor = vec4(diffuse + spec * specmap + ao * ambient, 1.0);
|
|
}
|