Joe Ludwig 7309a5f13f Added many shader source files
This should include the latest version of every shader that was in the
2007 SDK. It also includes a smattering of debug shaders, both VR
distortion shaders, and other assorted shaders that will hopefully be
useful.

None of these new files are included in the game shader DLL project. If
you need to modify one of these shaders for use in your mod you will
need to rename it so that you don't collide with the version of that
shader that lives in stdshader_dx9.dll.
2013-12-23 15:00:03 -08:00

70 lines
1.7 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "BaseVSShader.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
DEFINE_FALLBACK_SHADER( Teeth, Teeth_DX6 )
BEGIN_VS_SHADER( Teeth_DX6,
"Help for Teeth_DX6" )
BEGIN_SHADER_PARAMS
SHADER_PARAM( ILLUMFACTOR, SHADER_PARAM_TYPE_FLOAT, "1", "Amount to darken or brighten the teeth" )
SHADER_PARAM( FORWARD, SHADER_PARAM_TYPE_VEC3, "[1 0 0]", "Forward direction vector for teeth lighting" )
END_SHADER_PARAMS
SHADER_INIT_PARAMS()
{
// FLASHLIGHTFIXME
params[FLASHLIGHTTEXTURE]->SetStringValue( "effects/flashlight001" );
SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );
}
SHADER_INIT
{
LoadTexture( FLASHLIGHTTEXTURE );
LoadTexture( BASETEXTURE );
}
void DrawUsingSoftwareLighting( IMaterialVar** params, IShaderDynamicAPI *pShaderAPI, IShaderShadow* pShaderShadow )
{
SHADOW_STATE
{
pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
pShaderShadow->OverbrightValue( SHADER_TEXTURE_STAGE0, OVERBRIGHT );
pShaderShadow->DrawFlags( SHADER_DRAW_POSITION | SHADER_DRAW_COLOR | SHADER_DRAW_TEXCOORD0 );
FogToFogColor();
}
DYNAMIC_STATE
{
BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
}
Draw();
}
SHADER_DRAW
{
SHADOW_STATE
{
SET_FLAGS2( MATERIAL_VAR2_LIGHTING_VERTEX_LIT );
}
bool hasFlashlight = UsingFlashlight( params );
if( hasFlashlight )
{
DrawFlashlight_dx70( params, pShaderAPI, pShaderShadow, FLASHLIGHTTEXTURE, FLASHLIGHTTEXTUREFRAME );
}
else
{
DrawUsingSoftwareLighting( params, pShaderAPI, pShaderShadow );
}
}
END_SHADER