You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.2 KiB
119 lines
3.2 KiB
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//
|
|
//===========================================================================//
|
|
|
|
#ifndef SHADERSHADOWDX10_H
|
|
#define SHADERSHADOWDX10_H
|
|
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "shaderapi/ishaderapi.h"
|
|
#include "shaderapi/ishadershadow.h"
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// The empty shader shadow
|
|
//-----------------------------------------------------------------------------
|
|
class CShaderShadowDx10 : public IShaderShadow
|
|
{
|
|
public:
|
|
CShaderShadowDx10();
|
|
virtual ~CShaderShadowDx10();
|
|
|
|
// Sets the default *shadow* state
|
|
void SetDefaultState();
|
|
|
|
// Methods related to depth buffering
|
|
void DepthFunc( ShaderDepthFunc_t depthFunc );
|
|
void EnableDepthWrites( bool bEnable );
|
|
void EnableDepthTest( bool bEnable );
|
|
void EnablePolyOffset( PolygonOffsetMode_t nOffsetMode );
|
|
|
|
// Suppresses/activates color writing
|
|
void EnableColorWrites( bool bEnable );
|
|
void EnableAlphaWrites( bool bEnable );
|
|
|
|
// Methods related to alpha blending
|
|
void EnableBlending( bool bEnable );
|
|
void EnableBlendingForceOpaque( bool bEnable );
|
|
void BlendFunc( ShaderBlendFactor_t srcFactor, ShaderBlendFactor_t dstFactor );
|
|
|
|
// Alpha testing
|
|
void EnableAlphaTest( bool bEnable );
|
|
void AlphaFunc( ShaderAlphaFunc_t alphaFunc, float alphaRef /* [0-1] */ );
|
|
|
|
// Wireframe/filled polygons
|
|
void PolyMode( ShaderPolyModeFace_t face, ShaderPolyMode_t polyMode );
|
|
|
|
// Back face culling
|
|
void EnableCulling( bool bEnable );
|
|
|
|
// Indicates the vertex format for use with a vertex shader
|
|
// The flags to pass in here come from the VertexFormatFlags_t enum
|
|
// If pTexCoordDimensions is *not* specified, we assume all coordinates
|
|
// are 2-dimensional
|
|
void VertexShaderVertexFormat( unsigned int flags,
|
|
int numTexCoords, int* pTexCoordDimensions,
|
|
int userDataSize );
|
|
|
|
// Per texture unit stuff
|
|
void EnableTexture( Sampler_t stage, bool bEnable );
|
|
void EnableVertexTexture( VertexTextureSampler_t stage, bool bEnable );
|
|
|
|
// Separate alpha blending
|
|
void EnableBlendingSeparateAlpha( bool bEnable );
|
|
void BlendFuncSeparateAlpha( ShaderBlendFactor_t srcFactor, ShaderBlendFactor_t dstFactor );
|
|
|
|
// Sets the vertex and pixel shaders
|
|
void SetVertexShader( const char *pFileName, int vshIndex );
|
|
void SetPixelShader( const char *pFileName, int pshIndex );
|
|
|
|
// Convert from linear to gamma color space on writes to frame buffer.
|
|
void EnableSRGBWrite( bool bEnable )
|
|
{
|
|
}
|
|
|
|
void EnableSRGBRead( Sampler_t stage, bool bEnable )
|
|
{
|
|
}
|
|
|
|
virtual void DisableFogGammaCorrection( bool bDisable )
|
|
{
|
|
//FIXME: empty for now.
|
|
}
|
|
virtual void FogMode( ShaderFogMode_t fogMode, bool bVertexFog )
|
|
{
|
|
//FIXME: empty for now.
|
|
}
|
|
|
|
// Alpha to coverage
|
|
void EnableAlphaToCoverage( bool bEnable );
|
|
|
|
void SetShadowDepthFiltering( Sampler_t stage );
|
|
|
|
// More alpha blending state
|
|
void BlendOp( ShaderBlendOp_t blendOp );
|
|
void BlendOpSeparateAlpha( ShaderBlendOp_t blendOp );
|
|
|
|
virtual float GetLightMapScaleFactor( void ) const
|
|
{
|
|
Assert( 0 );
|
|
return 1.0;
|
|
}
|
|
|
|
bool m_IsTranslucent;
|
|
bool m_IsAlphaTested;
|
|
bool m_bIsDepthWriteEnabled;
|
|
bool m_bUsesVertexAndPixelShaders;
|
|
};
|
|
|
|
|
|
extern CShaderShadowDx10* g_pShaderShadowDx10;
|
|
|
|
#endif // SHADERSHADOWDX10_H
|