mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-29 15:12:19 +00:00
r_drawflat with d3d9.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5051 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1d4ac3d103
commit
ae644d60ef
2 changed files with 58 additions and 1 deletions
|
@ -1867,9 +1867,26 @@ static void BE_ApplyUniforms(program_t *prog, int permu)
|
|||
IDirect3DDevice9_SetPixelShaderConstantF(pD3DDev9, h, param4, 3);
|
||||
break;
|
||||
|
||||
case SP_E_LMSCALE:
|
||||
Vector4Set(param4, 1, 1, 1, 1);
|
||||
if (shaderstate.curentity->model && (shaderstate.curentity->model->engineflags & MDLF_NEEDOVERBRIGHT))
|
||||
{
|
||||
extern cvar_t gl_overbright;
|
||||
const float identitylighting = 1;
|
||||
float sc = (1<<bound(0, gl_overbright.ival, 2)) * identitylighting;
|
||||
VectorSet(param4, sc, sc, sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
const float identitylighting = 1;
|
||||
VectorSet(param4, identitylighting, identitylighting, identitylighting);
|
||||
}
|
||||
param4[3] = 1;
|
||||
IDirect3DDevice9_SetVertexShaderConstantF(pD3DDev9, h, param4, 3);
|
||||
break;
|
||||
|
||||
case SP_M_ENTBONES:
|
||||
case SP_M_MODELVIEW:
|
||||
case SP_E_LMSCALE:
|
||||
case SP_E_VLSCALE:
|
||||
case SP_E_ORIGIN:
|
||||
case SP_E_GLOWMOD:
|
||||
|
|
|
@ -6706,6 +6706,46 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
|||
"\x0D\x01\x00\x00\x5E\x00\x00\x00\x5E\x00\x00\x00\x5E\x00\x00\x00\x0C\x01\x00\x00\x85\x00\x05\x00\x10\x00\x00\x00\x0E\x01\x00\x00"
|
||||
"\x0B\x01\x00\x00\x0D\x01\x00\x00\xFE\x00\x02\x00\x0E\x01\x00\x00\x38\x00\x01\x00"},
|
||||
#endif
|
||||
#ifdef D3D9QUAKE
|
||||
{QR_DIRECT3D9, 9, "drawflat_wall",
|
||||
"!!cvard3 r_floorcolour\n"
|
||||
"!!cvard3 r_wallcolour\n"
|
||||
//FIXME !!permu FOG
|
||||
|
||||
"struct a2v {\n"
|
||||
"float4 pos: POSITION;\n"
|
||||
"float2 lmtc: TEXCOORD1;\n"
|
||||
"float3 normal: NORMAL;\n"
|
||||
"};\n"
|
||||
"struct v2f {\n"
|
||||
"#ifndef FRAGMENT_SHADER\n"
|
||||
"float4 pos: POSITION;\n"
|
||||
"#endif\n"
|
||||
"float2 lmtc: TEXCOORD0;\n"
|
||||
"float4 col: TEXCOORD1; //tc not colour to preserve range for oversaturation\n"
|
||||
"};\n"
|
||||
"#ifdef VERTEX_SHADER\n"
|
||||
"float4x4 m_modelviewprojection;\n"
|
||||
"float4 e_lmscale;\n"
|
||||
"v2f main (a2v inp)\n"
|
||||
"{\n"
|
||||
"v2f outp;\n"
|
||||
"outp.pos = mul(m_modelviewprojection, inp.pos);\n"
|
||||
"outp.lmtc = inp.lmtc;\n"
|
||||
"outp.col = e_lmscale * float4(((inp.normal.z < 0.73)?r_wallcolour:r_floorcolour)/255.0, 1.0);\n"
|
||||
"return outp;\n"
|
||||
"}\n"
|
||||
"#endif\n"
|
||||
|
||||
"#ifdef FRAGMENT_SHADER\n"
|
||||
"sampler s_t0;\n"
|
||||
"float4 main (v2f inp) : COLOR0\n"
|
||||
"{\n"
|
||||
"return inp.col * tex2D(s_t0, inp.lmtc).xyzw;\n"
|
||||
"}\n"
|
||||
"#endif\n"
|
||||
},
|
||||
#endif
|
||||
#ifdef D3D11QUAKE
|
||||
{QR_DIRECT3D11, 11, "drawflat_wall",
|
||||
"!!samps lightmap\n"
|
||||
|
|
Loading…
Reference in a new issue