#version 120 #if @diffuseMap varying vec2 diffuseMapUV; #endif #if @darkMap varying vec2 darkMapUV; #endif #if @detailMap varying vec2 detailMapUV; #endif #if @emissiveMap varying vec2 emissiveMapUV; #endif varying float depth; varying vec4 lighting; #define MAX_LIGHTS 8 vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor) { vec3 lightDir; float d; #if @colorMode == 2 vec4 diffuse = vertexColor; vec3 ambient = vertexColor.xyz; #else vec4 diffuse = gl_FrontMaterial.diffuse; vec3 ambient = gl_FrontMaterial.ambient.xyz; #endif vec4 lightResult = vec4(0.0, 0.0, 0.0, diffuse.a); for (int i=0; i