dungeon_crawler
view prototype/sdr/multi2.p.glsl @ 72:a27528035e20
- re-organized the renderer classes a bit wrt final render-target
- implemented identity color-grading palette for now
- broke particle systems....
- removed multipass renderer
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 19 Oct 2012 02:45:57 +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 }