4 uniform samplerCube dstex;
8 uniform float shininess;
11 // varying vec3 normal;
13 varying vec2 tex_coord;
14 varying vec3 world_normal;
16 // const float fog_density = 0.005;
17 uniform float fog_density;
18 const vec3 sky_color = vec3(0.35, 0.5, 0.65);
24 vec4 itexel = textureCube(dstex, normalize(world_normal));
26 /* vec3 p = normalize(pos); // view space dir
27 vec3 n = normalize(normal);
28 vec3 l = normalize(ldir);
30 vec3 r = normalize(-reflect(l, n));
31 vec3 vdir = normalize(-p);
33 float cdiff = max(dot(l, n), 0.0);
34 float cspec = pow(max(dot(r, vdir), 0.0), shininess); */
37 float fog = clamp(exp(-fog_density * dist), 0.0, 1.0);
39 vec4 texel = texture2D(tex, tex_coord);
41 // vec3 object_color = (diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec) * itexel.xyz;
42 vec3 object_color = diffuse.xyz * texel.xyz * itexel.xyz;
44 color.xyz = mix(sky_color, object_color, fog);