Added test_patchblend example map.
This commit is contained in:
parent
6038c04591
commit
d79ab058cf
5 changed files with 171 additions and 6 deletions
|
@ -65,33 +65,53 @@ varying vec2 lm1, lm2, lm3;
|
|||
#include "sys/fog.h"
|
||||
#include "sys/pcf.h"
|
||||
|
||||
vec3 lightmap_fragment (vec3 normal_f)
|
||||
vec3 lightmap_fragment()
|
||||
{
|
||||
vec3 lightmaps;
|
||||
|
||||
#ifdef LIGHTSTYLED
|
||||
lightmaps = texture2D(s_lightmap0, lm0).rgb * e_lmscale[0].rgb;
|
||||
lightmaps += texture2D(s_lightmap1, lm1).rgb * e_lmscale[1].rgb;
|
||||
lightmaps += texture2D(s_lightmap2, lm2).rgb * e_lmscale[2].rgb;
|
||||
lightmaps += texture2D(s_lightmap3, lm3).rgb * e_lmscale[3].rgb;
|
||||
#else
|
||||
lightmaps = texture2D(s_lightmap, lm0).rgb * e_lmscale.rgb;
|
||||
#endif
|
||||
return lightmaps;
|
||||
}
|
||||
|
||||
vec3 lightmap_fragment(vec3 normal_f)
|
||||
{
|
||||
#ifndef DELUXE
|
||||
return lightmap_fragment();
|
||||
#else
|
||||
vec3 lightmaps;
|
||||
|
||||
#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 )
|
||||
{
|
||||
vec4 diff1_f = texture2D( s_t0, tex_c);
|
||||
vec4 diff2_f = texture2D( s_t1, tex_c);
|
||||
vec3 normal1_f = normalize(texture2D(s_t4, tex_c).rgb - 0.5);
|
||||
vec3 normal2_f = normalize(texture2D(s_t5, tex_c).rgb - 0.5);
|
||||
vec3 normal1_f = normalize(texture2D(s_t2, tex_c).rgb - 0.5);
|
||||
vec3 normal2_f = normalize(texture2D(s_t3, tex_c).rgb - 0.5);
|
||||
float alpha = 1.0;
|
||||
float bw = 1.0 - (diff2_f.r + diff2_f.g + diff2_f.b) / 3.0;
|
||||
|
||||
if (vex_color.a < 1.0) {
|
||||
if (bw > vex_color.a) {
|
||||
alpha = vex_color.a;
|
||||
alpha = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
BIN
platform/test_maps.pk3dir/maps/test_patchblend.bsp
Normal file
BIN
platform/test_maps.pk3dir/maps/test_patchblend.bsp
Normal file
Binary file not shown.
122
platform/test_maps.pk3dir/maps/test_patchblend.map
Normal file
122
platform/test_maps.pk3dir/maps/test_patchblend.map
Normal file
|
@ -0,0 +1,122 @@
|
|||
|
||||
// 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 ) skies/yukongold [ 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 ) skies/yukongold [ 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 ) skies/yukongold [ 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 ) skies/yukongold [ 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 ) skies/yukongold [ 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 ) skies/yukongold [ 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
|
||||
}
|
||||
// brush 6
|
||||
{
|
||||
patchDef3WS
|
||||
{
|
||||
next/rusty1_to_rusty5
|
||||
( 3 3 0 0 0 0 0 )
|
||||
(
|
||||
( ( 192 -160 64 0 0 ) ( 192 -160 0 0 -0.5 1 1 1 0.6000000238 ) ( 192 -160 -64 0 -1 1 1 1 0.25 ) )
|
||||
( ( 192 -96 64 0.6172839999 0 ) ( 192 -96 0 0.6172839999 -0.5 1 1 1 0.5 ) ( 192 -96 -64 0.6172839999 -1 1 1 1 0 ) )
|
||||
( ( 192 -32 64 1.2345679998 0 ) ( 192 -32 0 1.2345679998 -0.5 1 1 1 0.75 ) ( 192 -32 -64 1.2345679998 -1 1 1 1 0 ) )
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// entity 1
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
}
|
||||
// entity 2
|
||||
{
|
||||
"classname" "info_player_deathmatch"
|
||||
}
|
||||
// entity 3
|
||||
{
|
||||
"classname" "light"
|
||||
"origin" "128.000000 0.000000 64.000000"
|
||||
"light" "100"
|
||||
}
|
||||
// entity 4
|
||||
{
|
||||
"classname" "light"
|
||||
"origin" "-128.000000 0.000000 64.000000"
|
||||
"light" "100"
|
||||
}
|
||||
// entity 5
|
||||
{
|
||||
"classname" "func_group"
|
||||
"_cs" "0"
|
||||
// brush 0
|
||||
{
|
||||
patchDef3WS
|
||||
{
|
||||
next/earth7_terrain
|
||||
( 3 3 4 4 0 0 0 )
|
||||
(
|
||||
( ( 64 0 -60 0 0 1 1 1 0 ) ( 64 64 -60 0 -0.25 1 1 1 0 ) ( 64 128 -60 0 -0.5 1 1 1 0 ) )
|
||||
( ( 128 0 -60 0.25 0 1 1 1 0 ) ( 128 64 -60 0.25 -0.25 1 1 1 0.25 ) ( 128 128 -60 0.25 -0.5 ) )
|
||||
( ( 192 0 -60 0.5 0 ) ( 192 64 -60 0.5 -0.25 ) ( 192 128 -60 0.5 -0.5 ) )
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// entity 6
|
||||
{
|
||||
"classname" "point_message"
|
||||
"origin" "128.000000 64.000000 -40.000000"
|
||||
"message" "dynamic texture to alpha blending"
|
||||
}
|
||||
// entity 7
|
||||
{
|
||||
"classname" "point_message"
|
||||
"origin" "96.000000 -128.000000 -8.000000"
|
||||
"message" "dynamic texture blending"
|
||||
}
|
10
platform/test_maps.pk3dir/textures/next/earth7_terrain.mat
Normal file
10
platform/test_maps.pk3dir/textures/next/earth7_terrain.mat
Normal file
|
@ -0,0 +1,10 @@
|
|||
// Vera Visions Material
|
||||
{
|
||||
polygonOffset 1
|
||||
diffusemap textures/next/earth7.tga
|
||||
|
||||
{
|
||||
program terrain_alpha
|
||||
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
}
|
||||
}
|
13
platform/test_maps.pk3dir/textures/next/rusty1_to_rusty5.mat
Normal file
13
platform/test_maps.pk3dir/textures/next/rusty1_to_rusty5.mat
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Vera Visions Material
|
||||
{
|
||||
qer_editorImage "textures/next/rusty1.tga"
|
||||
polygonOffset 1
|
||||
|
||||
{
|
||||
program terrain
|
||||
map "textures/next/rusty5.tga"
|
||||
map "textures/next/rusty7.tga"
|
||||
map $normalmap
|
||||
map $normalmap
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue