1
0
Fork 0
forked from fte/fteqw
fteqw/engine/shaders/hlsl9/drawflat_wall.hlsl
Spoike 5b4756f3d9 Lazy GLSL loading, for faster load times.
Fixed some xim issues, for proper keyboard input under x11.
Cmake project can now work for cross compiling win32 targets.
Some other fun-but-pointless stuff.



git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5344 fc73d0e0-1445-4013-8a0c-d673dee63da5
2018-11-27 16:48:19 +00:00

37 lines
810 B
HLSL

!!cvard3 r_floorcolour
!!cvard3 r_wallcolour
!!samps 1
//FIXME !!permu FOG
struct a2v {
float4 pos: POSITION;
float2 lmtc: TEXCOORD1;
float3 normal: NORMAL;
};
struct v2f {
#ifndef FRAGMENT_SHADER
float4 pos: POSITION;
#endif
float2 lmtc: TEXCOORD0;
float4 col: TEXCOORD1; //tc not colour to preserve range for oversaturation
};
#ifdef VERTEX_SHADER
float4x4 m_modelviewprojection;
float4 e_lmscale;
v2f main (a2v inp)
{
v2f outp;
outp.pos = mul(m_modelviewprojection, inp.pos);
outp.lmtc = inp.lmtc;
outp.col = e_lmscale * float4(((inp.normal.z < 0.73)?r_wallcolour:r_floorcolour)/255.0, 1.0);
return outp;
}
#endif
#ifdef FRAGMENT_SHADER
sampler s_t0;
float4 main (v2f inp) : COLOR0
{
return inp.col * tex2D(s_t0, inp.lmtc).xyzw;
}
#endif