summaryrefslogtreecommitdiff
path: root/data/glsl.cfg
diff options
context:
space:
mode:
authorxolatile2025-08-05 15:27:57 +0200
committerxolatile2025-08-05 15:27:57 +0200
commit9234eeb1d2954a3dae6c84ffa8ed8643953272c5 (patch)
treef2253bac389d743ba8582139901c782f7afde4cc /data/glsl.cfg
parenta2a16b85572b1d28b0cd4901ea7348750732a740 (diff)
downloadxolatile-badassbug-9234eeb1d2954a3dae6c84ffa8ed8643953272c5.tar.xz
xolatile-badassbug-9234eeb1d2954a3dae6c84ffa8ed8643953272c5.tar.zst
Experimental MD3 to OBJ to IQM converter and code removal, shit compiles...
Diffstat (limited to 'data/glsl.cfg')
-rw-r--r--data/glsl.cfg340
1 files changed, 1 insertions, 339 deletions
diff --git a/data/glsl.cfg b/data/glsl.cfg
index d2495eb..dac63f2 100644
--- a/data/glsl.cfg
+++ b/data/glsl.cfg
@@ -253,73 +253,6 @@ defershader 0 "decalworld" [
] [] [] [uniform sampler2D decal;]
]
-glowshader = [
- defershader 0 $arg1 [
- defuniformparam "glowcolor" 1 1 1 // glow color
- worldshader @arg1 [] [] [
- vec3 glow = texture2D(glowmap, texcoord0).rgb;
- glow *= glowcolor.rgb;
- gl_FragColor = diffuse*lm + vec4(glow, 0.0);
- ] [] [uniform sampler2D glowmap;]
- glareworldshader @arg1 [] [
- vec3 glow = texture2D(glowmap, texcoord0).rgb;
- glow *= glowcolor.rgb;
- float k = max(glow.r, max(glow.g, glow.b));
- gl_FragColor.rgb = min(k*k*32.0, 1.0) * glow;
- gl_FragColor.a =
- //:variantoverride texture2D(lightmap, texcoord1).a
- colorparams.a
- ;
- ] [] [
- uniform sampler2D glowmap;
- //:variant uniform sampler2D lightmap;
- ]
- ]
-]
-glowshader "glowworld"
-glowshader "glowalphaworld"
-
-defershader 0 "pulseworld" [
- defuniformparam "pulsespeed" 1 // pulse frequency (Hz)
- worldshader "pulseworld" [
- pulse = abs(fract(millis * pulsespeed.x)*2.0 - 1.0);
- ] [
- vec3 diffuse2 = texture2D(decal, texcoord0).rgb;
- diffuse.rgb = mix(diffuse.rgb, diffuse2, pulse);
- ] [] [uniform float millis; varying float pulse;] [uniform sampler2D decal;]
-]
-
-pulseglowshader = [
- defershader 0 $arg1 [
- defuniformparam "glowcolor" 1 1 1 // glow color
- defuniformparam "pulseglowspeed" 1 // pulse frequency (Hz)
- defuniformparam "pulseglowcolor" 0 0 0 // pulse glow color
- worldshader @arg1 [
- pulse = mix(glowcolor.rgb, pulseglowcolor.rgb, abs(fract(millis * pulseglowspeed.x)*2.0 - 1.0));
- ] [] [
- vec3 glow = texture2D(glowmap, texcoord0).rgb;
- gl_FragColor = diffuse*lm + vec4(glow*pulse, 0.0);
- ] [uniform float millis; varying vec3 pulse;] [uniform sampler2D glowmap;]
- glareworldshader @arg1 [
- pulse = mix(glowcolor.rgb, pulseglowcolor.rgb, abs(fract(millis * pulseglowspeed.x)*2.0 - 1.0));
- ] [
- vec3 glow = texture2D(glowmap, texcoord0).rgb;
- glow *= pulse;
- float k = max(glow.r, max(glow.g, glow.b));
- gl_FragColor.rgb = min(k*k*32.0, 1.0) * glow;
- gl_FragColor.a =
- //:variantoverride texture2D(lightmap, texcoord1).a
- colorparams.a
- ;
- ] [uniform float millis; varying vec3 pulse;] [
- uniform sampler2D glowmap;
- //:variant uniform sampler2D lightmap;
- ]
- ]
-]
-pulseglowshader "pulseglowworld"
-pulseglowshader "pulseglowalphaworld"
-
shader 0 "noglareworld" [
attribute vec4 vvertex;
uniform mat4 camprojmatrix;
@@ -371,52 +304,12 @@ shader 0 "noglarealphaworld" [
}
]
-shader 0 "depthfxworld" [
- attribute vec4 vvertex;
- uniform mat4 camprojmatrix;
- uniform vec4 depthscale, depthoffsets;
- varying vec4 depthranges;
- void main(void)
- {
- gl_Position = camprojmatrix * vvertex;
- depthranges = depthoffsets + gl_Position.w*depthscale;
- }
-] [
- varying vec4 depthranges;
- void main(void)
- {
- gl_FragColor = depthranges;
- }
-]
-
-shader 0 depthfxsplitworld [
- attribute vec4 vvertex;
- uniform mat4 camprojmatrix;
- uniform vec4 depthscale, depthoffsets;
- varying vec4 depthranges;
- void main(void)
- {
- gl_Position = camprojmatrix * vvertex;
- depthranges = depthoffsets + gl_Position.w*depthscale;
- }
-] [
- varying vec4 depthranges;
- void main(void)
- {
- vec4 ranges = vec4(depthranges.x, fract(depthranges.yzw));
- ranges.xy -= ranges.yz*vec2(0.00390625, 0.00390625);
- gl_FragColor = ranges;
- }
-]
-
// bumptype:
// o -> orthonormalize
// t -> tangent space cam
// s -> spec
// S -> spec map
// p -> parallax
-// g -> glow
-// G -> pulse glow
// a -> alpha map
btopt = [ >= (strstr $bumptype $arg1) 0 ]
@@ -425,13 +318,6 @@ bumpvariantshader = [
bumptype = $arg2
stype = (? (btopt "e") 3 1)
if (! (btopt "i")) [
- if (btopt "G") [
- defuniformparam "glowcolor" 1 1 1 // glow color
- defuniformparam "pulseglowspeed" 1 // pulse frequency (Hz)
- defuniformparam "pulseglowcolor" 0 0 0 // pulse glow color
- ] [if (btopt "g") [
- defuniformparam "glowcolor" 1 1 1 // glow color
- ]]
if (btopt "S") [
defuniformparam "specscale" 6 6 6 // spec map multiplier
] [if (btopt "s") [
@@ -440,11 +326,6 @@ bumpvariantshader = [
if (|| (btopt "p") (btopt "P")) [
defuniformparam "parallaxscale" 0.06 -0.03 // parallax scaling
]
- if (btopt "R") [
- defuniformparam "envscale" 1 1 1 // reflectivity map multiplier
- ] [if (btopt "r") [
- defuniformparam "envscale" 0.2 0.2 0.2 // reflectivity
- ]]
] [
if (btopt "s") [stype = (+ $stype 8)]
]
@@ -457,9 +338,6 @@ bumpvariantshader = [
uniform mat4 camprojmatrix;
uniform vec2 texgenscroll;
varying vec2 texcoord0, texcoord1;
- @(if (|| (btopt "t") (btopt "r")) [result [uniform vec3 camera; varying vec3 camvec;]])
- @(if (btopt "G") [result [uniform float millis; varying float pulse;]])
- @(if (btopt "r") [result [varying mat3 world;]])
void main(void)
{
gl_Position = camprojmatrix * vvertex;
@@ -482,10 +360,6 @@ bumpvariantshader = [
]])
]])
- @(if (btopt "G") [result [
- pulse = abs(fract(millis*pulseglowspeed.x)*2.0 - 1.0);
- ]])
-
@(if (|| (! (btopt "i")) (btopt "s")) [result [
//:dynlight
]])
@@ -499,11 +373,6 @@ bumpvariantshader = [
varying vec2 texcoord0, texcoord1;
uniform sampler2D diffusemap, lmcolor, lmdir;
@(if (|| (! (btopt "i")) (btopt "s") (btopt "p") (btopt "P")) [result [uniform sampler2D normalmap;]])
- @(if (|| (btopt "t") (btopt "r")) [result [varying vec3 camvec;]])
- @(if (btopt "g") [result [uniform sampler2D glowmap;]])
- @(if (btopt "G") [result [varying float pulse;]])
- @(if (btopt "r") [result [uniform samplerCube envmap; varying mat3 world;]])
- @(if (|| (! (btopt "i")) (btopt "s")) [result [uniform vec4 ambient;]])
void main(void)
{
@(if (|| (! (btopt "i")) (btopt "s")) [result [
@@ -530,28 +399,6 @@ bumpvariantshader = [
]])
@(if (|| (btopt "p") (btopt "P")) [] [result [#define dtc texcoord0]])
- @(if (|| (! (btopt "i")) (btopt "S") (btopt "a")) [result [
- vec4 diffuse = texture2D(diffusemap, dtc);
- @(if (&& (btopt "a") (! (btopt "S"))) [result [
- #define alpha diffuse.a
- ]])
- ]])
- @(if (! (btopt "i")) [result [
- diffuse.rgb *= colorparams.rgb;
- ]])
- @(if (|| (! (btopt "i")) (btopt "s") (btopt "a")) [result [
- @(if (! (btopt "P")) [
- if (&& (btopt "a") (btopt "S")) [result [
- vec4 normal = texture2D(normalmap, dtc);
- #define alpha normal.a
- #define bump normal.rgb
- ]] [result [
- vec3 bump = texture2D(normalmap, dtc).rgb;
- ]]
- ])
- bump = bump*2.0 - 1.0;
- ]])
-
@(if (btopt "s") [result [
vec3 halfangle = normalize(camdir + lmlv);
float spec = pow(clamp(dot(halfangle, bump), 0.0, 1.0), @(? (btopt "i") "128.0" "32.0"));
@@ -564,65 +411,6 @@ bumpvariantshader = [
]])
]])
- @(if (|| (! (btopt "i")) (btopt "s")) [result [
- lmc.rgb = max(lmc.rgb*clamp(dot(lmlv, bump), 0.0, 1.0), ambient.xyz);
- @(if (btopt "i") [result [
- //:dynlight lmc
-
- @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb;
- ]] [result [
- //:shadowmap lmc
- //:dynlight lmc
-
- @(? (|| (btopt "g") (btopt "r")) "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb;
- ]])
- ]])
-
- @(if (btopt "r") [result [
- vec3 rvec;
- @(if (btopt "t") [result [
- vec3 rvects = 2.0*bump*dot(camvec, bump) - camvec;
- rvec = world * rvects;
- ]] [result [
- vec3 bumpw = world * bump;
- rvec = 2.0*bumpw*dot(camvec, bumpw) - camvec;
- ]])
- vec3 reflect = textureCube(envmap, rvec).rgb;
- @@(if (btopt "R") [result [
- vec3 rmod = envscale.xyz*diffuse.a;
- ]] [result [
- #define rmod envscale.xyz
- ]])
- @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") = mix(diffuse.rgb, reflect, rmod);
- ]])
-
- @(if (btopt "a") [result [
- @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") *= alpha;
- ]])
-
- @(if (btopt "g") [result [
- vec3 glow = texture2D(glowmap, dtc).rgb;
- @@(if (btopt "G") [result [
- vec3 pulsecol = mix(glowcolor.xyz, pulseglowcolor.xyz, pulse);
- ]])
- @@(if (btopt "i") [result [
- glow *= @(? (btopt "G") "pulsecol" "glowcolor.xyz");
- float k = max(glow.r, max(glow.g, glow.b));
- k = min(k*k*32.0, 1.0);
- @(if (btopt "s") [result [
- gl_FragColor.rgb = glow*k + diffuse.rgb;
- ]] [result [
- gl_FragColor.rgb = glow*k;
- gl_FragColor.a =
- //:variantoverride texture2D(lmcolor, texcoord1).a
- colorparams.a
- ;
- ]])
- ]] [result [
- gl_FragColor.rgb = glow * @(? (btopt "G") "pulsecol" "glowcolor.xyz") + diffuse.rgb;
- ]])
- ]])
-
@(if (btopt "a") [result [
gl_FragColor.a *= alpha;
//:fog fogcolor * alpha
@@ -656,20 +444,6 @@ bumpshader "bumpspecmapalphaworld" "otsSa"
fastshader bumpspecmapalphaworld bumpalphaworld 1
altshader bumpspecmapalphaworld bumpalphaworld
-bumpshader "bumpglowworld" "g"
-bumpshader "bumpspecglowworld" "otsg"
-altshader bumpspecglowworld bumpglowworld
-bumpshader "bumpspecmapglowworld" "otsSg"
-fastshader bumpspecmapglowworld bumpglowworld 2
-altshader bumpspecmapglowworld bumpglowworld
-
-bumpshader "bumppulseglowworld" "gG"
-bumpshader "bumpspecpulseglowworld" "otsgG"
-altshader bumpspecpulseglowworld bumppulseglowworld
-bumpshader "bumpspecmappulseglowworld" "otsSgG"
-fastshader bumpspecmappulseglowworld bumppulseglowworld 2
-altshader bumpspecmappulseglowworld bumppulseglowworld
-
bumpshader "bumpparallaxworld" "pot"
fastshader bumpparallaxworld bumpworld 1
altshader bumpparallaxworld bumpworld
@@ -682,30 +456,6 @@ fastshader bumpspecmapparallaxworld bumpparallaxworld 2
fastshader bumpspecmapparallaxworld bumpworld 1
altshader bumpspecmapparallaxworld bumpworld
-bumpshader "bumpparallaxglowworld" "potg"
-fastshader bumpparallaxglowworld bumpglowworld 1
-altshader bumpparallaxglowworld bumpglowworld
-bumpshader "bumpspecparallaxglowworld" "potsg"
-fastshader bumpspecparallaxglowworld bumpparallaxglowworld 2
-fastshader bumpspecparallaxglowworld bumpglowworld 1
-altshader bumpspecparallaxglowworld bumpglowworld
-bumpshader "bumpspecmapparallaxglowworld" "potsSg"
-fastshader bumpspecmapparallaxglowworld bumpparallaxglowworld 2
-fastshader bumpspecmapparallaxglowworld bumpglowworld 1
-altshader bumpspecmapparallaxglowworld bumpglowworld
-
-bumpshader "bumpparallaxpulseglowworld" "potgG"
-fastshader bumpparallaxpulseglowworld bumppulseglowworld 1
-altshader bumpparallaxpulseglowworld bumppulseglowworld
-bumpshader "bumpspecparallaxpulseglowworld" "potsgG"
-fastshader bumpspecparallaxpulseglowworld bumpparallaxpulseglowworld 2
-fastshader bumpspecparallaxpulseglowworld bumppulseglowworld 1
-altshader bumpspecparallaxpulseglowworld bumppulseglowworld
-bumpshader "bumpspecmapparallaxpulseglowworld" "potsSgG"
-fastshader bumpspecmapparallaxpulseglowworld bumpparallaxpulseglowworld 2
-fastshader bumpspecmapparallaxpulseglowworld bumppulseglowworld 1
-altshader bumpspecmapparallaxpulseglowworld bumppulseglowworld
-
bumpshader "bumpenvworldalt" "e"
bumpshader "bumpenvworld" "eor"
altshader bumpenvworld bumpenvworldalt
@@ -717,28 +467,6 @@ bumpshader "bumpenvspecmapworld" "eotsSrR"
altshader bumpenvspecmapworld bumpenvworldalt
fastshader bumpenvspecmapworld bumpenvworldalt 2
-bumpshader "bumpenvglowworldalt" "eg"
-bumpshader "bumpenvglowworld" "eorg"
-altshader bumpenvglowworld bumpenvglowworldalt
-fastshader bumpenvglowworld bumpenvglowworldalt 2
-bumpshader "bumpenvspecglowworld" "eotsrg"
-altshader bumpenvspecglowworld bumpenvglowworldalt
-fastshader bumpenvspecglowworld bumpenvglowworldalt 2
-bumpshader "bumpenvspecmapglowworld" "eotsSrRg"
-altshader bumpenvspecmapglowworld bumpenvglowworldalt
-fastshader bumpenvspecmapglowworld bumpenvglowworldalt 2
-
-bumpshader "bumpenvpulseglowworldalt" "egG"
-bumpshader "bumpenvpulseglowworld" "eorgG"
-altshader bumpenvpulseglowworld bumpenvpulseglowworldalt
-fastshader bumpenvpulseglowworld bumpenvpulseglowworldalt 2
-bumpshader "bumpenvspecpulseglowworld" "eotsrgG"
-altshader bumpenvspecpulseglowworld bumpenvpulseglowworldalt
-fastshader bumpenvspecpulseglowworld bumpenvpulseglowworldalt 2
-bumpshader "bumpenvspecmappulseglowworld" "eotsSrRgG"
-altshader bumpenvspecmappulseglowworld bumpenvpulseglowworldalt
-fastshader bumpenvspecmappulseglowworld bumpenvpulseglowworldalt 2
-
bumpshader "bumpenvparallaxworldalt" "epot"
altshader bumpenvparallaxworldalt bumpenvworldalt
bumpshader "bumpenvparallaxworld" "epotr"
@@ -754,36 +482,6 @@ altshader bumpenvspecmapparallaxworld bumpenvparallaxworldalt
fastshader bumpenvspecmapparallaxworld bumpenvparallaxworldalt 2
fastshader bumpenvspecmapparallaxworld bumpenvworldalt 1
-bumpshader "bumpenvparallaxglowworldalt" "epotg"
-altshader bumpenvparallaxglowworldalt bumpenvglowworldalt
-bumpshader "bumpenvparallaxglowworld" "epotrg"
-altshader bumpenvparallaxglowworld bumpenvparallaxglowworldalt
-fastshader bumpenvparallaxglowworld bumpenvparallaxglowworldalt 2
-fastshader bumpenvparallaxglowworld bumpenvglowworldalt 1
-bumpshader "bumpenvspecparallaxglowworld" "epotsrg"
-altshader bumpenvspecparallaxglowworld bumpenvparallaxglowworldalt
-fastshader bumpenvspecparallaxglowworld bumpenvparallaxglowworldalt 2
-fastshader bumpenvspecparallaxglowworld bumpenvglowworldalt 1
-bumpshader "bumpenvspecmapparallaxglowworld" "epotsSrRg"
-altshader bumpenvspecmapparallaxglowworld bumpenvparallaxglowworldalt
-fastshader bumpenvspecmapparallaxglowworld bumpenvparallaxglowworldalt 2
-fastshader bumpenvspecmapparallaxglowworld bumpenvglowworldalt 1
-
-bumpshader "bumpenvparallaxpulseglowworldalt" "epotgG"
-altshader bumpenvparallaxpulseglowworldalt bumpenvpulseglowworldalt
-bumpshader "bumpenvparallaxpulseglowworld" "epotrgG"
-altshader bumpenvparallaxpulseglowworld bumpenvparallaxpulseglowpulseglowworldalt
-fastshader bumpenvparallaxpulseglowworld bumpenvparallaxpulseglowpulseglowworldalt 2
-fastshader bumpenvparallaxpulseglowworld bumpenvpulseglowworldalt 1
-bumpshader "bumpenvspecparallaxpulseglowworld" "epotsrgG"
-altshader bumpenvspecparallaxpulseglowworld bumpenvparallaxpulseglowworldalt
-fastshader bumpenvspecparallaxpulseglowworld bumpenvparallaxpulseglowworldalt 2
-fastshader bumpenvspecparallaxpulseglowworld bumpenvpulseglowworldalt 1
-bumpshader "bumpenvspecmapparallaxpulseglowworld" "epotsSrRgG"
-altshader bumpenvspecmapparallaxpulseglowworld bumpenvparallaxpulseglowworldalt
-fastshader bumpenvspecmapparallaxpulseglowworld bumpenvparallaxpulseglowworldalt 2
-fastshader bumpenvspecmapparallaxpulseglowworld bumpenvpulseglowworldalt 1
-
////////////////////////////////////////////////
//
// model shaders
@@ -973,7 +671,6 @@ modelvertexshader = [
]])
@(if (mdlopt "e") [result [
uniform mat3 modelworld;
- uniform vec2 envmapscale;
varying vec3 rvec;
varying float rmod;
]])
@@ -1031,7 +728,6 @@ modelvertexshader = [
@(if (mdlopt "e") [result [
float invfresnel = dot(camdir, mnormal);
rvec = modelworld * (2.0*invfresnel*mnormal - camdir);
- rmod = envmapscale.x*max(invfresnel, 0.0) + envmapscale.y;
]])
]])
}
@@ -1047,7 +743,6 @@ modelfragmentshader = [
@(if (mdlopt "e") [result [
#define lightvec lightdirworld
uniform vec3 lightdirworld;
- uniform vec2 envmapscale;
varying vec3 camvec;
varying mat3 world;
]] [result [
@@ -1082,11 +777,6 @@ modelfragmentshader = [
light.rgb *= 2.0;
- @(if (mdlopt "m") [result [
- vec3 masks = texture2D(tex1, texcoord0).rgb;
- vec3 glow = light.rgb * maskscale.y;
- ]])
-
@(if (mdlopt "n") [result [
vec3 normal = texture2D(tex3, texcoord0).rgb - 0.5;
@(if (mdlopt "e") [result [
@@ -1134,7 +824,6 @@ modelfragmentshader = [
vec3 camn = normalize(camvec);
float invfresnel = dot(camn, normal);
vec3 rvec = 2.0*invfresnel*normal - camn;
- float rmod = envmapscale.x*max(invfresnel, 0.0) + envmapscale.y;
]])
vec3 reflect = textureCube(tex2, rvec).rgb;
@(if (! (mdlopt "m")) [result [
@@ -1142,18 +831,6 @@ modelfragmentshader = [
]])
]])
- @(if (mdlopt "m") [result [
- @(if (mdlopt "e") [result [
- light.rgb = mix(light.rgb, glow, masks.g); // glow mask in green channel
- gl_FragColor.rgb = mix(light.rgb, reflect, rmod*masks.b); // envmap mask in blue channel
- ]] [if (mdlopt "i") [result [
- float k = min(masks.g*masks.g*maskscale.w, 1.0); // glow mask in green channel
- gl_FragColor.rgb = @(? (mdlopt "s") "glow*k + light.rgb" "glow*k");
- ]] [result [
- gl_FragColor.rgb = mix(light.rgb, glow, masks.g); // glow mask in green channel
- ]]])
- ]])
-
@(if (|| (mdlopt "i") (mdlopt "m") (mdlopt "e")) [result [
gl_FragColor.a = light.a * color.a;
]])
@@ -1169,12 +846,6 @@ modelshader = [
loop i 4 [
variantshader 0 $shadername 0 (modelvertexshader (concatword $arg1 "b") (+ $i 1)) []
]
- glaremodeltype = (strreplace (concatword $arg1 "i") "e")
- if (< (strstr $glaremodeltype "s") 0) [glaremodeltype = (strreplace $glaremodeltype "n")]
- variantshader 0 $shadername 1 (modelvertexshader $glaremodeltype) (modelfragmentshader $glaremodeltype)
- loop i 4 [
- variantshader 0 $shadername 1 (modelvertexshader (concatword $glaremodeltype "b") (+ $i 1)) 1
- ]
if (>= (strstr $arg1 "e") 0) [
altshader $shadername (modelshader (strreplace $arg1 "e"))
]
@@ -1360,15 +1031,6 @@ explosionshader = [
vec2 dtc = texcoord0 + texture2D(tex0, texcoord2).xy*0.1; // use color texture as noise to distort texcoords
vec4 diffuse = texture2D(tex0, dtc);
float blend = max(pow(clamp(1.0 - dot(texcoord1, texcoord1), 0.0, 1.0), blendparams.x), blendparams.y);
- @(if (>= (strstr $arg1 "glare") 0) [result [
- float k = blend*blend;
- diffuse.rgb *= k*8.0;
- diffuse.a *= k;
- diffuse.b += k*k;
- ]] [result [
- diffuse *= blend*4.0; // dup alpha into RGB channels + intensify and over saturate
- diffuse.b += 0.5 - blend*0.5; // blue tint
- ]])
@(if (>= (strstr $arg1 "soft") 0) [result [
gl_FragColor.rgb = diffuse.rgb * color.rgb;
@@ -1387,7 +1049,7 @@ explosionshader = [
]
]
-looplist i ["" "glare" "soft" "soft8"] [
+looplist i ["" "soft" "soft8"] [
explosionshader [explosion@i]
]