Misc: Added test_lightstyles to platform's base, fixed lightmapped.glsl

not calculating styles when r_deluxemapping is 0, fixed patterns being
possibly overriden upon init.
This commit is contained in:
Marco Cawthorne 2020-10-17 17:26:58 +02:00
parent e803ddbceb
commit 2b1e23a2fe
4 changed files with 84 additions and 4 deletions

View File

@ -82,17 +82,22 @@ varying vec2 lm1, lm2, lm3;
vec3 lightmap_fragment(vec3 normal_f)
{
#ifndef DELUXE
return lightmap_fragment();
#else
vec3 lightmaps;
#ifdef LIGHTSTYLED
#if defined(LIGHTSTYLED)
lightmaps = texture2D(s_lightmap0, lm0).rgb * e_lmscale[0].rgb * dot(normal_f, (texture2D(s_deluxemap0, lm0).rgb - 0.5) * 2.0);
lightmaps += texture2D(s_lightmap1, lm1).rgb * e_lmscale[1].rgb * dot(normal_f, (texture2D(s_deluxemap1, lm1).rgb - 0.5) * 2.0);
lightmaps += texture2D(s_lightmap2, lm2).rgb * e_lmscale[2].rgb * dot(normal_f, (texture2D(s_deluxemap2, lm2).rgb - 0.5) * 2.0);
lightmaps += texture2D(s_lightmap3, lm3).rgb * e_lmscale[3].rgb * dot(normal_f, (texture2D(s_deluxemap3, lm3).rgb - 0.5) * 2.0);
#else
#else
lightmaps = texture2D(s_lightmap, lm0).rgb * e_lmscale.rgb * dot(normal_f, (texture2D(s_deluxemap, lm0).rgb - 0.5) * 2.0);
#endif
#endif
return lightmaps;
#endif
}
void main (void)

Binary file not shown.

View File

@ -0,0 +1,75 @@
// entity 0
{
"classname" "worldspawn"
// brush 0
{
( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 1
{
( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 2
{
( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 3
{
( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 4
{
( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 5
{
( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
}
// entity 1
{
"classname" "info_player_start"
}
// entity 2
{
"classname" "info_player_deathmatch"
}
// entity 3
{
"classname" "light"
"origin" "192.000000 0.000000 64.000000"
"light" "100"
"pattern" "abmcfgyzmnhpazcf"
"targetname" "foobar"
}

View File

@ -114,8 +114,8 @@ light::SpawnKey(string strKey, string strValue)
void light::light(void)
{
CBaseTrigger::CBaseTrigger();
m_strPattern = "m";
CBaseTrigger::CBaseTrigger();
}
CLASSEXPORT(light_spot, light)