|
|
|
@ -5,6 +5,21 @@ uniform sampler2D diffuseMap;
|
|
|
|
|
varying vec2 diffuseMapUV;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if @darkMap
|
|
|
|
|
uniform sampler2D darkMap;
|
|
|
|
|
varying vec2 darkMapUV;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if @detailMap
|
|
|
|
|
uniform sampler2D detailMap;
|
|
|
|
|
varying vec2 detailMapUV;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if @emissiveMap
|
|
|
|
|
uniform sampler2D emissiveMap;
|
|
|
|
|
varying vec2 emissiveMapUV;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
varying float depth;
|
|
|
|
|
|
|
|
|
|
varying vec3 lighting;
|
|
|
|
@ -17,8 +32,20 @@ void main()
|
|
|
|
|
gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if @detailMap
|
|
|
|
|
gl_FragData[0].xyz *= texture2D(detailMap, detailMapUV).xyz * 2.0;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if @darkMap
|
|
|
|
|
gl_FragData[0].xyz *= texture2D(darkMap, darkMapUV).xyz;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
gl_FragData[0].xyz *= lighting;
|
|
|
|
|
|
|
|
|
|
#if @emissiveMap
|
|
|
|
|
gl_FragData[0].xyz += texture2D(emissiveMap, emissiveMapUV).xyz;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
float fogValue = clamp((depth - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0);
|
|
|
|
|
gl_FragData[0].xyz = mix(gl_FragData[0].xyz, gl_Fog.color.xyz, fogValue);
|
|
|
|
|
}
|
|
|
|
|