summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/morphweight_dx9.cpp
blob: d15bdb28245224a19dd1af3280341e34f62042ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//===========================================================================//

#include "BaseVSShader.h"


#include "morphweight_vs30.inc"
#include "morphweight_ps30.inc"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

//#define V1 1

DEFINE_FALLBACK_SHADER( MorphWeight, MorphWeight_DX9 )

BEGIN_VS_SHADER_FLAGS( MorphWeight_DX9, "Help for morphweight", SHADER_NOT_EDITABLE )

	BEGIN_SHADER_PARAMS
	END_SHADER_PARAMS

	SHADER_INIT_PARAMS()
	{
	}

	SHADER_FALLBACK
	{
		return 0;
	}

	SHADER_INIT
	{
	}

	SHADER_DRAW
	{
		SHADOW_STATE
		{
			pShaderShadow->EnableDepthTest( false );
			pShaderShadow->EnableDepthWrites( false );
			pShaderShadow->EnableAlphaWrites( true );
			pShaderShadow->EnableCulling( false );
			pShaderShadow->FogMode( SHADER_FOGMODE_DISABLED );

 			DECLARE_STATIC_VERTEX_SHADER( morphweight_vs30 );
 			SET_STATIC_VERTEX_SHADER( morphweight_vs30 );
 
 			DECLARE_STATIC_PIXEL_SHADER( morphweight_ps30 );
 			SET_STATIC_PIXEL_SHADER( morphweight_ps30 );
 
			// Texcoord0 is the texcoord to write the weights into
 			// Texcoord1 contains the morph weights
			int pTexCoord[2] = { 2, 4 };

 			pShaderShadow->VertexShaderVertexFormat( VERTEX_FORMAT_USE_EXACT_FORMAT, 2, pTexCoord, 0 );
		}
		DYNAMIC_STATE
		{
 			DECLARE_DYNAMIC_VERTEX_SHADER( morphweight_vs30 );
 			SET_DYNAMIC_VERTEX_SHADER( morphweight_vs30 );
 
 			DECLARE_DYNAMIC_PIXEL_SHADER( morphweight_ps30 );
 			SET_DYNAMIC_PIXEL_SHADER( morphweight_ps30 );
		}
		Draw();
	}
END_SHADER