#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 vec3 lighting; #define MAX_LIGHTS 8 vec3 doLighting(vec3 viewPos, vec3 viewNormal, vec3 vertexColor) { vec3 lightDir; float d; #if @colorMode == 2 vec3 diffuse = vertexColor; vec3 ambient = vertexColor; #else vec3 diffuse = gl_FrontMaterial.diffuse.xyz; vec3 ambient = gl_FrontMaterial.ambient.xyz; #endif vec3 lightResult = vec3(0.0, 0.0, 0.0); for (int i=0; i