nuclear@60: /* multipass renderer shader 2: RGB: diffuse color, A: shininess str. */ nuclear@60: nuclear@60: uniform sampler2D tex_dif; nuclear@60: nuclear@60: varying vec3 pos, norm, tang; nuclear@60: nuclear@60: const float fog_start = 3.0; nuclear@60: const float fog_end = 6.0; nuclear@60: nuclear@60: void main() nuclear@60: { nuclear@60: float fog = clamp((fog_end + pos.z) / (fog_end - fog_start), 0.0, 1.0); nuclear@60: nuclear@60: vec4 texel = texture2D(tex_dif, gl_TexCoord[0].st); nuclear@60: vec3 diffuse = fog * (gl_FrontMaterial.diffuse * texel).xyz; nuclear@60: vec3 spec = fog * gl_FrontMaterial.specular.xyz; nuclear@60: float sstr = (spec.x + spec.y + spec.z) / 3.0; nuclear@60: nuclear@60: gl_FragColor = vec4(diffuse, sstr); nuclear@60: }