make sure these don't get forgotten about.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4111 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-10-07 18:38:22 +00:00
parent 35c6aecad2
commit 5ec2ce589b
2 changed files with 43 additions and 15 deletions

View file

@ -1,7 +1,8 @@
!!permu OFFSETMAPPING !!permu DELUXE
!!permu FULLBRIGHT !!permu FULLBRIGHT
!!permu FOG !!permu FOG
!!permu LIGHTSTYLED !!permu LIGHTSTYLED
!!permu BUMP
!!cvarf r_glsl_offsetmapping_scale !!cvarf r_glsl_offsetmapping_scale
//this is what normally draws all of your walls, even with rtlights disabled //this is what normally draws all of your walls, even with rtlights disabled
@ -57,18 +58,22 @@ void main ()
#ifdef FRAGMENT_SHADER #ifdef FRAGMENT_SHADER
//samplers //samplers
uniform sampler2D s_t0; uniform sampler2D s_t0; //diffuse
uniform sampler2D s_t1; uniform sampler2D s_t1; //lightmap0
#ifdef OFFSETMAPPING #if defined(OFFSETMAPPING) || defined(DELUXE)
uniform sampler2D s_t2; uniform sampler2D s_t2; //normal
#endif #endif
uniform sampler2D s_t3; //deluxe0
#ifdef FULLBRIGHT #ifdef FULLBRIGHT
uniform sampler2D s_t4; uniform sampler2D s_t4; //fullbright
#endif #endif
#ifdef LIGHTSTYLED #ifdef LIGHTSTYLED
uniform sampler2D s_t5; uniform sampler2D s_t5; //lightmap1
uniform sampler2D s_t6; uniform sampler2D s_t6; //lightmap2
uniform sampler2D s_t7; uniform sampler2D s_t7; //lightmap3
uniform sampler2D s_t8; //deluxe1
uniform sampler2D s_t9; //deluxe2
uniform sampler2D s_t10; //deluxe3
#endif #endif
#ifdef LIGHTSTYLED #ifdef LIGHTSTYLED
@ -82,26 +87,50 @@ uniform vec4 e_colourident;
#endif #endif
void main () void main ()
{ {
//adjust texture coords for offsetmapping
#ifdef OFFSETMAPPING #ifdef OFFSETMAPPING
vec2 tcoffsetmap = offsetmap(s_t2, tc, eyevector); vec2 tcoffsetmap = offsetmap(s_t2, tc, eyevector);
#define tc tcoffsetmap #define tc tcoffsetmap
#endif #endif
//yay, regular texture!
gl_FragColor = texture2D(s_t0, tc); gl_FragColor = texture2D(s_t0, tc);
//modulate that by the lightmap(s) including deluxemap(s)
#ifdef LIGHTSTYLED #ifdef LIGHTSTYLED
vec4 lightmaps; vec4 lightmaps;
lightmaps = texture2D(s_t1, lm ) * e_lmscale[0]; #ifdef DELUXE
lightmaps += texture2D(s_t5, lm2) * e_lmscale[1]; vec3 norm = texture2D(s_t2, tc).rgb;
lightmaps += texture2D(s_t6, lm3) * e_lmscale[2]; lightmaps = texture2D(s_t1, lm ) * e_lmscale[0] * dot(norm, texture2D(s_t3, lm ));
lightmaps += texture2D(s_t7, lm4) * e_lmscale[3]; lightmaps += texture2D(s_t5, lm2) * e_lmscale[1] * dot(norm, texture2D(s_t8, lm2));
lightmaps += texture2D(s_t6, lm3) * e_lmscale[2] * dot(norm, texture2D(s_t9, lm3));
lightmaps += texture2D(s_t7, lm4) * e_lmscale[3] * dot(norm, texture2D(s_t10,lm4));
#else
lightmaps = texture2D(s_t1, lm ) * e_lmscale[0];
lightmaps += texture2D(s_t5, lm2) * e_lmscale[1];
lightmaps += texture2D(s_t6, lm3) * e_lmscale[2];
lightmaps += texture2D(s_t7, lm4) * e_lmscale[3];
#endif
gl_FragColor.rgb *= lightmaps.rgb; gl_FragColor.rgb *= lightmaps.rgb;
#else #else
gl_FragColor.rgb *= (texture2D(s_t1, lm) * e_lmscale).rgb; #ifdef DELUXE
//gl_FragColor.rgb = dot(normalize(texture2D(s_t2, tc).rgb - 0.5), normalize(texture2D(s_t3, lm).rgb - 0.5));
//gl_FragColor.rgb = texture2D(s_t3, lm).rgb;
gl_FragColor.rgb *= (texture2D(s_t1, lm) * e_lmscale).rgb * dot(normalize(texture2D(s_t2, tc).rgb-0.5), 2.0*(texture2D(s_t3, lm).rgb-0.5));
#else
gl_FragColor.rgb *= (texture2D(s_t1, lm) * e_lmscale).rgb;
#endif
#endif #endif
//add on the fullbright
#ifdef FULLBRIGHT #ifdef FULLBRIGHT
gl_FragColor.rgb += texture2D(s_t4, tc).rgb; gl_FragColor.rgb += texture2D(s_t4, tc).rgb;
#endif #endif
//entity modifiers
gl_FragColor = gl_FragColor * e_colourident; gl_FragColor = gl_FragColor * e_colourident;
//and finally hide it all if we're fogged.
#ifdef FOG #ifdef FOG
gl_FragColor = fog4(gl_FragColor); gl_FragColor = fog4(gl_FragColor);
#endif #endif

View file

@ -1,6 +1,5 @@
!!permu BUMP !!permu BUMP
!!permu SPECULAR !!permu SPECULAR
!!permu OFFSETMAPPING
!!permu SKELETAL !!permu SKELETAL
!!permu FOG !!permu FOG
!!cvarf r_glsl_offsetmapping_scale !!cvarf r_glsl_offsetmapping_scale