dungeon_crawler

diff prototype/sdr/fallback.p.glsl @ 43:3fef65352b0b

- added mipmap generation
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 30 Aug 2012 05:58:09 +0300
parents acfe0c0110fc
children
line diff
     1.1 --- a/prototype/sdr/fallback.p.glsl	Thu Aug 30 05:38:03 2012 +0300
     1.2 +++ b/prototype/sdr/fallback.p.glsl	Thu Aug 30 05:58:09 2012 +0300
     1.3 @@ -5,6 +5,11 @@
     1.4  const float fog_start = 3.0;
     1.5  const float fog_end = 6.0;
     1.6  
     1.7 +const vec3 lpos = vec3(0.0, 0.0, -0.5);
     1.8 +const vec3 vdir = vec3(0.0, 0.0, 1.0);
     1.9 +
    1.10 +const vec3 lcol = vec3(1.0, 0.732, 0.437);
    1.11 +
    1.12  void main()
    1.13  {
    1.14  	vec3 texel = texture2D(tex_dif, gl_TexCoord[0].st).xyz;
    1.15 @@ -18,11 +23,7 @@
    1.16  			t.y, b.y, n.y,
    1.17  			t.z, b.z, n.z);
    1.18  
    1.19 -
    1.20 -	const vec3 lpos = vec3(0.0, 0.0, -0.5);
    1.21  	vec3 ldir = tbn_mat * normalize(lpos - pos);
    1.22 -
    1.23 -	const vec3 vdir = vec3(0.0, 0.0, 1.0);
    1.24  	vec3 hvec = normalize(vdir + ldir);
    1.25  
    1.26  	n = normalize(texture2D(tex_norm, gl_TexCoord[0].st).xyz * 2.0 - 1.0);
    1.27 @@ -34,5 +35,5 @@
    1.28  
    1.29  	float fog = clamp((fog_end + pos.z) / (fog_end - fog_start), 0.0, 1.0);
    1.30  
    1.31 -	gl_FragColor = vec4((diffuse + specular) * fog, 1.0);
    1.32 +	gl_FragColor = vec4((diffuse + specular) * lcol * fog, 1.0);
    1.33  }