mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-12-02 08:31:55 +00:00
197f716f75
omni shadowmaps should work, but do still have issues. added colour tints to terrain, and clipped decals. fixed issue where fixed-function shaders were getting drawn with the glsl rendering functions. tweeked mvd recording code a little. don't use until next mvd-related commit. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4100 fc73d0e0-1445-4013-8a0c-d673dee63da5
45 lines
No EOL
768 B
GLSL
45 lines
No EOL
768 B
GLSL
!!permu FOG
|
|
#include "sys/fog.h"
|
|
varying vec2 tc;
|
|
varying vec2 lm;
|
|
varying vec4 vc;
|
|
|
|
#ifdef VERTEX_SHADER
|
|
attribute vec2 v_texcoord;
|
|
attribute vec2 v_lmcoord;
|
|
attribute vec4 v_colour;
|
|
void main (void)
|
|
{
|
|
tc = v_texcoord.st;
|
|
lm = v_lmcoord.st;
|
|
vc = v_colour;
|
|
gl_Position = ftetransform();
|
|
}
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef FRAGMENT_SHADER
|
|
//four texture passes
|
|
uniform sampler2D s_t0;
|
|
uniform sampler2D s_t1;
|
|
uniform sampler2D s_t2;
|
|
uniform sampler2D s_t3;
|
|
|
|
//mix values
|
|
uniform sampler2D s_t4;
|
|
|
|
|
|
void main (void)
|
|
{
|
|
vec4 m = texture2D(s_t4, lm);
|
|
|
|
gl_FragColor = fog4(vc*vec4(m.aaa,1.0)*(
|
|
texture2D(s_t0, tc)*m.r
|
|
+ texture2D(s_t1, tc)*m.g
|
|
+ texture2D(s_t2, tc)*m.b
|
|
+ texture2D(s_t3, tc)*(1.0 - (m.r + m.g + m.b))
|
|
));
|
|
}
|
|
#endif |