- float cspec = pow(max(dot(r, vdir), 0.0), shininess);
+ float cspec = pow(max(dot(r, vdir), 0.0), shininess); */
+
+ float dist = -pos.z;
+ float fog = clamp(exp(-fog_density * dist), 0.0, 1.0);
+
+ vec4 texel = texture2D(tex, tex_coord);
+
+ // vec3 object_color = (diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec) * itexel.xyz;
+ vec3 object_color = diffuse.xyz * texel.xyz * itexel.xyz;