nuclear@1: uniform sampler2D tex; nuclear@1: nuclear@1: varying vec3 vpos; nuclear@1: varying vec2 texcoord; nuclear@1: nuclear@1: void main() nuclear@1: { nuclear@1: vec4 tex = texture2D(tex, texcoord.xy); nuclear@1: nuclear@1: float fog = clamp(40.0 / (vpos.z * vpos.z), 0.0, 1.0); nuclear@1: nuclear@1: gl_FragColor.rgb = tex.rgb * fog; nuclear@1: gl_FragColor.a = tex.a; nuclear@1: }