1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/files/shaders/objects_fragment.glsl

21 lines
423 B
Plaintext
Raw Normal View History

#version 120
#if @diffuseMap
uniform sampler2D diffuseMap;
varying vec2 diffuseMapUV;
#endif
2016-02-16 22:32:59 +01:00
varying float depth;
void main()
{
#if @diffuseMap
gl_FragData[0] = texture2D(diffuseMap, diffuseMapUV);
#else
2016-02-16 22:32:59 +01:00
gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
#endif
2016-02-16 22:32:59 +01:00
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);
}