dungeon_crawler
view prototype/sdr/multi2.p.glsl @ 63:7f52d6310317
fixed design issue with datafile_path
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 02 Oct 2012 04:52:59 +0300 |
parents | |
children |
line source
1 /* multipass renderer shader 2: RGB: diffuse color, A: shininess str. */
3 uniform sampler2D tex_dif;
5 varying vec3 pos, norm, tang;
7 const float fog_start = 3.0;
8 const float fog_end = 6.0;
10 void main()
11 {
12 float fog = clamp((fog_end + pos.z) / (fog_end - fog_start), 0.0, 1.0);
14 vec4 texel = texture2D(tex_dif, gl_TexCoord[0].st);
15 vec3 diffuse = fog * (gl_FrontMaterial.diffuse * texel).xyz;
16 vec3 spec = fog * gl_FrontMaterial.specular.xyz;
17 float sstr = (spec.x + spec.y + spec.z) / 3.0;
19 gl_FragColor = vec4(diffuse, sstr);
20 }