Synched gist at Fri Sep 29 11:01:09 PDT 2023

This commit is contained in:
Marco Cawthorne 2023-09-29 11:01:09 -07:00
parent 6447ae4a1b
commit 1a892dac79
Signed by: eukara
GPG key ID: CE2032F0A2882A22
2 changed files with 78 additions and 0 deletions

42
drawportal.shader Normal file
View file

@ -0,0 +1,42 @@
blueportal
{
sort portal
surfaceparm nomarks
surfaceparm nodlight
{
program portal
map materials/models/portals/portal_mask.vtf
blendFunc blend
}
{
map materials/models/portals/portal-blue-color-dx8.vtf
blendFunc blend
}
}
redportal
{
sort portal
surfaceparm nomarks
surfaceparm nodlight
{
program portal
map materials/models/portals/portal_mask.vtf
blendFunc blend
}
{
map materials/models/portals/portal-orange-color-dx8.vtf
blendFunc blend
}
}
nodraw
{
surfaceparm nomarks
surfaceparm nodlight
surfaceparm nodraw
}

36
portal.glsl Normal file
View file

@ -0,0 +1,36 @@
//======= Copyright (c) 2023 Vera Visions LLC. All rights reserved. =======
//
// Purpose:
//
// Unlit surface.
//==============================================================================
!!ver 110
!!permu FOG
!!samps diffuse
#include "sys/defs.h"
#include "sys/fog.h"
varying vec2 tex_c;
#ifdef VERTEX_SHADER
void main ()
{
tex_c = v_texcoord;
gl_Position = ftetransform();
}
#endif
#ifdef FRAGMENT_SHADER
void main ()
{
vec4 d_f = vec4(1.0, 1.0, 1.0, 1.0) - texture2D( s_diffuse, tex_c );
if (d_f.a > 0.5) {
discard;
}
gl_FragColor = fog4( d_f );
}
#endif