Skip to content

Commit 5f4dd6c

Browse files
committed
This entire shader here is examplemodel provided with the sdk, its essentially like a PixelLitGeneric.
I have no idea how to add it to the codebase so i'll push the files for now lol
1 parent cbb99a6 commit 5f4dd6c

7 files changed

+906
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
2+
//
3+
// Example shader that can be applied to models
4+
//
5+
//==================================================================================================
6+
7+
#include "BaseVSShader.h"
8+
#include "convar.h"
9+
#include "example_model_dx9_helper.h"
10+
11+
#ifdef GAME_SHADER_DLL
12+
DEFINE_FALLBACK_SHADER( Mod_Example_Model, Mod_Example_Model_DX9 )
13+
BEGIN_VS_SHADER( Mod_Example_Model_DX9, "Help for Example Model Shader" )
14+
#else
15+
DEFINE_FALLBACK_SHADER( Example_Model, Example_Model_DX9 )
16+
BEGIN_VS_SHADER( Example_Model_DX9, "Help for Example Model Shader" )
17+
#endif
18+
19+
BEGIN_SHADER_PARAMS
20+
SHADER_PARAM( ALPHATESTREFERENCE, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
21+
END_SHADER_PARAMS
22+
23+
void SetupVars( ExampleModel_DX9_Vars_t& info )
24+
{
25+
info.m_nBaseTexture = BASETEXTURE;
26+
info.m_nBaseTextureFrame = FRAME;
27+
info.m_nBaseTextureTransform = BASETEXTURETRANSFORM;
28+
info.m_nAlphaTestReference = ALPHATESTREFERENCE;
29+
info.m_nFlashlightTexture = FLASHLIGHTTEXTURE;
30+
info.m_nFlashlightTextureFrame = FLASHLIGHTTEXTUREFRAME;
31+
}
32+
33+
SHADER_INIT_PARAMS()
34+
{
35+
ExampleModel_DX9_Vars_t info;
36+
SetupVars( info );
37+
InitParamsExampleModel_DX9( this, params, pMaterialName, info );
38+
}
39+
40+
SHADER_FALLBACK
41+
{
42+
return 0;
43+
}
44+
45+
SHADER_INIT
46+
{
47+
ExampleModel_DX9_Vars_t info;
48+
SetupVars( info );
49+
InitExampleModel_DX9( this, params, info );
50+
}
51+
52+
SHADER_DRAW
53+
{
54+
ExampleModel_DX9_Vars_t info;
55+
SetupVars( info );
56+
DrawExampleModel_DX9( this, params, pShaderAPI, pShaderShadow, info, vertexCompression, pContextDataPtr );
57+
}
58+
59+
END_SHADER
60+

0 commit comments

Comments
 (0)