Revert "materialsystem/shaderapidx9: restore shaders from source-sdk-2013"
This reverts commit cca56d5a6f
.
This commit is contained in:
parent
3558b0e03c
commit
c625d789a7
@ -12785,9 +12785,10 @@ void CShaderAPIDx8::GetDX9LightState( LightState_t *state ) const
|
||||
#else
|
||||
state->m_nNumLights = m_DynamicState.m_NumLights;
|
||||
#endif
|
||||
|
||||
state->m_nNumLights = m_DynamicState.m_NumLights;
|
||||
state->m_bStaticLight = m_pRenderMesh->HasColorMesh();
|
||||
state->m_bStaticLightVertex = false;
|
||||
state->m_bStaticLightVertex = m_pRenderMesh->HasColorMesh();
|
||||
state->m_bStaticLightTexel = false; // For now
|
||||
}
|
||||
|
||||
MaterialFogMode_t CShaderAPIDx8::GetCurrentFogType( void ) const
|
||||
|
@ -180,7 +180,8 @@ BEGIN_VS_SHADER( DecalModulate_dx9,
|
||||
{
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, 0 ); // Use simplest possible vertex lighting, since ps is so simple
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, 0); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, 0 ); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, 0); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW, 0 );
|
||||
@ -208,7 +209,8 @@ BEGIN_VS_SHADER( DecalModulate_dx9,
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs30 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, 0 ); // Use simplest possible vertex lighting, since ps is so simple
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, 0); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, 0 ); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, 0); //
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW, 0 );
|
||||
|
@ -9,47 +9,62 @@ set TTEXE=time /t
|
||||
:no_ttexe_end
|
||||
|
||||
echo.
|
||||
echo ==================== buildshaders %* ==================
|
||||
rem echo ==================== buildshaders %* ==================
|
||||
%TTEXE% -cur-Q
|
||||
set tt_start=%ERRORLEVEL%
|
||||
set tt_chkpt=%tt_start%
|
||||
|
||||
|
||||
REM ****************
|
||||
REM usage: buildshaders <shaderProjectName>
|
||||
REM usage: buildshaders <shaderProjectName> [-x360]
|
||||
REM ****************
|
||||
|
||||
setlocal
|
||||
set arg_filename=%1
|
||||
rem set shadercompilecommand=echo shadercompile.exe -mpi_graphics -mpi_TrackEvents
|
||||
set shadercompilecommand=shadercompile.exe
|
||||
set targetdir=shaders
|
||||
set shadercompileworkers=128
|
||||
set x360_args=
|
||||
set targetdir=..\..\..\game\hl2\shaders
|
||||
set SrcDirBase=..\..
|
||||
set ChangeToDir=../../../game/bin
|
||||
set shaderDir=shaders
|
||||
set SDKArgs=
|
||||
set SHADERINCPATH=vshtmp9/... fxctmp9/...
|
||||
|
||||
|
||||
if "%1" == "" goto usage
|
||||
set inputbase=%1
|
||||
|
||||
set DIRECTX_SDK_VER=pc09.00
|
||||
set DIRECTX_SDK_BIN_DIR=dx9sdk\utilities
|
||||
|
||||
if /i "%6" == "-dx9_30" goto dx_sdk_dx9_30
|
||||
if /i "%2" == "-x360" goto dx_sdk_x360
|
||||
if /i "%2" == "-dx9_30" goto dx_sdk_dx9_30
|
||||
if /i "%2" == "-dx10" goto dx_sdk_dx10
|
||||
goto dx_sdk_end
|
||||
:dx_sdk_x360
|
||||
set DIRECTX_SDK_VER=x360.00
|
||||
set DIRECTX_SDK_BIN_DIR=x360xdk\bin\win32
|
||||
goto dx_sdk_end
|
||||
:dx_sdk_dx9_30
|
||||
set DIRECTX_SDK_VER=pc09.30
|
||||
set DIRECTX_SDK_BIN_DIR=dx10sdk\utilities\dx9_30
|
||||
goto dx_sdk_end
|
||||
:dx_sdk_dx10
|
||||
set DIRECTX_SDK_VER=pc10.00
|
||||
set DIRECTX_SDK_BIN_DIR=dx10sdk\utilities\dx10_40
|
||||
goto dx_sdk_end
|
||||
:dx_sdk_end
|
||||
|
||||
if /i "%7" == "-force30" goto set_force30_arg
|
||||
if "%1" == "" goto usage
|
||||
set inputbase=%1
|
||||
|
||||
if /i "%3" == "-force30" goto set_force30_arg
|
||||
goto set_force_end
|
||||
:set_force30_arg
|
||||
set DIRECTX_FORCE_MODEL=30
|
||||
goto set_force_end
|
||||
:set_force_end
|
||||
|
||||
if /i "%2" == "-x360" goto set_x360_args
|
||||
if /i "%2" == "-game" goto set_mod_args
|
||||
goto build_shaders
|
||||
|
||||
@ -58,27 +73,35 @@ REM USAGE
|
||||
REM ****************
|
||||
:usage
|
||||
echo.
|
||||
echo "usage: buildshaders <shaderProjectName> [-game] [gameDir if -game was specified] [-source sourceDir]"
|
||||
echo "usage: buildshaders <shaderProjectName> [-x360 or -dx10 or -game] [gameDir if -game was specified] [-source sourceDir]"
|
||||
echo " gameDir is where gameinfo.txt is (where it will store the compiled shaders)."
|
||||
echo " sourceDir is where the source code is (where it will find scripts and compilers)."
|
||||
echo "ex : buildshaders myshaders"
|
||||
echo "ex : buildshaders myshaders -game c:\steam\steamapps\sourcemods\mymod -source c:\mymod\src"
|
||||
goto :end
|
||||
|
||||
REM ****************
|
||||
REM X360 ARGS
|
||||
REM ****************
|
||||
:set_x360_args
|
||||
set x360_args=-x360
|
||||
set SHADERINCPATH=vshtmp9_360/... fxctmp9_360/...
|
||||
goto build_shaders
|
||||
|
||||
REM ****************
|
||||
REM MOD ARGS - look for -game or the vproject environment variable
|
||||
REM ****************
|
||||
:set_mod_args
|
||||
|
||||
if not exist "%SDKBINDIR%\shadercompile.exe" goto NoShaderCompile
|
||||
set ChangeToDir=%SDKBINDIR%
|
||||
if not exist %sourcesdk%\bin\shadercompile.exe goto NoShaderCompile
|
||||
set ChangeToDir=%sourcesdk%\bin
|
||||
|
||||
if /i "%4" NEQ "-source" goto NoSourceDirSpecified
|
||||
set SrcDirBase=%~5
|
||||
|
||||
REM ** use the -game parameter to tell us where to put the files
|
||||
set targetdir=%~3\shaders
|
||||
set SDKArgs=-nompi -nop4 -game "%~3"
|
||||
set SDKArgs=-nompi -game "%~3"
|
||||
|
||||
if not exist "%~3\gameinfo.txt" goto InvalidGameDirectory
|
||||
goto build_shaders
|
||||
@ -100,7 +123,7 @@ goto end
|
||||
|
||||
:NoShaderCompile
|
||||
echo -
|
||||
echo - ERROR: shadercompile.exe doesn't exist in %SDKBINDIR%
|
||||
echo - ERROR: shadercompile.exe doesn't exist in %sourcesdk%\bin
|
||||
echo -
|
||||
goto end
|
||||
|
||||
@ -125,10 +148,16 @@ if exist filelistgen.txt del /f /q filelistgen.txt
|
||||
if exist inclist.txt del /f /q inclist.txt
|
||||
if exist vcslist.txt del /f /q vcslist.txt
|
||||
|
||||
|
||||
REM ****************
|
||||
REM Revert any targets (vcs or inc) that are opened for integrate.
|
||||
REM ****************
|
||||
perl "%SrcDirBase%\devtools\bin\p4revertshadertargets.pl" %x360_args% -source "%SrcDirBase%" %inputbase%
|
||||
|
||||
REM ****************
|
||||
REM Generate a makefile for the shader project
|
||||
REM ****************
|
||||
perl "%SrcDirBase%\devtools\bin\updateshaders.pl" -source "%SrcDirBase%" %inputbase%
|
||||
perl "%SrcDirBase%\devtools\bin\updateshaders.pl" %x360_args% -source "%SrcDirBase%" %inputbase%
|
||||
|
||||
|
||||
REM ****************
|
||||
@ -143,7 +172,15 @@ REM Copy the inc files to their target
|
||||
REM ****************
|
||||
if exist "inclist.txt" (
|
||||
echo Publishing shader inc files to target...
|
||||
perl %SrcDirBase%\devtools\bin\copyshaderincfiles.pl inclist.txt
|
||||
perl %SrcDirBase%\devtools\bin\copyshaderincfiles.pl inclist.txt %x360_args%
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Deal with perforce operations for inc files
|
||||
REM ****************
|
||||
if exist inclist.txt if not "%VALVE_NO_AUTO_P4_SHADERS%" == "1" (
|
||||
echo Executing perforce operations on .inc files.
|
||||
perl ..\..\devtools\bin\p4autocheckout.pl inclist.txt "Shader Auto Checkout INC" . %SHADERINCPATH%
|
||||
)
|
||||
|
||||
REM ****************
|
||||
@ -155,13 +192,19 @@ if /i "%DIRECTX_SDK_VER%" == "pc09.00" (
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc09.30" (
|
||||
echo %SrcDirBase%\devtools\bin\d3dx9_33.dll >> filestocopy.txt
|
||||
)
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc10.00" (
|
||||
echo %SrcDirBase%\devtools\bin\d3dx10_33.dll >> filestocopy.txt
|
||||
)
|
||||
if /i "%DIRECTX_SDK_VER%" == "x360.00" (
|
||||
rem echo "Copy extra files for xbox360
|
||||
)
|
||||
|
||||
echo %SrcDirBase%\%DIRECTX_SDK_BIN_DIR%\dx_proxy.dll >> filestocopy.txt
|
||||
|
||||
echo %SDKBINDIR%\shadercompile.exe >> filestocopy.txt
|
||||
echo %SDKBINDIR%\shadercompile_dll.dll >> filestocopy.txt
|
||||
echo %SDKBINDIR%\vstdlib.dll >> filestocopy.txt
|
||||
echo %SDKBINDIR%\tier0.dll >> filestocopy.txt
|
||||
echo %SrcDirBase%\..\game\bin\shadercompile.exe >> filestocopy.txt
|
||||
echo %SrcDirBase%\..\game\bin\shadercompile_dll.dll >> filestocopy.txt
|
||||
echo %SrcDirBase%\..\game\bin\vstdlib.dll >> filestocopy.txt
|
||||
echo %SrcDirBase%\..\game\bin\tier0.dll >> filestocopy.txt
|
||||
|
||||
REM ****************
|
||||
REM Cull duplicate entries in work/build list
|
||||
@ -170,6 +213,7 @@ if exist filestocopy.txt type filestocopy.txt | perl "%SrcDirBase%\devtools\bin\
|
||||
if exist filelistgen.txt if not "%dynamic_shaders%" == "1" (
|
||||
echo Generating action list...
|
||||
copy filelistgen.txt filelist.txt >nul
|
||||
rem %SrcDirBase%\devtools\bin\fxccombogen.exe <filelistgen.txt 1>nul 2>filelist.txt
|
||||
)
|
||||
|
||||
REM ****************
|
||||
@ -179,24 +223,29 @@ REM ****************
|
||||
set shader_path_cd=%cd%
|
||||
if exist "filelist.txt" if exist "uniquefilestocopy.txt" if not "%dynamic_shaders%" == "1" (
|
||||
echo Running distributed shader compilation...
|
||||
|
||||
cd /D %ChangeToDir%
|
||||
echo %shadercompilecommand% %SDKArgs% -shaderpath "%shader_path_cd:/=\%" -allowdebug
|
||||
%shadercompilecommand% %SDKArgs% -shaderpath "%shader_path_cd:/=\%" -allowdebug
|
||||
cd /D %shader_path_cd%
|
||||
cd %ChangeToDir%
|
||||
%shadercompilecommand% -mpi_workercount %shadercompileworkers% -allowdebug -shaderpath "%shader_path_cd:/=\%" %x360_args% %SDKArgs%
|
||||
cd %shader_path_cd%
|
||||
)
|
||||
|
||||
|
||||
REM ****************
|
||||
REM PC Shader copy
|
||||
REM Publish the generated files to the output dir using XCOPY
|
||||
REM PC and 360 Shader copy
|
||||
REM Publish the generated files to the output dir using ROBOCOPY (smart copy) or XCOPY
|
||||
REM This batch file may have been invoked standalone or slaved (master does final smart mirror copy)
|
||||
REM ****************
|
||||
:DoXCopy
|
||||
if not "%dynamic_shaders%" == "1" (
|
||||
if not exist "%targetdir%" md "%targetdir%"
|
||||
if not "%targetdir%"=="%shaderDir%" xcopy %shaderDir%\*.* "%targetdir%" /e /y
|
||||
if exist makefile.%inputbase%.copy echo Publishing shaders to target...
|
||||
if exist makefile.%inputbase%.copy perl %SrcDirBase%\devtools\bin\copyshaders.pl makefile.%inputbase%.copy %x360_args%
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Deal with perforce operations for vcs files
|
||||
REM ****************
|
||||
if not "%dynamic_shaders%" == "1" if exist vcslist.txt if not "%VALVE_NO_AUTO_P4_SHADERS%" == "1" (
|
||||
echo Executing perforce operations on .vcs files.
|
||||
perl ..\..\devtools\bin\p4autocheckout.pl vcslist.txt "Shader Auto Checkout VCS" ../../../game/hl2/shaders ../../../game/hl2/shaders/...
|
||||
)
|
||||
goto end
|
||||
|
||||
REM ****************
|
||||
REM END
|
||||
|
@ -19,9 +19,19 @@ if exist debug_dx9 rd /s /q debug_dx9
|
||||
if exist fxctmp9 rd /s /q fxctmp9
|
||||
if exist vshtmp9 rd /s /q vshtmp9
|
||||
if exist pshtmp9 rd /s /q pshtmp9
|
||||
|
||||
if exist fxctmp9_360 rd /s /q fxctmp9_360
|
||||
if exist vshtmp9_360 rd /s /q vshtmp9_360
|
||||
if exist pshtmp9_360 rd /s /q pshtmp9_360
|
||||
|
||||
if exist fxctmp9_tmp rd /s /q fxctmp9_tmp
|
||||
if exist vshtmp9_tmp rd /s /q vshtmp9_tmp
|
||||
if exist pshtmp9_tmp rd /s /q pshtmp9_tmp
|
||||
|
||||
if exist fxctmp9_360_tmp rd /s /q fxctmp9_360_tmp
|
||||
if exist vshtmp9_360_tmp rd /s /q vshtmp9_360_tmp
|
||||
if exist pshtmp9_360_tmp rd /s /q pshtmp9_360_tmp
|
||||
|
||||
if exist shaders rd /s /q shaders
|
||||
goto end
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//===== Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@ -6,18 +6,11 @@
|
||||
// $NoKeywords: $
|
||||
//===========================================================================//
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
|
||||
#define USE_NEW_SHADER //Updating assembly shaders to fxc, this is for A/B testing.
|
||||
|
||||
#ifdef USE_NEW_SHADER
|
||||
|
||||
#include "unlitgeneric_vs20.inc"
|
||||
#include "unlitgeneric_ps20.inc"
|
||||
#include "unlitgeneric_ps20b.inc"
|
||||
|
||||
#endif
|
||||
#include "shaderlib/CShader.h"
|
||||
|
||||
#include "debugluxel_ps20b.inc"
|
||||
#include "debugluxel_ps20.inc"
|
||||
#include "debugluxel_vs20.inc"
|
||||
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
@ -34,107 +27,71 @@ BEGIN_SHADER_FLAGS( DebugLuxels, "Help for DebugLuxels", SHADER_NOT_EDITABLE )
|
||||
SET_FLAGS( MATERIAL_VAR_NO_DEBUG_OVERRIDE );
|
||||
SET_FLAGS2( MATERIAL_VAR2_LIGHTING_LIGHTMAP );
|
||||
|
||||
#ifdef USE_NEW_SHADER
|
||||
if( g_pHardwareConfig->GetDXSupportLevel() >= 90 )
|
||||
{
|
||||
SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SHADER_INIT
|
||||
{
|
||||
LoadTexture( BASETEXTURE );
|
||||
}
|
||||
|
||||
SHADER_DRAW
|
||||
{
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
|
||||
|
||||
if (IS_FLAG_SET(MATERIAL_VAR_TRANSLUCENT))
|
||||
{
|
||||
pShaderShadow->EnableBlending( true );
|
||||
pShaderShadow->BlendFunc( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
|
||||
if (IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR))
|
||||
pShaderShadow->DrawFlags( SHADER_DRAW_POSITION | SHADER_DRAW_COLOR | SHADER_DRAW_LIGHTMAP_TEXCOORD0 );
|
||||
else
|
||||
pShaderShadow->DrawFlags( SHADER_DRAW_POSITION | SHADER_DRAW_LIGHTMAP_TEXCOORD0 );
|
||||
#ifdef USE_NEW_SHADER
|
||||
if( g_pHardwareConfig->GetDXSupportLevel() >= 90 )
|
||||
{
|
||||
bool bVertexColor = IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR);
|
||||
|
||||
DECLARE_STATIC_VERTEX_SHADER( unlitgeneric_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER_COMBO( VERTEXCOLOR, bVertexColor ? 1 : 0 );
|
||||
SET_STATIC_VERTEX_SHADER( unlitgeneric_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( unlitgeneric_ps20b );
|
||||
SET_STATIC_PIXEL_SHADER( unlitgeneric_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( unlitgeneric_ps20 );
|
||||
SET_STATIC_PIXEL_SHADER( unlitgeneric_ps20 );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
DYNAMIC_STATE
|
||||
|
||||
SHADER_INIT
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
|
||||
LoadTexture( BASETEXTURE );
|
||||
}
|
||||
|
||||
int texCoordScaleX = 1, texCoordScaleY = 1;
|
||||
if (!params[NOSCALE]->GetIntValue())
|
||||
SHADER_DRAW
|
||||
{
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShaderAPI->GetLightmapDimensions( &texCoordScaleX, &texCoordScaleY );
|
||||
}
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
|
||||
|
||||
#ifdef USE_NEW_SHADER
|
||||
if( g_pHardwareConfig->GetDXSupportLevel() >= 90 )
|
||||
{
|
||||
float vVertexColor[4] = { IS_FLAG_SET(MATERIAL_VAR_VERTEXCOLOR) ? 1.0f : 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_6, vVertexColor, 1 );
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( unlitgeneric_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( unlitgeneric_vs20 );
|
||||
DECLARE_STATIC_VERTEX_SHADER( debugluxel_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER( debugluxel_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( unlitgeneric_ps20b );
|
||||
SET_DYNAMIC_PIXEL_SHADER( unlitgeneric_ps20b );
|
||||
DECLARE_STATIC_PIXEL_SHADER( debugluxel_ps20b );
|
||||
SET_STATIC_PIXEL_SHADER( debugluxel_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( unlitgeneric_ps20 );
|
||||
SET_DYNAMIC_PIXEL_SHADER( unlitgeneric_ps20 );
|
||||
DECLARE_STATIC_PIXEL_SHADER( debugluxel_ps20 );
|
||||
SET_STATIC_PIXEL_SHADER( debugluxel_ps20 );
|
||||
}
|
||||
|
||||
SetDefaultBlendingShadowState( BASETEXTURE );
|
||||
DisableFog();
|
||||
pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 2, NULL, 0 );
|
||||
}
|
||||
DYNAMIC_STATE
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
|
||||
|
||||
int texCoordScaleX = 1, texCoordScaleY = 1;
|
||||
if (!params[NOSCALE]->GetIntValue())
|
||||
{
|
||||
pShaderAPI->GetLightmapDimensions( &texCoordScaleX, &texCoordScaleY );
|
||||
}
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( debugluxel_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER( debugluxel_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( debugluxel_ps20b );
|
||||
SET_DYNAMIC_PIXEL_SHADER( debugluxel_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( debugluxel_ps20 );
|
||||
SET_DYNAMIC_PIXEL_SHADER( debugluxel_ps20 );
|
||||
}
|
||||
|
||||
//texture scale transform
|
||||
Vector4D transformation[2];
|
||||
transformation[0].Init( (float)texCoordScaleX, 0.0f, 0.0f, 0.0f );
|
||||
transformation[1].Init( 0.0f, (float)texCoordScaleY, 0.0f, 0.0f );
|
||||
transformation[0].Init( texCoordScaleX, 0.0f, 0.0f, 0.0f );
|
||||
transformation[1].Init( 0.0f, texCoordScaleY, 0.0f, 0.0f );
|
||||
s_pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, transformation[0].Base(), 2 );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (!params[NOSCALE]->GetIntValue())
|
||||
{
|
||||
pShaderAPI->MatrixMode( MATERIAL_TEXTURE0 );
|
||||
pShaderAPI->LoadIdentity( );
|
||||
pShaderAPI->ScaleXY( texCoordScaleX, texCoordScaleY );
|
||||
}
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
END_SHADER
|
||||
|
@ -1,11 +1,14 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
#include "BaseVSShader.h"
|
||||
|
||||
// This one isn't supported on dx8
|
||||
DEFINE_FALLBACK_SHADER( SDK_DepthWrite, Wireframe )
|
||||
DEFINE_FALLBACK_SHADER( DepthWrite, Wireframe )
|
||||
|
||||
DEFINE_FALLBACK_SHADER( SDK_EyeRefract, Eyes_dx8 )
|
||||
DEFINE_FALLBACK_SHADER( SDK_VolumeClouds, UnlitGeneric_DX8 )
|
||||
DEFINE_FALLBACK_SHADER( EyeRefract, Eyes_dx8 )
|
||||
DEFINE_FALLBACK_SHADER( bik, bik_dx81 )
|
||||
DEFINE_FALLBACK_SHADER( VolumeClouds, UnlitGeneric_DX8 )
|
||||
DEFINE_FALLBACK_SHADER( DebugTextureView, UnlitGeneric_DX8 )
|
||||
|
||||
// FIXME: These aren't supported on dx8, but need to be.
|
||||
DEFINE_FALLBACK_SHADER( SDK_EyeGlint, EyeGlint )
|
||||
DEFINE_FALLBACK_SHADER( SDK_AfterShock, AfterShock )
|
||||
DEFINE_FALLBACK_SHADER( EyeGlint, Wireframe )
|
||||
DEFINE_FALLBACK_SHADER( AfterShock, Wireframe )
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
static ConVar mat_fullbright( "mat_fullbright", "0", FCVAR_CHEAT );
|
||||
static ConVar r_lightwarpidentity( "r_lightwarpidentity", "0", FCVAR_CHEAT );
|
||||
static ConVar r_rimlight( "r_rimlight", "1", FCVAR_CHEAT );
|
||||
static ConVar r_rimlight( "r_rimlight", "1", FCVAR_NONE );
|
||||
|
||||
// Textures may be bound to the following samplers:
|
||||
// SHADER_SAMPLER0 Base (Albedo) / Gloss in alpha
|
||||
|
@ -288,7 +288,7 @@ void Draw_Eyes_Refract_Internal( CBaseVSShader *pShader, IMaterialVar** params,
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( eye_refract_vs20 );
|
||||
@ -302,7 +302,7 @@ void Draw_Eyes_Refract_Internal( CBaseVSShader *pShader, IMaterialVar** params,
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( MORPHING, pShaderAPI->IsHWMorphingEnabled() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
|
@ -421,7 +421,7 @@ static void DrawUsingVertexShader( bool bDX9, CBaseVSShader *pShader, IMaterialV
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, bUseStaticControlFlow ? 0 : lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER( eyes_vs20 );
|
||||
@ -435,7 +435,7 @@ static void DrawUsingVertexShader( bool bDX9, CBaseVSShader *pShader, IMaterialV
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( MORPHING, pShaderAPI->IsHWMorphingEnabled() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( eyes_vs30 );
|
||||
|
@ -228,7 +228,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, bUseStaticControlFlow ? 0 : lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER( flesh_interior_blended_pass_vs20 );
|
||||
|
@ -1,38 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// $USE_STATIC_CONTROL_FLOW && ( $NUM_LIGHTS > 0 )
|
||||
// ($SEPARATE_DETAIL_UVS) && ($SEAMLESS_DETAIL)
|
||||
// ($DONT_GAMMA_CONVERT_VERTEX_COLOR && ( ! $VERTEXCOLOR ) )
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
|
||||
#ifndef VERTEXLIT_AND_UNLIT_GENERIC_VS20_H
|
||||
#define VERTEXLIT_AND_UNLIT_GENERIC_VS20_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class vertexlit_and_unlit_generic_vs20_Static_Index
|
||||
{
|
||||
unsigned int m_nVERTEXCOLOR : 2;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nHALFLAMBERT : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nSEAMLESS_BASE : 2;
|
||||
unsigned int m_nSEAMLESS_DETAIL : 2;
|
||||
unsigned int m_nSEPARATE_DETAIL_UVS : 2;
|
||||
unsigned int m_nUSE_STATIC_CONTROL_FLOW : 2;
|
||||
unsigned int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR : 2;
|
||||
private:
|
||||
int m_nVERTEXCOLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bVERTEXCOLOR : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bHALFLAMBERT : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bSEAMLESS_BASE : 1;
|
||||
bool m_bSEAMLESS_DETAIL : 1;
|
||||
bool m_bSEPARATE_DETAIL_UVS : 1;
|
||||
bool m_bUSE_STATIC_CONTROL_FLOW : 1;
|
||||
bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bVERTEXCOLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetVERTEXCOLOR( int i )
|
||||
{
|
||||
@ -40,133 +13,242 @@ public:
|
||||
m_nVERTEXCOLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetVERTEXCOLOR( bool i )
|
||||
{
|
||||
m_nVERTEXCOLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nHALFLAMBERT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bHALFLAMBERT;
|
||||
#endif
|
||||
public:
|
||||
void SetHALFLAMBERT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nHALFLAMBERT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetHALFLAMBERT( bool i )
|
||||
{
|
||||
m_nHALFLAMBERT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_BASE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_BASE;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_BASE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_BASE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_BASE( bool i )
|
||||
{
|
||||
m_nSEAMLESS_BASE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_DETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_DETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_DETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_DETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_DETAIL( bool i )
|
||||
{
|
||||
m_nSEAMLESS_DETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEPARATE_DETAIL_UVS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEPARATE_DETAIL_UVS;
|
||||
#endif
|
||||
public:
|
||||
void SetSEPARATE_DETAIL_UVS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEPARATE_DETAIL_UVS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEPARATE_DETAIL_UVS( bool i )
|
||||
{
|
||||
m_nSEPARATE_DETAIL_UVS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nUSE_STATIC_CONTROL_FLOW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bUSE_STATIC_CONTROL_FLOW;
|
||||
#endif
|
||||
public:
|
||||
void SetUSE_STATIC_CONTROL_FLOW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nUSE_STATIC_CONTROL_FLOW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetUSE_STATIC_CONTROL_FLOW( bool i )
|
||||
{
|
||||
m_nUSE_STATIC_CONTROL_FLOW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( bool i )
|
||||
{
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_vs20_Static_Index( )
|
||||
{
|
||||
m_nVERTEXCOLOR = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nHALFLAMBERT = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
m_nSEPARATE_DETAIL_UVS = 0;
|
||||
m_nUSE_STATIC_CONTROL_FLOW = 0;
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nVERTEXCOLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = false;
|
||||
#endif // _DEBUG
|
||||
m_nHALFLAMBERT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEPARATE_DETAIL_UVS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = false;
|
||||
#endif // _DEBUG
|
||||
m_nUSE_STATIC_CONTROL_FLOW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bVERTEXCOLOR && m_bCUBEMAP && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bSEPARATE_DETAIL_UVS && m_bUSE_STATIC_CONTROL_FLOW && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR );
|
||||
return ( 192 * m_nVERTEXCOLOR ) + ( 384 * m_nCUBEMAP ) + ( 768 * m_nHALFLAMBERT ) + ( 1536 * m_nFLASHLIGHT ) + ( 3072 * m_nSEAMLESS_BASE ) + ( 6144 * m_nSEAMLESS_DETAIL ) + ( 12288 * m_nSEPARATE_DETAIL_UVS ) + ( 24576 * m_nUSE_STATIC_CONTROL_FLOW ) + ( 49152 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bVERTEXCOLOR && m_bCUBEMAP && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bSEPARATE_DETAIL_UVS && m_bUSE_STATIC_CONTROL_FLOW && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nCUBEMAP ) + ( 1536 * m_nHALFLAMBERT ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSEAMLESS_BASE ) + ( 12288 * m_nSEAMLESS_DETAIL ) + ( 24576 * m_nSEPARATE_DETAIL_UVS ) + ( 49152 * m_nUSE_STATIC_CONTROL_FLOW ) + ( 98304 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_vs20 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_CUBEMAP + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SEAMLESS_BASE + vsh_forgot_to_set_static_SEAMLESS_DETAIL + vsh_forgot_to_set_static_SEPARATE_DETAIL_UVS + vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR
|
||||
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_vs20 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_CUBEMAP + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SEAMLESS_BASE + vsh_forgot_to_set_static_SEAMLESS_DETAIL + vsh_forgot_to_set_static_SEPARATE_DETAIL_UVS + vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR + 0
|
||||
class vertexlit_and_unlit_generic_vs20_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nCOMPRESSED_VERTS : 2;
|
||||
unsigned int m_nDYNAMIC_LIGHT : 2;
|
||||
unsigned int m_nSTATIC_LIGHT : 2;
|
||||
unsigned int m_nDOWATERFOG : 2;
|
||||
unsigned int m_nSKINNING : 2;
|
||||
unsigned int m_nLIGHTING_PREVIEW : 2;
|
||||
unsigned int m_nNUM_LIGHTS : 2;
|
||||
private:
|
||||
int m_nCOMPRESSED_VERTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS : 1;
|
||||
bool m_bDYNAMIC_LIGHT : 1;
|
||||
bool m_bSTATIC_LIGHT : 1;
|
||||
bool m_bDOWATERFOG : 1;
|
||||
bool m_bSKINNING : 1;
|
||||
bool m_bLIGHTING_PREVIEW : 1;
|
||||
bool m_bNUM_LIGHTS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS;
|
||||
#endif
|
||||
public:
|
||||
void SetCOMPRESSED_VERTS( int i )
|
||||
{
|
||||
@ -174,91 +256,207 @@ public:
|
||||
m_nCOMPRESSED_VERTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCOMPRESSED_VERTS( bool i )
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDYNAMIC_LIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDYNAMIC_LIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetDYNAMIC_LIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDYNAMIC_LIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSTATIC_LIGHT( int i )
|
||||
void SetDYNAMIC_LIGHT( bool i )
|
||||
{
|
||||
m_nDYNAMIC_LIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_VERTEX;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_VERTEX;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_VERTEX( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT = i;
|
||||
m_nSTATIC_LIGHT_VERTEX = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT = true;
|
||||
#endif // _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSTATIC_LIGHT_VERTEX( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_VERTEX = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDOWATERFOG;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDOWATERFOG;
|
||||
#endif
|
||||
public:
|
||||
void SetDOWATERFOG( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDOWATERFOG = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDOWATERFOG( bool i )
|
||||
{
|
||||
m_nDOWATERFOG = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSKINNING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSKINNING;
|
||||
#endif
|
||||
public:
|
||||
void SetSKINNING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSKINNING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSKINNING( bool i )
|
||||
{
|
||||
m_nSKINNING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nLIGHTING_PREVIEW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTING_PREVIEW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nLIGHTING_PREVIEW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTING_PREVIEW( bool i )
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nNUM_LIGHTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bNUM_LIGHTS;
|
||||
#endif
|
||||
public:
|
||||
void SetNUM_LIGHTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_vs20_Dynamic_Index()
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
m_nDYNAMIC_LIGHT = 0;
|
||||
m_nSTATIC_LIGHT = 0;
|
||||
m_nDOWATERFOG = 0;
|
||||
m_nSKINNING = 0;
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
m_nNUM_LIGHTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = false;
|
||||
#endif // _DEBUG
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = false;
|
||||
m_bSTATIC_LIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nDYNAMIC_LIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_VERTEX = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = false;
|
||||
#endif // _DEBUG
|
||||
m_nDOWATERFOG = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = false;
|
||||
#endif // _DEBUG
|
||||
m_nSKINNING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nNUM_LIGHTS = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS );
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT ) + ( 8 * m_nDOWATERFOG ) + ( 16 * m_nSKINNING ) + ( 32 * m_nLIGHTING_PREVIEW ) + ( 64 * m_nNUM_LIGHTS ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT_VERTEX && m_bSTATIC_LIGHT_LIGHTMAP && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT_VERTEX ) + ( 8 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 16 * m_nDOWATERFOG ) + ( 32 * m_nSKINNING ) + ( 64 * m_nLIGHTING_PREVIEW ) + ( 128 * m_nNUM_LIGHTS ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_NUM_LIGHTS
|
||||
|
||||
|
||||
#endif // VERTEXLIT_AND_UNLIT_GENERIC_VS20_H
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT_VERTEX + vsh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
|
||||
|
@ -1,67 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
|
||||
// (! $DETAILTEXTURE) && ( $DETAIL_BLEND_MODE != 0 )
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 )
|
||||
// ( $SELFILLUM == 0 ) && ( $SELFILLUMFRESNEL == 1 )
|
||||
// ( $FLASHLIGHT == 1 ) && ( $SELFILLUMFRESNEL == 1 )
|
||||
// ( $FLASHLIGHT == 1 ) && ( $SELFILLUM == 1 )
|
||||
// ( $BLENDTINTBYBASEALPHA ) && ( $SELFILLUM )
|
||||
// $FASTPATH_NOBUMP && ( $RIMLIGHT || $DETAILTEXTURE || $PHONGWARPTEXTURE || $SELFILLUM || $BLENDTINTBYBASEALPHA )
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
|
||||
#ifndef SKIN_PS20B_H
|
||||
#define SKIN_PS20B_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class skin_ps20b_Static_Index
|
||||
{
|
||||
unsigned int m_nCONVERT_TO_SRGB : 1;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nSELFILLUM : 2;
|
||||
unsigned int m_nSELFILLUMFRESNEL : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nLIGHTWARPTEXTURE : 2;
|
||||
unsigned int m_nPHONGWARPTEXTURE : 2;
|
||||
unsigned int m_nWRINKLEMAP : 2;
|
||||
unsigned int m_nDETAIL_BLEND_MODE : 3;
|
||||
unsigned int m_nDETAILTEXTURE : 2;
|
||||
unsigned int m_nRIMLIGHT : 2;
|
||||
unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2;
|
||||
unsigned int m_nFASTPATH_NOBUMP : 2;
|
||||
unsigned int m_nBLENDTINTBYBASEALPHA : 2;
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bSELFILLUM : 1;
|
||||
bool m_bSELFILLUMFRESNEL : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bLIGHTWARPTEXTURE : 1;
|
||||
bool m_bPHONGWARPTEXTURE : 1;
|
||||
bool m_bWRINKLEMAP : 1;
|
||||
bool m_bDETAIL_BLEND_MODE : 1;
|
||||
bool m_bDETAILTEXTURE : 1;
|
||||
bool m_bRIMLIGHT : 1;
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE : 1;
|
||||
bool m_bFASTPATH_NOBUMP : 1;
|
||||
bool m_bBLENDTINTBYBASEALPHA : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
@ -69,184 +13,367 @@ public:
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCONVERT_TO_SRGB( bool i )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM( bool i )
|
||||
{
|
||||
m_nSELFILLUM = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUMFRESNEL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUMFRESNEL;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUMFRESNEL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUMFRESNEL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUMFRESNEL( bool i )
|
||||
{
|
||||
m_nSELFILLUMFRESNEL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nLIGHTWARPTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTWARPTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTWARPTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nLIGHTWARPTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTWARPTEXTURE( bool i )
|
||||
{
|
||||
m_nLIGHTWARPTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPHONGWARPTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPHONGWARPTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetPHONGWARPTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPHONGWARPTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetPHONGWARPTEXTURE( bool i )
|
||||
{
|
||||
m_nPHONGWARPTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nWRINKLEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRINKLEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetWRINKLEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRINKLEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRINKLEMAP( bool i )
|
||||
{
|
||||
m_nWRINKLEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAIL_BLEND_MODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAIL_BLEND_MODE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAIL_BLEND_MODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 6 );
|
||||
m_nDETAIL_BLEND_MODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAIL_BLEND_MODE( bool i )
|
||||
{
|
||||
m_nDETAIL_BLEND_MODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAILTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAILTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAILTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDETAILTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAILTEXTURE( bool i )
|
||||
{
|
||||
m_nDETAILTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nRIMLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bRIMLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetRIMLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nRIMLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetRIMLIGHT( bool i )
|
||||
{
|
||||
m_nRIMLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTDEPTHFILTERMODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFASTPATH_NOBUMP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFASTPATH_NOBUMP;
|
||||
#endif
|
||||
public:
|
||||
void SetFASTPATH_NOBUMP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFASTPATH_NOBUMP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFASTPATH_NOBUMP( bool i )
|
||||
{
|
||||
m_nFASTPATH_NOBUMP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBLENDTINTBYBASEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBLENDTINTBYBASEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetBLENDTINTBYBASEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBLENDTINTBYBASEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
skin_ps20b_Static_Index()
|
||||
void SetBLENDTINTBYBASEALPHA( bool i )
|
||||
{
|
||||
m_nBLENDTINTBYBASEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_ps20b_Static_Index( )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nSELFILLUM = 0;
|
||||
m_nSELFILLUMFRESNEL = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nLIGHTWARPTEXTURE = 0;
|
||||
m_nPHONGWARPTEXTURE = 0;
|
||||
m_nWRINKLEMAP = 0;
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
m_nDETAILTEXTURE = 0;
|
||||
m_nRIMLIGHT = 0;
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
m_nFASTPATH_NOBUMP = 0;
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = false;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUMFRESNEL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTWARPTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPHONGWARPTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRINKLEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAILTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nRIMLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = false;
|
||||
#endif // _DEBUG
|
||||
m_nFASTPATH_NOBUMP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA );
|
||||
return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nCUBEMAP ) + ( 160 * m_nSELFILLUM ) + ( 320 * m_nSELFILLUMFRESNEL ) + ( 640 * m_nFLASHLIGHT ) + ( 1280 * m_nLIGHTWARPTEXTURE ) + ( 2560 * m_nPHONGWARPTEXTURE ) + ( 5120 * m_nWRINKLEMAP ) + ( 10240 * m_nDETAIL_BLEND_MODE ) + ( 71680 * m_nDETAILTEXTURE ) + ( 143360 * m_nRIMLIGHT ) + ( 286720 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 860160 * m_nFASTPATH_NOBUMP ) + ( 1720320 * m_nBLENDTINTBYBASEALPHA ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 160 * m_nCONVERT_TO_SRGB ) + ( 160 * m_nCUBEMAP ) + ( 320 * m_nSELFILLUM ) + ( 640 * m_nSELFILLUMFRESNEL ) + ( 1280 * m_nFLASHLIGHT ) + ( 2560 * m_nLIGHTWARPTEXTURE ) + ( 5120 * m_nPHONGWARPTEXTURE ) + ( 10240 * m_nWRINKLEMAP ) + ( 20480 * m_nDETAIL_BLEND_MODE ) + ( 143360 * m_nDETAILTEXTURE ) + ( 286720 * m_nRIMLIGHT ) + ( 573440 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 1720320 * m_nFASTPATH_NOBUMP ) + ( 3440640 * m_nBLENDTINTBYBASEALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_skin_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA
|
||||
|
||||
|
||||
#define shaderStaticTest_skin_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + 0
|
||||
class skin_ps20b_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nWRITEWATERFOGTODESTALPHA : 2;
|
||||
unsigned int m_nPIXELFOGTYPE : 2;
|
||||
unsigned int m_nNUM_LIGHTS : 3;
|
||||
unsigned int m_nWRITE_DEPTH_TO_DESTALPHA : 2;
|
||||
unsigned int m_nFLASHLIGHTSHADOWS : 2;
|
||||
private:
|
||||
int m_nWRITEWATERFOGTODESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA : 1;
|
||||
bool m_bPIXELFOGTYPE : 1;
|
||||
bool m_bNUM_LIGHTS : 1;
|
||||
bool m_bWRITE_DEPTH_TO_DESTALPHA : 1;
|
||||
bool m_bFLASHLIGHTSHADOWS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITEWATERFOGTODESTALPHA( int i )
|
||||
{
|
||||
@ -254,69 +381,157 @@ public:
|
||||
m_nWRITEWATERFOGTODESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRITEWATERFOGTODESTALPHA( bool i )
|
||||
{
|
||||
m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPIXELFOGTYPE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPIXELFOGTYPE;
|
||||
#endif
|
||||
public:
|
||||
void SetPIXELFOGTYPE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPIXELFOGTYPE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetPIXELFOGTYPE( bool i )
|
||||
{
|
||||
m_nPIXELFOGTYPE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nNUM_LIGHTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bNUM_LIGHTS;
|
||||
#endif
|
||||
public:
|
||||
void SetNUM_LIGHTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 4 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nWRITE_DEPTH_TO_DESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITE_DEPTH_TO_DESTALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
|
||||
{
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTSHADOWS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTSHADOWS;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTSHADOWS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHTSHADOWS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPHONG_USE_EXPONENT_FACTOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPHONG_USE_EXPONENT_FACTOR;
|
||||
#endif
|
||||
public:
|
||||
void SetPHONG_USE_EXPONENT_FACTOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = true;
|
||||
#endif
|
||||
}
|
||||
void SetPHONG_USE_EXPONENT_FACTOR( bool i )
|
||||
{
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_ps20b_Dynamic_Index()
|
||||
{
|
||||
m_nWRITEWATERFOGTODESTALPHA = 0;
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
m_nNUM_LIGHTS = 0;
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 0;
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITEWATERFOGTODESTALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = false;
|
||||
#endif // _DEBUG
|
||||
m_nNUM_LIGHTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS );
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS && m_bPHONG_USE_EXPONENT_FACTOR;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + ( 80 * m_nPHONG_USE_EXPONENT_FACTOR ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_skin_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS
|
||||
|
||||
|
||||
#endif // SKIN_PS20B_H
|
||||
#define shaderDynamicTest_skin_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_PHONG_USE_EXPONENT_FACTOR + 0
|
||||
|
@ -1,67 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
|
||||
// (! $DETAILTEXTURE) && ( $DETAIL_BLEND_MODE != 0 )
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 )
|
||||
// ( $SELFILLUM == 0 ) && ( $SELFILLUMFRESNEL == 1 )
|
||||
// ( $FLASHLIGHT == 1 ) && ( $SELFILLUMFRESNEL == 1 )
|
||||
// ( $FLASHLIGHT == 1 ) && ( $SELFILLUM == 1 )
|
||||
// ( $BLENDTINTBYBASEALPHA ) && ( $SELFILLUM )
|
||||
// $FASTPATH_NOBUMP && ( $RIMLIGHT || $DETAILTEXTURE || $PHONGWARPTEXTURE || $SELFILLUM || $BLENDTINTBYBASEALPHA )
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
|
||||
#ifndef SKIN_PS30_H
|
||||
#define SKIN_PS30_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class skin_ps30_Static_Index
|
||||
{
|
||||
unsigned int m_nCONVERT_TO_SRGB : 1;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nSELFILLUM : 2;
|
||||
unsigned int m_nSELFILLUMFRESNEL : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nLIGHTWARPTEXTURE : 2;
|
||||
unsigned int m_nPHONGWARPTEXTURE : 2;
|
||||
unsigned int m_nWRINKLEMAP : 2;
|
||||
unsigned int m_nDETAIL_BLEND_MODE : 3;
|
||||
unsigned int m_nDETAILTEXTURE : 2;
|
||||
unsigned int m_nRIMLIGHT : 2;
|
||||
unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2;
|
||||
unsigned int m_nFASTPATH_NOBUMP : 2;
|
||||
unsigned int m_nBLENDTINTBYBASEALPHA : 2;
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bSELFILLUM : 1;
|
||||
bool m_bSELFILLUMFRESNEL : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bLIGHTWARPTEXTURE : 1;
|
||||
bool m_bPHONGWARPTEXTURE : 1;
|
||||
bool m_bWRINKLEMAP : 1;
|
||||
bool m_bDETAIL_BLEND_MODE : 1;
|
||||
bool m_bDETAILTEXTURE : 1;
|
||||
bool m_bRIMLIGHT : 1;
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE : 1;
|
||||
bool m_bFASTPATH_NOBUMP : 1;
|
||||
bool m_bBLENDTINTBYBASEALPHA : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
@ -69,184 +13,367 @@ public:
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCONVERT_TO_SRGB( bool i )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM( bool i )
|
||||
{
|
||||
m_nSELFILLUM = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUMFRESNEL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUMFRESNEL;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUMFRESNEL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUMFRESNEL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUMFRESNEL( bool i )
|
||||
{
|
||||
m_nSELFILLUMFRESNEL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nLIGHTWARPTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTWARPTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTWARPTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nLIGHTWARPTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTWARPTEXTURE( bool i )
|
||||
{
|
||||
m_nLIGHTWARPTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPHONGWARPTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPHONGWARPTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetPHONGWARPTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPHONGWARPTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetPHONGWARPTEXTURE( bool i )
|
||||
{
|
||||
m_nPHONGWARPTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nWRINKLEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRINKLEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetWRINKLEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRINKLEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRINKLEMAP( bool i )
|
||||
{
|
||||
m_nWRINKLEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAIL_BLEND_MODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAIL_BLEND_MODE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAIL_BLEND_MODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 6 );
|
||||
m_nDETAIL_BLEND_MODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAIL_BLEND_MODE( bool i )
|
||||
{
|
||||
m_nDETAIL_BLEND_MODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAILTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAILTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAILTEXTURE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDETAILTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAILTEXTURE( bool i )
|
||||
{
|
||||
m_nDETAILTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nRIMLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bRIMLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetRIMLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nRIMLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetRIMLIGHT( bool i )
|
||||
{
|
||||
m_nRIMLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTDEPTHFILTERMODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFASTPATH_NOBUMP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFASTPATH_NOBUMP;
|
||||
#endif
|
||||
public:
|
||||
void SetFASTPATH_NOBUMP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFASTPATH_NOBUMP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFASTPATH_NOBUMP( bool i )
|
||||
{
|
||||
m_nFASTPATH_NOBUMP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBLENDTINTBYBASEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBLENDTINTBYBASEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetBLENDTINTBYBASEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBLENDTINTBYBASEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
skin_ps30_Static_Index()
|
||||
void SetBLENDTINTBYBASEALPHA( bool i )
|
||||
{
|
||||
m_nBLENDTINTBYBASEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_ps30_Static_Index( )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nSELFILLUM = 0;
|
||||
m_nSELFILLUMFRESNEL = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nLIGHTWARPTEXTURE = 0;
|
||||
m_nPHONGWARPTEXTURE = 0;
|
||||
m_nWRINKLEMAP = 0;
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
m_nDETAILTEXTURE = 0;
|
||||
m_nRIMLIGHT = 0;
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
m_nFASTPATH_NOBUMP = 0;
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = false;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUMFRESNEL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUMFRESNEL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTWARPTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTWARPTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONGWARPTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPHONGWARPTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRINKLEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRINKLEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAILTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bRIMLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nRIMLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFASTPATH_NOBUMP = false;
|
||||
#endif // _DEBUG
|
||||
m_nFASTPATH_NOBUMP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA );
|
||||
return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nCUBEMAP ) + ( 160 * m_nSELFILLUM ) + ( 320 * m_nSELFILLUMFRESNEL ) + ( 640 * m_nFLASHLIGHT ) + ( 1280 * m_nLIGHTWARPTEXTURE ) + ( 2560 * m_nPHONGWARPTEXTURE ) + ( 5120 * m_nWRINKLEMAP ) + ( 10240 * m_nDETAIL_BLEND_MODE ) + ( 71680 * m_nDETAILTEXTURE ) + ( 143360 * m_nRIMLIGHT ) + ( 286720 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 860160 * m_nFASTPATH_NOBUMP ) + ( 1720320 * m_nBLENDTINTBYBASEALPHA ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 160 * m_nCONVERT_TO_SRGB ) + ( 160 * m_nCUBEMAP ) + ( 320 * m_nSELFILLUM ) + ( 640 * m_nSELFILLUMFRESNEL ) + ( 1280 * m_nFLASHLIGHT ) + ( 2560 * m_nLIGHTWARPTEXTURE ) + ( 5120 * m_nPHONGWARPTEXTURE ) + ( 10240 * m_nWRINKLEMAP ) + ( 20480 * m_nDETAIL_BLEND_MODE ) + ( 143360 * m_nDETAILTEXTURE ) + ( 286720 * m_nRIMLIGHT ) + ( 573440 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 1720320 * m_nFASTPATH_NOBUMP ) + ( 3440640 * m_nBLENDTINTBYBASEALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_skin_ps30 psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA
|
||||
|
||||
|
||||
#define shaderStaticTest_skin_ps30 psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + 0
|
||||
class skin_ps30_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nWRITEWATERFOGTODESTALPHA : 2;
|
||||
unsigned int m_nPIXELFOGTYPE : 2;
|
||||
unsigned int m_nNUM_LIGHTS : 3;
|
||||
unsigned int m_nWRITE_DEPTH_TO_DESTALPHA : 2;
|
||||
unsigned int m_nFLASHLIGHTSHADOWS : 2;
|
||||
private:
|
||||
int m_nWRITEWATERFOGTODESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA : 1;
|
||||
bool m_bPIXELFOGTYPE : 1;
|
||||
bool m_bNUM_LIGHTS : 1;
|
||||
bool m_bWRITE_DEPTH_TO_DESTALPHA : 1;
|
||||
bool m_bFLASHLIGHTSHADOWS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITEWATERFOGTODESTALPHA( int i )
|
||||
{
|
||||
@ -254,69 +381,157 @@ public:
|
||||
m_nWRITEWATERFOGTODESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRITEWATERFOGTODESTALPHA( bool i )
|
||||
{
|
||||
m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPIXELFOGTYPE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPIXELFOGTYPE;
|
||||
#endif
|
||||
public:
|
||||
void SetPIXELFOGTYPE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPIXELFOGTYPE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetPIXELFOGTYPE( bool i )
|
||||
{
|
||||
m_nPIXELFOGTYPE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nNUM_LIGHTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bNUM_LIGHTS;
|
||||
#endif
|
||||
public:
|
||||
void SetNUM_LIGHTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 4 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nWRITE_DEPTH_TO_DESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITE_DEPTH_TO_DESTALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
|
||||
{
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTSHADOWS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTSHADOWS;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTSHADOWS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHTSHADOWS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nPHONG_USE_EXPONENT_FACTOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bPHONG_USE_EXPONENT_FACTOR;
|
||||
#endif
|
||||
public:
|
||||
void SetPHONG_USE_EXPONENT_FACTOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = true;
|
||||
#endif
|
||||
}
|
||||
void SetPHONG_USE_EXPONENT_FACTOR( bool i )
|
||||
{
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_ps30_Dynamic_Index()
|
||||
{
|
||||
m_nWRITEWATERFOGTODESTALPHA = 0;
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
m_nNUM_LIGHTS = 0;
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 0;
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITEWATERFOGTODESTALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = false;
|
||||
#endif // _DEBUG
|
||||
m_nNUM_LIGHTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bPHONG_USE_EXPONENT_FACTOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nPHONG_USE_EXPONENT_FACTOR = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS );
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS && m_bPHONG_USE_EXPONENT_FACTOR;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + ( 80 * m_nPHONG_USE_EXPONENT_FACTOR ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_skin_ps30 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS
|
||||
|
||||
|
||||
#endif // SKIN_PS30_H
|
||||
#define shaderDynamicTest_skin_ps30 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_PHONG_USE_EXPONENT_FACTOR + 0
|
||||
|
@ -1,20 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// $USE_STATIC_CONTROL_FLOW && ( $NUM_LIGHTS > 0 )
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
|
||||
#ifndef SKIN_VS20_H
|
||||
#define SKIN_VS20_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class skin_vs20_Static_Index
|
||||
{
|
||||
unsigned int m_nUSE_STATIC_CONTROL_FLOW : 2;
|
||||
private:
|
||||
int m_nUSE_STATIC_CONTROL_FLOW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bUSE_STATIC_CONTROL_FLOW : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bUSE_STATIC_CONTROL_FLOW;
|
||||
#endif
|
||||
public:
|
||||
void SetUSE_STATIC_CONTROL_FLOW( int i )
|
||||
{
|
||||
@ -22,41 +13,42 @@ public:
|
||||
m_nUSE_STATIC_CONTROL_FLOW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
skin_vs20_Static_Index()
|
||||
void SetUSE_STATIC_CONTROL_FLOW( bool i )
|
||||
{
|
||||
m_nUSE_STATIC_CONTROL_FLOW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_vs20_Static_Index( )
|
||||
{
|
||||
m_nUSE_STATIC_CONTROL_FLOW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bUSE_STATIC_CONTROL_FLOW = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nUSE_STATIC_CONTROL_FLOW = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bUSE_STATIC_CONTROL_FLOW );
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bUSE_STATIC_CONTROL_FLOW;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 48 * m_nUSE_STATIC_CONTROL_FLOW ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_skin_vs20 vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW
|
||||
|
||||
|
||||
#define shaderStaticTest_skin_vs20 vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + 0
|
||||
class skin_vs20_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nCOMPRESSED_VERTS : 2;
|
||||
unsigned int m_nDOWATERFOG : 2;
|
||||
unsigned int m_nSKINNING : 2;
|
||||
unsigned int m_nLIGHTING_PREVIEW : 2;
|
||||
unsigned int m_nNUM_LIGHTS : 2;
|
||||
private:
|
||||
int m_nCOMPRESSED_VERTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS : 1;
|
||||
bool m_bDOWATERFOG : 1;
|
||||
bool m_bSKINNING : 1;
|
||||
bool m_bLIGHTING_PREVIEW : 1;
|
||||
bool m_bNUM_LIGHTS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS;
|
||||
#endif
|
||||
public:
|
||||
void SetCOMPRESSED_VERTS( int i )
|
||||
{
|
||||
@ -64,69 +56,132 @@ public:
|
||||
m_nCOMPRESSED_VERTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCOMPRESSED_VERTS( bool i )
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDOWATERFOG;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDOWATERFOG;
|
||||
#endif
|
||||
public:
|
||||
void SetDOWATERFOG( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDOWATERFOG = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDOWATERFOG( bool i )
|
||||
{
|
||||
m_nDOWATERFOG = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSKINNING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSKINNING;
|
||||
#endif
|
||||
public:
|
||||
void SetSKINNING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSKINNING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSKINNING( bool i )
|
||||
{
|
||||
m_nSKINNING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nLIGHTING_PREVIEW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTING_PREVIEW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nLIGHTING_PREVIEW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTING_PREVIEW( bool i )
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nNUM_LIGHTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bNUM_LIGHTS;
|
||||
#endif
|
||||
public:
|
||||
void SetNUM_LIGHTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
skin_vs20_Dynamic_Index()
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
m_nDOWATERFOG = 0;
|
||||
m_nSKINNING = 0;
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
m_nNUM_LIGHTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = false;
|
||||
#endif // _DEBUG
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = false;
|
||||
#endif // _DEBUG
|
||||
m_nDOWATERFOG = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = false;
|
||||
#endif // _DEBUG
|
||||
m_nSKINNING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nNUM_LIGHTS = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS );
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nLIGHTING_PREVIEW ) + ( 16 * m_nNUM_LIGHTS ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_skin_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_NUM_LIGHTS
|
||||
|
||||
|
||||
#endif // SKIN_VS20_H
|
||||
#define shaderDynamicTest_skin_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
|
||||
|
@ -536,6 +536,27 @@ public:
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 0 );
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_ps20_Dynamic_Index()
|
||||
{
|
||||
@ -547,6 +568,10 @@ public:
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
@ -556,7 +581,7 @@ public:
|
||||
bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bLIGHTING_PREVIEW && m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nLIGHTING_PREVIEW ) + 0;
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nLIGHTING_PREVIEW ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + 0
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + 0
|
||||
|
@ -1,58 +1,11 @@
|
||||
#ifndef VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H
|
||||
#define VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class vertexlit_and_unlit_generic_ps20b_Static_Index
|
||||
{
|
||||
unsigned int m_nDETAILTEXTURE : 2;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nDIFFUSELIGHTING : 2;
|
||||
unsigned int m_nENVMAPMASK : 2;
|
||||
unsigned int m_nBASEALPHAENVMAPMASK : 2;
|
||||
unsigned int m_nSELFILLUM : 2;
|
||||
unsigned int m_nVERTEXCOLOR : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nSELFILLUM_ENVMAPMASK_ALPHA : 2;
|
||||
unsigned int m_nDETAIL_BLEND_MODE : 4;
|
||||
unsigned int m_nSEAMLESS_BASE : 2;
|
||||
unsigned int m_nSEAMLESS_DETAIL : 2;
|
||||
unsigned int m_nDISTANCEALPHA : 2;
|
||||
unsigned int m_nDISTANCEALPHAFROMDETAIL : 2;
|
||||
unsigned int m_nSOFT_MASK : 2;
|
||||
unsigned int m_nOUTLINE : 2;
|
||||
unsigned int m_nOUTER_GLOW : 2;
|
||||
unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2;
|
||||
unsigned int m_nDEPTHBLEND : 2;
|
||||
unsigned int m_nBLENDTINTBYBASEALPHA : 2;
|
||||
unsigned int m_nSRGB_INPUT_ADAPTER : 2;
|
||||
unsigned int m_nCUBEMAP_SPHERE_LEGACY : 2;
|
||||
private:
|
||||
int m_nDETAILTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAILTEXTURE : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bDIFFUSELIGHTING : 1;
|
||||
bool m_bENVMAPMASK : 1;
|
||||
bool m_bBASEALPHAENVMAPMASK : 1;
|
||||
bool m_bSELFILLUM : 1;
|
||||
bool m_bVERTEXCOLOR : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bSELFILLUM_ENVMAPMASK_ALPHA : 1;
|
||||
bool m_bDETAIL_BLEND_MODE : 1;
|
||||
bool m_bSEAMLESS_BASE : 1;
|
||||
bool m_bSEAMLESS_DETAIL : 1;
|
||||
bool m_bDISTANCEALPHA : 1;
|
||||
bool m_bDISTANCEALPHAFROMDETAIL : 1;
|
||||
bool m_bSOFT_MASK : 1;
|
||||
bool m_bOUTLINE : 1;
|
||||
bool m_bOUTER_GLOW : 1;
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE : 1;
|
||||
bool m_bDEPTHBLEND : 1;
|
||||
bool m_bBLENDTINTBYBASEALPHA : 1;
|
||||
bool m_bSRGB_INPUT_ADAPTER : 1;
|
||||
bool m_bCUBEMAP_SPHERE_LEGACY : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bDETAILTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAILTEXTURE( int i )
|
||||
{
|
||||
@ -60,266 +13,567 @@ public:
|
||||
m_nDETAILTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAILTEXTURE( bool i )
|
||||
{
|
||||
m_nDETAILTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDIFFUSELIGHTING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDIFFUSELIGHTING;
|
||||
#endif
|
||||
public:
|
||||
void SetDIFFUSELIGHTING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDIFFUSELIGHTING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDIFFUSELIGHTING( bool i )
|
||||
{
|
||||
m_nDIFFUSELIGHTING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nENVMAPMASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bENVMAPMASK;
|
||||
#endif
|
||||
public:
|
||||
void SetENVMAPMASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nENVMAPMASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetENVMAPMASK( bool i )
|
||||
{
|
||||
m_nENVMAPMASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBASEALPHAENVMAPMASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBASEALPHAENVMAPMASK;
|
||||
#endif
|
||||
public:
|
||||
void SetBASEALPHAENVMAPMASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBASEALPHAENVMAPMASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetBASEALPHAENVMAPMASK( bool i )
|
||||
{
|
||||
m_nBASEALPHAENVMAPMASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM( bool i )
|
||||
{
|
||||
m_nSELFILLUM = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nVERTEXCOLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bVERTEXCOLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetVERTEXCOLOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nVERTEXCOLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetVERTEXCOLOR( bool i )
|
||||
{
|
||||
m_nVERTEXCOLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM_ENVMAPMASK_ALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM_ENVMAPMASK_ALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM_ENVMAPMASK_ALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM_ENVMAPMASK_ALPHA( bool i )
|
||||
{
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAIL_BLEND_MODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAIL_BLEND_MODE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAIL_BLEND_MODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 9 );
|
||||
m_nDETAIL_BLEND_MODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAIL_BLEND_MODE( bool i )
|
||||
{
|
||||
m_nDETAIL_BLEND_MODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_BASE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_BASE;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_BASE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_BASE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_BASE( bool i )
|
||||
{
|
||||
m_nSEAMLESS_BASE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_DETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_DETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_DETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_DETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_DETAIL( bool i )
|
||||
{
|
||||
m_nSEAMLESS_DETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDISTANCEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDISTANCEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetDISTANCEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDISTANCEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDISTANCEALPHA( bool i )
|
||||
{
|
||||
m_nDISTANCEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDISTANCEALPHAFROMDETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDISTANCEALPHAFROMDETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetDISTANCEALPHAFROMDETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDISTANCEALPHAFROMDETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDISTANCEALPHAFROMDETAIL( bool i )
|
||||
{
|
||||
m_nDISTANCEALPHAFROMDETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSOFT_MASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSOFT_MASK;
|
||||
#endif
|
||||
public:
|
||||
void SetSOFT_MASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSOFT_MASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSOFT_MASK( bool i )
|
||||
{
|
||||
m_nSOFT_MASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nOUTLINE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bOUTLINE;
|
||||
#endif
|
||||
public:
|
||||
void SetOUTLINE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nOUTLINE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetOUTLINE( bool i )
|
||||
{
|
||||
m_nOUTLINE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nOUTER_GLOW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bOUTER_GLOW;
|
||||
#endif
|
||||
public:
|
||||
void SetOUTER_GLOW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nOUTER_GLOW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetOUTER_GLOW( bool i )
|
||||
{
|
||||
m_nOUTER_GLOW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTDEPTHFILTERMODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDEPTHBLEND;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDEPTHBLEND;
|
||||
#endif
|
||||
public:
|
||||
void SetDEPTHBLEND( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDEPTHBLEND = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDEPTHBLEND( bool i )
|
||||
{
|
||||
m_nDEPTHBLEND = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBLENDTINTBYBASEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBLENDTINTBYBASEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetBLENDTINTBYBASEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBLENDTINTBYBASEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetBLENDTINTBYBASEALPHA( bool i )
|
||||
{
|
||||
m_nBLENDTINTBYBASEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSRGB_INPUT_ADAPTER;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSRGB_INPUT_ADAPTER;
|
||||
#endif
|
||||
public:
|
||||
void SetSRGB_INPUT_ADAPTER( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSRGB_INPUT_ADAPTER = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSRGB_INPUT_ADAPTER = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSRGB_INPUT_ADAPTER( bool i )
|
||||
{
|
||||
m_nSRGB_INPUT_ADAPTER = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSRGB_INPUT_ADAPTER = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP_SPHERE_LEGACY;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP_SPHERE_LEGACY;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP_SPHERE_LEGACY( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP_SPHERE_LEGACY = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP_SPHERE_LEGACY( bool i )
|
||||
{
|
||||
m_nCUBEMAP_SPHERE_LEGACY = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_ps20b_Static_Index( )
|
||||
{
|
||||
m_nDETAILTEXTURE = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nDIFFUSELIGHTING = 0;
|
||||
m_nENVMAPMASK = 0;
|
||||
m_nBASEALPHAENVMAPMASK = 0;
|
||||
m_nSELFILLUM = 0;
|
||||
m_nVERTEXCOLOR = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = 0;
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
m_nDISTANCEALPHA = 0;
|
||||
m_nDISTANCEALPHAFROMDETAIL = 0;
|
||||
m_nSOFT_MASK = 0;
|
||||
m_nOUTLINE = 0;
|
||||
m_nOUTER_GLOW = 0;
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
m_nDEPTHBLEND = 0;
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
m_nSRGB_INPUT_ADAPTER = 0;
|
||||
m_nCUBEMAP_SPHERE_LEGACY = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAILTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = false;
|
||||
#endif // _DEBUG
|
||||
m_nDIFFUSELIGHTING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nENVMAPMASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nBASEALPHAENVMAPMASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nVERTEXCOLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nDISTANCEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nDISTANCEALPHAFROMDETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nSOFT_MASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = false;
|
||||
#endif // _DEBUG
|
||||
m_nOUTLINE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = false;
|
||||
#endif // _DEBUG
|
||||
m_nOUTER_GLOW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = false;
|
||||
#endif // _DEBUG
|
||||
m_nDEPTHBLEND = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSRGB_INPUT_ADAPTER = false;
|
||||
#endif // _DEBUG
|
||||
m_nSRGB_INPUT_ADAPTER = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP_SPHERE_LEGACY = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bSRGB_INPUT_ADAPTER && m_bCUBEMAP_SPHERE_LEGACY );
|
||||
return ( 6 * m_nDETAILTEXTURE ) + ( 12 * m_nCUBEMAP ) + ( 24 * m_nDIFFUSELIGHTING ) + ( 48 * m_nENVMAPMASK ) + ( 96 * m_nBASEALPHAENVMAPMASK ) + ( 192 * m_nSELFILLUM ) + ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nFLASHLIGHT ) + ( 1536 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 3072 * m_nDETAIL_BLEND_MODE ) + ( 30720 * m_nSEAMLESS_BASE ) + ( 61440 * m_nSEAMLESS_DETAIL ) + ( 122880 * m_nDISTANCEALPHA ) + ( 245760 * m_nDISTANCEALPHAFROMDETAIL ) + ( 491520 * m_nSOFT_MASK ) + ( 983040 * m_nOUTLINE ) + ( 1966080 * m_nOUTER_GLOW ) + ( 3932160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 11796480 * m_nDEPTHBLEND ) + ( 23592960 * m_nBLENDTINTBYBASEALPHA ) + ( 47185920 * m_nSRGB_INPUT_ADAPTER ) + ( 94371840 * m_nCUBEMAP_SPHERE_LEGACY ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bSRGB_INPUT_ADAPTER && m_bCUBEMAP_SPHERE_LEGACY;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 24 * m_nDETAILTEXTURE ) + ( 48 * m_nCUBEMAP ) + ( 96 * m_nDIFFUSELIGHTING ) + ( 192 * m_nENVMAPMASK ) + ( 384 * m_nBASEALPHAENVMAPMASK ) + ( 768 * m_nSELFILLUM ) + ( 1536 * m_nVERTEXCOLOR ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 12288 * m_nDETAIL_BLEND_MODE ) + ( 122880 * m_nSEAMLESS_BASE ) + ( 245760 * m_nSEAMLESS_DETAIL ) + ( 491520 * m_nDISTANCEALPHA ) + ( 983040 * m_nDISTANCEALPHAFROMDETAIL ) + ( 1966080 * m_nSOFT_MASK ) + ( 3932160 * m_nOUTLINE ) + ( 7864320 * m_nOUTER_GLOW ) + ( 15728640 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 47185920 * m_nDEPTHBLEND ) + ( 94371840 * m_nBLENDTINTBYBASEALPHA ) + ( 188743680 * m_nSRGB_INPUT_ADAPTER ) + ( 377487360 * m_nCUBEMAP_SPHERE_LEGACY ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_SRGB_INPUT_ADAPTER + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY
|
||||
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_SRGB_INPUT_ADAPTER + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY + 0
|
||||
class vertexlit_and_unlit_generic_ps20b_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nLIGHTING_PREVIEW : 2;
|
||||
unsigned int m_nFLASHLIGHTSHADOWS : 2;
|
||||
private:
|
||||
int m_nLIGHTING_PREVIEW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW : 1;
|
||||
bool m_bFLASHLIGHTSHADOWS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTING_PREVIEW( int i )
|
||||
{
|
||||
@ -327,36 +581,107 @@ public:
|
||||
m_nLIGHTING_PREVIEW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTING_PREVIEW( bool i )
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTSHADOWS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTSHADOWS;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTSHADOWS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHTSHADOWS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
vertexlit_and_unlit_generic_ps20b_Dynamic_Index( )
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDEBUG_LUXELS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDEBUG_LUXELS;
|
||||
#endif
|
||||
public:
|
||||
void SetDEBUG_LUXELS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDEBUG_LUXELS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = true;
|
||||
#endif
|
||||
}
|
||||
void SetDEBUG_LUXELS( bool i )
|
||||
{
|
||||
m_nDEBUG_LUXELS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_ps20b_Dynamic_Index()
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = false;
|
||||
#endif // _DEBUG
|
||||
m_nDEBUG_LUXELS = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS );
|
||||
return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS && m_bSTATIC_LIGHT_LIGHTMAP && m_bDEBUG_LUXELS;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 12 * m_nDEBUG_LUXELS ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS
|
||||
|
||||
|
||||
#endif // VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + psh_forgot_to_set_dynamic_DEBUG_LUXELS + 0
|
||||
|
@ -1,93 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// ($DETAILTEXTURE == 0 ) && ( $DETAIL_BLEND_MODE != 0 )
|
||||
// ($DETAILTEXTURE == 0 ) && ( $SEAMLESS_DETAIL )
|
||||
// ($ENVMAPMASK || $SELFILLUM_ENVMAPMASK_ALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL)
|
||||
// $BASEALPHAENVMAPMASK && $ENVMAPMASK
|
||||
// $BASEALPHAENVMAPMASK && $SELFILLUM
|
||||
// $SELFILLUM && $SELFILLUM_ENVMAPMASK_ALPHA
|
||||
// $SELFILLUM_ENVMAPMASK_ALPHA && (! $ENVMAPMASK)
|
||||
// $ENVMAPMASK && ($FLASHLIGHT || $FLASHLIGHTSHADOWS)
|
||||
// $BASEALPHAENVMAPMASK && ($SEAMLESS_BASE || $SEAMLESS_DETAIL)
|
||||
// ($DISTANCEALPHA == 0) && ($DISTANCEALPHAFROMDETAIL || $SOFT_MASK || $OUTLINE || $OUTER_GLOW)
|
||||
// ($DETAILTEXTURE == 0) && ($DISTANCEALPHAFROMDETAIL)
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
|
||||
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 )
|
||||
// ($DISTANCEALPHA) && ($ENVMAPMASK || $BASEALPHAENVMAPMASK || $SELFILLUM || $SELFILLUM_ENVMAPMASK_ALPHA )
|
||||
// ($DISTANCEALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL || $CUBEMAP || $LIGHTING_PREVIEW )
|
||||
// ($DISTANCEALPHA) && ($WRITEWATERFOGTODESTALPHA || $PIXELFOGTYPE || $FLASHLIGHT || $FLASHLIGHTSHADOWS || $SRGB_INPUT_ADAPTER )
|
||||
// $SEAMLESS_BASE && $SRGB_INPUT_ADAPTER
|
||||
// $SEAMLESS_BASE && ($BLENDTINTBYBASEALPHA )
|
||||
// ($BLENDTINTBYBASEALPHA) && ($SELFILLUM || (($DISTANCEALPHA) && ($DISTANCEALPHAFROMDETAIL == 0)) || $BASEALPHAENVMAPMASK)
|
||||
// $FLASHLIGHT && $CUBEMAP
|
||||
// $CUBEMAP_SPHERE_LEGACY && ($CUBEMAP == 0)
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED
|
||||
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
||||
// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
||||
|
||||
#ifndef VERTEXLIT_AND_UNLIT_GENERIC_PS30_H
|
||||
#define VERTEXLIT_AND_UNLIT_GENERIC_PS30_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class vertexlit_and_unlit_generic_ps30_Static_Index
|
||||
{
|
||||
unsigned int m_nDETAILTEXTURE : 2;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nDIFFUSELIGHTING : 2;
|
||||
unsigned int m_nENVMAPMASK : 2;
|
||||
unsigned int m_nBASEALPHAENVMAPMASK : 2;
|
||||
unsigned int m_nSELFILLUM : 2;
|
||||
unsigned int m_nVERTEXCOLOR : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nSELFILLUM_ENVMAPMASK_ALPHA : 2;
|
||||
unsigned int m_nDETAIL_BLEND_MODE : 4;
|
||||
unsigned int m_nSEAMLESS_BASE : 2;
|
||||
unsigned int m_nSEAMLESS_DETAIL : 2;
|
||||
unsigned int m_nDISTANCEALPHA : 2;
|
||||
unsigned int m_nDISTANCEALPHAFROMDETAIL : 2;
|
||||
unsigned int m_nSOFT_MASK : 2;
|
||||
unsigned int m_nOUTLINE : 2;
|
||||
unsigned int m_nOUTER_GLOW : 2;
|
||||
unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2;
|
||||
unsigned int m_nDEPTHBLEND : 2;
|
||||
unsigned int m_nBLENDTINTBYBASEALPHA : 2;
|
||||
unsigned int m_nCUBEMAP_SPHERE_LEGACY : 2;
|
||||
private:
|
||||
int m_nDETAILTEXTURE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAILTEXTURE : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bDIFFUSELIGHTING : 1;
|
||||
bool m_bENVMAPMASK : 1;
|
||||
bool m_bBASEALPHAENVMAPMASK : 1;
|
||||
bool m_bSELFILLUM : 1;
|
||||
bool m_bVERTEXCOLOR : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bSELFILLUM_ENVMAPMASK_ALPHA : 1;
|
||||
bool m_bDETAIL_BLEND_MODE : 1;
|
||||
bool m_bSEAMLESS_BASE : 1;
|
||||
bool m_bSEAMLESS_DETAIL : 1;
|
||||
bool m_bDISTANCEALPHA : 1;
|
||||
bool m_bDISTANCEALPHAFROMDETAIL : 1;
|
||||
bool m_bSOFT_MASK : 1;
|
||||
bool m_bOUTLINE : 1;
|
||||
bool m_bOUTER_GLOW : 1;
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE : 1;
|
||||
bool m_bDEPTHBLEND : 1;
|
||||
bool m_bBLENDTINTBYBASEALPHA : 1;
|
||||
bool m_bCUBEMAP_SPHERE_LEGACY : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bDETAILTEXTURE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAILTEXTURE( int i )
|
||||
{
|
||||
@ -95,255 +13,542 @@ public:
|
||||
m_nDETAILTEXTURE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAILTEXTURE( bool i )
|
||||
{
|
||||
m_nDETAILTEXTURE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDIFFUSELIGHTING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDIFFUSELIGHTING;
|
||||
#endif
|
||||
public:
|
||||
void SetDIFFUSELIGHTING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDIFFUSELIGHTING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDIFFUSELIGHTING( bool i )
|
||||
{
|
||||
m_nDIFFUSELIGHTING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nENVMAPMASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bENVMAPMASK;
|
||||
#endif
|
||||
public:
|
||||
void SetENVMAPMASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nENVMAPMASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetENVMAPMASK( bool i )
|
||||
{
|
||||
m_nENVMAPMASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBASEALPHAENVMAPMASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBASEALPHAENVMAPMASK;
|
||||
#endif
|
||||
public:
|
||||
void SetBASEALPHAENVMAPMASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBASEALPHAENVMAPMASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetBASEALPHAENVMAPMASK( bool i )
|
||||
{
|
||||
m_nBASEALPHAENVMAPMASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM( bool i )
|
||||
{
|
||||
m_nSELFILLUM = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nVERTEXCOLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bVERTEXCOLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetVERTEXCOLOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nVERTEXCOLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetVERTEXCOLOR( bool i )
|
||||
{
|
||||
m_nVERTEXCOLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSELFILLUM_ENVMAPMASK_ALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSELFILLUM_ENVMAPMASK_ALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetSELFILLUM_ENVMAPMASK_ALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSELFILLUM_ENVMAPMASK_ALPHA( bool i )
|
||||
{
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDETAIL_BLEND_MODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDETAIL_BLEND_MODE;
|
||||
#endif
|
||||
public:
|
||||
void SetDETAIL_BLEND_MODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 9 );
|
||||
m_nDETAIL_BLEND_MODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDETAIL_BLEND_MODE( bool i )
|
||||
{
|
||||
m_nDETAIL_BLEND_MODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_BASE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_BASE;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_BASE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_BASE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_BASE( bool i )
|
||||
{
|
||||
m_nSEAMLESS_BASE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_DETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_DETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_DETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_DETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_DETAIL( bool i )
|
||||
{
|
||||
m_nSEAMLESS_DETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDISTANCEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDISTANCEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetDISTANCEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDISTANCEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDISTANCEALPHA( bool i )
|
||||
{
|
||||
m_nDISTANCEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDISTANCEALPHAFROMDETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDISTANCEALPHAFROMDETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetDISTANCEALPHAFROMDETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDISTANCEALPHAFROMDETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDISTANCEALPHAFROMDETAIL( bool i )
|
||||
{
|
||||
m_nDISTANCEALPHAFROMDETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSOFT_MASK;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSOFT_MASK;
|
||||
#endif
|
||||
public:
|
||||
void SetSOFT_MASK( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSOFT_MASK = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSOFT_MASK( bool i )
|
||||
{
|
||||
m_nSOFT_MASK = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nOUTLINE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bOUTLINE;
|
||||
#endif
|
||||
public:
|
||||
void SetOUTLINE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nOUTLINE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetOUTLINE( bool i )
|
||||
{
|
||||
m_nOUTLINE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nOUTER_GLOW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bOUTER_GLOW;
|
||||
#endif
|
||||
public:
|
||||
void SetOUTER_GLOW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nOUTER_GLOW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetOUTER_GLOW( bool i )
|
||||
{
|
||||
m_nOUTER_GLOW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTDEPTHFILTERMODE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 2 );
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDEPTHBLEND;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDEPTHBLEND;
|
||||
#endif
|
||||
public:
|
||||
void SetDEPTHBLEND( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDEPTHBLEND = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDEPTHBLEND( bool i )
|
||||
{
|
||||
m_nDEPTHBLEND = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nBLENDTINTBYBASEALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bBLENDTINTBYBASEALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetBLENDTINTBYBASEALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nBLENDTINTBYBASEALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetBLENDTINTBYBASEALPHA( bool i )
|
||||
{
|
||||
m_nBLENDTINTBYBASEALPHA = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP_SPHERE_LEGACY;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP_SPHERE_LEGACY;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP_SPHERE_LEGACY( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP_SPHERE_LEGACY = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
vertexlit_and_unlit_generic_ps30_Static_Index()
|
||||
void SetCUBEMAP_SPHERE_LEGACY( bool i )
|
||||
{
|
||||
m_nCUBEMAP_SPHERE_LEGACY = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_ps30_Static_Index( )
|
||||
{
|
||||
m_nDETAILTEXTURE = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nDIFFUSELIGHTING = 0;
|
||||
m_nENVMAPMASK = 0;
|
||||
m_nBASEALPHAENVMAPMASK = 0;
|
||||
m_nSELFILLUM = 0;
|
||||
m_nVERTEXCOLOR = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = 0;
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
m_nDISTANCEALPHA = 0;
|
||||
m_nDISTANCEALPHAFROMDETAIL = 0;
|
||||
m_nSOFT_MASK = 0;
|
||||
m_nOUTLINE = 0;
|
||||
m_nOUTER_GLOW = 0;
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
m_nDEPTHBLEND = 0;
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
m_nCUBEMAP_SPHERE_LEGACY = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAILTEXTURE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAILTEXTURE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDIFFUSELIGHTING = false;
|
||||
#endif // _DEBUG
|
||||
m_nDIFFUSELIGHTING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bENVMAPMASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nENVMAPMASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBASEALPHAENVMAPMASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nBASEALPHAENVMAPMASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nVERTEXCOLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSELFILLUM_ENVMAPMASK_ALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nSELFILLUM_ENVMAPMASK_ALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDETAIL_BLEND_MODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nDETAIL_BLEND_MODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nDISTANCEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDISTANCEALPHAFROMDETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nDISTANCEALPHAFROMDETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSOFT_MASK = false;
|
||||
#endif // _DEBUG
|
||||
m_nSOFT_MASK = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTLINE = false;
|
||||
#endif // _DEBUG
|
||||
m_nOUTLINE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bOUTER_GLOW = false;
|
||||
#endif // _DEBUG
|
||||
m_nOUTER_GLOW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEPTHBLEND = false;
|
||||
#endif // _DEBUG
|
||||
m_nDEPTHBLEND = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bBLENDTINTBYBASEALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nBLENDTINTBYBASEALPHA = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP_SPHERE_LEGACY = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP_SPHERE_LEGACY = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bCUBEMAP_SPHERE_LEGACY );
|
||||
return ( 6 * m_nDETAILTEXTURE ) + ( 12 * m_nCUBEMAP ) + ( 24 * m_nDIFFUSELIGHTING ) + ( 48 * m_nENVMAPMASK ) + ( 96 * m_nBASEALPHAENVMAPMASK ) + ( 192 * m_nSELFILLUM ) + ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nFLASHLIGHT ) + ( 1536 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 3072 * m_nDETAIL_BLEND_MODE ) + ( 30720 * m_nSEAMLESS_BASE ) + ( 61440 * m_nSEAMLESS_DETAIL ) + ( 122880 * m_nDISTANCEALPHA ) + ( 245760 * m_nDISTANCEALPHAFROMDETAIL ) + ( 491520 * m_nSOFT_MASK ) + ( 983040 * m_nOUTLINE ) + ( 1966080 * m_nOUTER_GLOW ) + ( 3932160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 11796480 * m_nDEPTHBLEND ) + ( 23592960 * m_nBLENDTINTBYBASEALPHA ) + ( 47185920 * m_nCUBEMAP_SPHERE_LEGACY ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bCUBEMAP_SPHERE_LEGACY;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 24 * m_nDETAILTEXTURE ) + ( 48 * m_nCUBEMAP ) + ( 96 * m_nDIFFUSELIGHTING ) + ( 192 * m_nENVMAPMASK ) + ( 384 * m_nBASEALPHAENVMAPMASK ) + ( 768 * m_nSELFILLUM ) + ( 1536 * m_nVERTEXCOLOR ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 12288 * m_nDETAIL_BLEND_MODE ) + ( 122880 * m_nSEAMLESS_BASE ) + ( 245760 * m_nSEAMLESS_DETAIL ) + ( 491520 * m_nDISTANCEALPHA ) + ( 983040 * m_nDISTANCEALPHAFROMDETAIL ) + ( 1966080 * m_nSOFT_MASK ) + ( 3932160 * m_nOUTLINE ) + ( 7864320 * m_nOUTER_GLOW ) + ( 15728640 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 47185920 * m_nDEPTHBLEND ) + ( 94371840 * m_nBLENDTINTBYBASEALPHA ) + ( 188743680 * m_nCUBEMAP_SPHERE_LEGACY ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY
|
||||
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY + 0
|
||||
class vertexlit_and_unlit_generic_ps30_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nLIGHTING_PREVIEW : 2;
|
||||
unsigned int m_nFLASHLIGHTSHADOWS : 2;
|
||||
private:
|
||||
int m_nLIGHTING_PREVIEW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW : 1;
|
||||
bool m_bFLASHLIGHTSHADOWS : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTING_PREVIEW( int i )
|
||||
{
|
||||
@ -351,36 +556,107 @@ public:
|
||||
m_nLIGHTING_PREVIEW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTING_PREVIEW( bool i )
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHTSHADOWS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHTSHADOWS;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHTSHADOWS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHTSHADOWS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDEBUG_LUXELS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDEBUG_LUXELS;
|
||||
#endif
|
||||
public:
|
||||
void SetDEBUG_LUXELS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDEBUG_LUXELS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = true;
|
||||
#endif
|
||||
}
|
||||
void SetDEBUG_LUXELS( bool i )
|
||||
{
|
||||
m_nDEBUG_LUXELS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_ps30_Dynamic_Index()
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDEBUG_LUXELS = false;
|
||||
#endif // _DEBUG
|
||||
m_nDEBUG_LUXELS = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS );
|
||||
return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS && m_bSTATIC_LIGHT_LIGHTMAP && m_bDEBUG_LUXELS;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 12 * m_nDEBUG_LUXELS ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS
|
||||
|
||||
|
||||
#endif // VERTEXLIT_AND_UNLIT_GENERIC_PS30_H
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + psh_forgot_to_set_dynamic_DEBUG_LUXELS + 0
|
||||
|
@ -1,37 +1,11 @@
|
||||
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
||||
// ($SEPARATE_DETAIL_UVS) && ($SEAMLESS_DETAIL)
|
||||
// ($DONT_GAMMA_CONVERT_VERTEX_COLOR && ( ! $VERTEXCOLOR ) )
|
||||
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
||||
|
||||
#ifndef VERTEXLIT_AND_UNLIT_GENERIC_VS30_H
|
||||
#define VERTEXLIT_AND_UNLIT_GENERIC_VS30_H
|
||||
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
#include "shaderapi/ishadershadow.h"
|
||||
#include "materialsystem/imaterialvar.h"
|
||||
|
||||
#include "shaderlib/cshader.h"
|
||||
class vertexlit_and_unlit_generic_vs30_Static_Index
|
||||
{
|
||||
unsigned int m_nVERTEXCOLOR : 2;
|
||||
unsigned int m_nCUBEMAP : 2;
|
||||
unsigned int m_nHALFLAMBERT : 2;
|
||||
unsigned int m_nFLASHLIGHT : 2;
|
||||
unsigned int m_nSEAMLESS_BASE : 2;
|
||||
unsigned int m_nSEAMLESS_DETAIL : 2;
|
||||
unsigned int m_nSEPARATE_DETAIL_UVS : 2;
|
||||
unsigned int m_nDECAL : 2;
|
||||
unsigned int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR : 2;
|
||||
private:
|
||||
int m_nVERTEXCOLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bVERTEXCOLOR : 1;
|
||||
bool m_bCUBEMAP : 1;
|
||||
bool m_bHALFLAMBERT : 1;
|
||||
bool m_bFLASHLIGHT : 1;
|
||||
bool m_bSEAMLESS_BASE : 1;
|
||||
bool m_bSEAMLESS_DETAIL : 1;
|
||||
bool m_bSEPARATE_DETAIL_UVS : 1;
|
||||
bool m_bDECAL : 1;
|
||||
bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bVERTEXCOLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetVERTEXCOLOR( int i )
|
||||
{
|
||||
@ -39,133 +13,242 @@ public:
|
||||
m_nVERTEXCOLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetVERTEXCOLOR( bool i )
|
||||
{
|
||||
m_nVERTEXCOLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nCUBEMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCUBEMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetCUBEMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCUBEMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCUBEMAP( bool i )
|
||||
{
|
||||
m_nCUBEMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nHALFLAMBERT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bHALFLAMBERT;
|
||||
#endif
|
||||
public:
|
||||
void SetHALFLAMBERT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nHALFLAMBERT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetHALFLAMBERT( bool i )
|
||||
{
|
||||
m_nHALFLAMBERT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nFLASHLIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bFLASHLIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetFLASHLIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nFLASHLIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_BASE;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_BASE;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_BASE( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_BASE = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_BASE( bool i )
|
||||
{
|
||||
m_nSEAMLESS_BASE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEAMLESS_DETAIL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEAMLESS_DETAIL;
|
||||
#endif
|
||||
public:
|
||||
void SetSEAMLESS_DETAIL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEAMLESS_DETAIL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEAMLESS_DETAIL( bool i )
|
||||
{
|
||||
m_nSEAMLESS_DETAIL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSEPARATE_DETAIL_UVS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSEPARATE_DETAIL_UVS;
|
||||
#endif
|
||||
public:
|
||||
void SetSEPARATE_DETAIL_UVS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSEPARATE_DETAIL_UVS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSEPARATE_DETAIL_UVS( bool i )
|
||||
{
|
||||
m_nSEPARATE_DETAIL_UVS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDECAL;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDECAL;
|
||||
#endif
|
||||
public:
|
||||
void SetDECAL( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDECAL = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDECAL = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDECAL( bool i )
|
||||
{
|
||||
m_nDECAL = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDECAL = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
#endif
|
||||
public:
|
||||
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
vertexlit_and_unlit_generic_vs30_Static_Index()
|
||||
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( bool i )
|
||||
{
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_vs30_Static_Index( )
|
||||
{
|
||||
m_nVERTEXCOLOR = 0;
|
||||
m_nCUBEMAP = 0;
|
||||
m_nHALFLAMBERT = 0;
|
||||
m_nFLASHLIGHT = 0;
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
m_nSEPARATE_DETAIL_UVS = 0;
|
||||
m_nDECAL = 0;
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bVERTEXCOLOR = false;
|
||||
#endif // _DEBUG
|
||||
m_nVERTEXCOLOR = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCUBEMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nCUBEMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bHALFLAMBERT = false;
|
||||
#endif // _DEBUG
|
||||
m_nHALFLAMBERT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_BASE = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_BASE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEAMLESS_DETAIL = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEAMLESS_DETAIL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSEPARATE_DETAIL_UVS = false;
|
||||
#endif // _DEBUG
|
||||
m_nSEPARATE_DETAIL_UVS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDECAL = false;
|
||||
#endif // _DEBUG
|
||||
m_nDECAL = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bVERTEXCOLOR && m_bCUBEMAP && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bSEPARATE_DETAIL_UVS && m_bDECAL && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR );
|
||||
return ( 128 * m_nVERTEXCOLOR ) + ( 256 * m_nCUBEMAP ) + ( 512 * m_nHALFLAMBERT ) + ( 1024 * m_nFLASHLIGHT ) + ( 2048 * m_nSEAMLESS_BASE ) + ( 4096 * m_nSEAMLESS_DETAIL ) + ( 8192 * m_nSEPARATE_DETAIL_UVS ) + ( 16384 * m_nDECAL ) + ( 32768 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllStaticVarsDefined = m_bVERTEXCOLOR && m_bCUBEMAP && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bSEPARATE_DETAIL_UVS && m_bDECAL && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 256 * m_nVERTEXCOLOR ) + ( 512 * m_nCUBEMAP ) + ( 1024 * m_nHALFLAMBERT ) + ( 2048 * m_nFLASHLIGHT ) + ( 4096 * m_nSEAMLESS_BASE ) + ( 8192 * m_nSEAMLESS_DETAIL ) + ( 16384 * m_nSEPARATE_DETAIL_UVS ) + ( 32768 * m_nDECAL ) + ( 65536 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_CUBEMAP + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SEAMLESS_BASE + vsh_forgot_to_set_static_SEAMLESS_DETAIL + vsh_forgot_to_set_static_SEPARATE_DETAIL_UVS + vsh_forgot_to_set_static_DECAL + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR
|
||||
|
||||
|
||||
#define shaderStaticTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_CUBEMAP + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SEAMLESS_BASE + vsh_forgot_to_set_static_SEAMLESS_DETAIL + vsh_forgot_to_set_static_SEPARATE_DETAIL_UVS + vsh_forgot_to_set_static_DECAL + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR + 0
|
||||
class vertexlit_and_unlit_generic_vs30_Dynamic_Index
|
||||
{
|
||||
unsigned int m_nCOMPRESSED_VERTS : 2;
|
||||
unsigned int m_nDYNAMIC_LIGHT : 2;
|
||||
unsigned int m_nSTATIC_LIGHT : 2;
|
||||
unsigned int m_nDOWATERFOG : 2;
|
||||
unsigned int m_nSKINNING : 2;
|
||||
unsigned int m_nLIGHTING_PREVIEW : 2;
|
||||
unsigned int m_nMORPHING : 2;
|
||||
private:
|
||||
int m_nCOMPRESSED_VERTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS : 1;
|
||||
bool m_bDYNAMIC_LIGHT : 1;
|
||||
bool m_bSTATIC_LIGHT : 1;
|
||||
bool m_bDOWATERFOG : 1;
|
||||
bool m_bSKINNING : 1;
|
||||
bool m_bLIGHTING_PREVIEW : 1;
|
||||
bool m_bMORPHING : 1;
|
||||
#endif // _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS;
|
||||
#endif
|
||||
public:
|
||||
void SetCOMPRESSED_VERTS( int i )
|
||||
{
|
||||
@ -173,91 +256,207 @@ public:
|
||||
m_nCOMPRESSED_VERTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCOMPRESSED_VERTS( bool i )
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDYNAMIC_LIGHT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDYNAMIC_LIGHT;
|
||||
#endif
|
||||
public:
|
||||
void SetDYNAMIC_LIGHT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDYNAMIC_LIGHT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSTATIC_LIGHT( int i )
|
||||
void SetDYNAMIC_LIGHT( bool i )
|
||||
{
|
||||
m_nDYNAMIC_LIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_VERTEX;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_VERTEX;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_VERTEX( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT = i;
|
||||
m_nSTATIC_LIGHT_VERTEX = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT = true;
|
||||
#endif // _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSTATIC_LIGHT_VERTEX( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_VERTEX = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||||
#endif
|
||||
public:
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||||
{
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nDOWATERFOG;
|
||||
#ifdef _DEBUG
|
||||
bool m_bDOWATERFOG;
|
||||
#endif
|
||||
public:
|
||||
void SetDOWATERFOG( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nDOWATERFOG = i;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDOWATERFOG( bool i )
|
||||
{
|
||||
m_nDOWATERFOG = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nSKINNING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bSKINNING;
|
||||
#endif
|
||||
public:
|
||||
void SetSKINNING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nSKINNING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSKINNING( bool i )
|
||||
{
|
||||
m_nSKINNING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nLIGHTING_PREVIEW;
|
||||
#ifdef _DEBUG
|
||||
bool m_bLIGHTING_PREVIEW;
|
||||
#endif
|
||||
public:
|
||||
void SetLIGHTING_PREVIEW( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nLIGHTING_PREVIEW = i;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetLIGHTING_PREVIEW( bool i )
|
||||
{
|
||||
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = true;
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
int m_nMORPHING;
|
||||
#ifdef _DEBUG
|
||||
bool m_bMORPHING;
|
||||
#endif
|
||||
public:
|
||||
void SetMORPHING( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nMORPHING = i;
|
||||
#ifdef _DEBUG
|
||||
m_bMORPHING = true;
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetMORPHING( bool i )
|
||||
{
|
||||
m_nMORPHING = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bMORPHING = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
vertexlit_and_unlit_generic_vs30_Dynamic_Index()
|
||||
{
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
m_nDYNAMIC_LIGHT = 0;
|
||||
m_nSTATIC_LIGHT = 0;
|
||||
m_nDOWATERFOG = 0;
|
||||
m_nSKINNING = 0;
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
m_nMORPHING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = false;
|
||||
#endif // _DEBUG
|
||||
m_nCOMPRESSED_VERTS = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDYNAMIC_LIGHT = false;
|
||||
m_bSTATIC_LIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nDYNAMIC_LIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_VERTEX = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_VERTEX = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||||
#endif // _DEBUG
|
||||
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bDOWATERFOG = false;
|
||||
#endif // _DEBUG
|
||||
m_nDOWATERFOG = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bSKINNING = false;
|
||||
#endif // _DEBUG
|
||||
m_nSKINNING = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bLIGHTING_PREVIEW = false;
|
||||
#endif // _DEBUG
|
||||
m_nLIGHTING_PREVIEW = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bMORPHING = false;
|
||||
#endif // _DEBUG
|
||||
#endif // _DEBUG
|
||||
m_nMORPHING = 0;
|
||||
}
|
||||
|
||||
int GetIndex() const
|
||||
int GetIndex()
|
||||
{
|
||||
Assert( m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bMORPHING );
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT ) + ( 8 * m_nDOWATERFOG ) + ( 16 * m_nSKINNING ) + ( 32 * m_nLIGHTING_PREVIEW ) + ( 64 * m_nMORPHING ) + 0;
|
||||
// Asserts to make sure that we aren't using any skipped combinations.
|
||||
// Asserts to make sure that we are setting all of the combination vars.
|
||||
#ifdef _DEBUG
|
||||
bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT_VERTEX && m_bSTATIC_LIGHT_LIGHTMAP && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bMORPHING;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT_VERTEX ) + ( 8 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 16 * m_nDOWATERFOG ) + ( 32 * m_nSKINNING ) + ( 64 * m_nLIGHTING_PREVIEW ) + ( 128 * m_nMORPHING ) + 0;
|
||||
}
|
||||
};
|
||||
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_MORPHING
|
||||
|
||||
|
||||
#endif // VERTEXLIT_AND_UNLIT_GENERIC_VS30_H
|
||||
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT_VERTEX + vsh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_MORPHING + 0
|
||||
|
@ -350,36 +350,6 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
pContextData->m_bFullyOpaque = bFullyOpaque;
|
||||
pContextData->m_bFullyOpaqueWithoutAlphaTest = bFullyOpaqueWithoutAlphaTest;
|
||||
|
||||
NormalDecodeMode_t nNormalDecodeMode = NORMAL_DECODE_NONE;
|
||||
if ( hasBump && g_pHardwareConfig->SupportsNormalMapCompression() && g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
ITexture *pBumpTex = params[info.m_nBumpmap]->GetTextureValue();
|
||||
if ( pBumpTex )
|
||||
{
|
||||
nNormalDecodeMode = pBumpTex->GetNormalDecodeMode();
|
||||
|
||||
if ( hasBump2 ) // Check encoding of secondary normal if there is oneg
|
||||
{
|
||||
ITexture *pBumpTex2 = params[info.m_nBumpmap]->GetTextureValue();
|
||||
if ( pBumpTex2 && ( pBumpTex2->GetNormalDecodeMode() != nNormalDecodeMode ) )
|
||||
{
|
||||
DevMsg("LightmappedGeneric: Primary and Secondary normal map compression formats don't match. This is unsupported!\n");
|
||||
Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nNormalMaskDecodeMode = 0;
|
||||
if ( hasBumpMask && g_pHardwareConfig->SupportsNormalMapCompression() && g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
ITexture *pBumpMaskTex = params[info.m_nBumpMask]->GetTextureValue();
|
||||
if ( pBumpMaskTex )
|
||||
{
|
||||
nNormalMaskDecodeMode = pBumpMaskTex->GetNormalDecodeMode();
|
||||
}
|
||||
}
|
||||
|
||||
bool bHasOutline = IsBoolSet( info.m_nOutline, params );
|
||||
pContextData->m_bPixelShaderForceFastPathBecauseOutline = bHasOutline;
|
||||
bool bHasSoftEdges = IsBoolSet( info.m_nSoftEdges, params );
|
||||
@ -513,26 +483,14 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
if( hasBump || hasNormalMapAlphaEnvmapMask )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER4, true );
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER9, true ); // Normal map alpha, in the compressed normal case
|
||||
}
|
||||
}
|
||||
if( hasBump2 )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER5, true );
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER10, true ); // Secondary normal alpha, in the compressed normal case
|
||||
}
|
||||
}
|
||||
if( hasBumpMask )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER8, true );
|
||||
if ( nNormalMaskDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER11, true ); // Normal mask alpha, in the compressed normal case
|
||||
}
|
||||
}
|
||||
if( hasEnvmapMask )
|
||||
{
|
||||
@ -611,8 +569,8 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( OUTLINE, bHasOutline );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SOFTEDGES, bHasSoftEdges );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( DETAIL_BLEND_MODE, nDetailBlendMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMALMASK_DECODE_MODE, (int) nNormalMaskDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMALMASK_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
#ifdef _X360
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( FLASHLIGHT, hasFlashlight);
|
||||
#endif
|
||||
@ -854,14 +812,7 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
{
|
||||
if( !g_pConfig->m_bFastNoBump )
|
||||
{
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pContextData->m_SemiStaticCmdsOut.BindMultiTexture( pShader, SHADER_SAMPLER4, SHADER_SAMPLER9, info.m_nBumpmap, info.m_nBumpFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER4, info.m_nBumpmap, info.m_nBumpFrame );
|
||||
}
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER4, info.m_nBumpmap, info.m_nBumpFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -872,14 +823,7 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
{
|
||||
if( !g_pConfig->m_bFastNoBump )
|
||||
{
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pContextData->m_SemiStaticCmdsOut.BindMultiTexture( pShader, SHADER_SAMPLER5, SHADER_SAMPLER10, info.m_nBumpmap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER5, info.m_nBumpmap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER5, info.m_nBumpmap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -890,15 +834,7 @@ void DrawLightmappedGeneric_DX9_Internal(CBaseVSShader *pShader, IMaterialVar**
|
||||
{
|
||||
if( !g_pConfig->m_bFastNoBump )
|
||||
{
|
||||
if ( nNormalMaskDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
Assert(0);
|
||||
//pContextData->m_SemiStaticCmdsOut.BindTexture( SHADER_SAMPLER8, SHADER_SAMPLER11, info.m_nBumpMask );
|
||||
}
|
||||
else
|
||||
{
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER8, info.m_nBumpMask, -1 );
|
||||
}
|
||||
pContextData->m_SemiStaticCmdsOut.BindTexture( pShader, SHADER_SAMPLER8, info.m_nBumpMask, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -112,26 +112,6 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
bool bTranslucentNormal = pShader->TextureIsTranslucent( info.m_nNormalMap, false );
|
||||
bFullyOpaque &= (! bTranslucentNormal );
|
||||
|
||||
NormalDecodeMode_t nNormalDecodeMode = NORMAL_DECODE_NONE;
|
||||
if ( g_pHardwareConfig->SupportsNormalMapCompression() )
|
||||
{
|
||||
ITexture *pBumpTex = params[info.m_nNormalMap]->GetTextureValue();
|
||||
if ( pBumpTex )
|
||||
{
|
||||
nNormalDecodeMode = pBumpTex->GetNormalDecodeMode();
|
||||
|
||||
if ( bSecondaryNormal ) // Check encoding of secondary normal if there is one
|
||||
{
|
||||
ITexture *pBumpTex2 = params[info.m_nNormalMap2]->GetTextureValue();
|
||||
if ( pBumpTex2 && ( pBumpTex2->GetNormalDecodeMode() != nNormalDecodeMode ) )
|
||||
{
|
||||
DevMsg("Refract: Primary and Secondary normal map compression formats don't match. This is unsupported!\n");
|
||||
Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShader->SetInitialShadowState( );
|
||||
@ -154,19 +134,9 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
|
||||
// normal map
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER3, true );
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER6, true ); // Normal map alpha, in the compressed normal case
|
||||
}
|
||||
|
||||
if ( bSecondaryNormal )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
|
||||
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER7, true ); // Secondary normal map alpha, in the compressed normal case
|
||||
}
|
||||
}
|
||||
|
||||
if( bHasEnvmap )
|
||||
@ -223,7 +193,7 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MASKED, bMasked );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( COLORMODULATE, bColorModulate );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SECONDARY_NORMAL, bSecondaryNormal );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SHADER_SRGB_READ, bShaderSRGBConvert );
|
||||
SET_STATIC_PIXEL_SHADER( refract_ps20b );
|
||||
}
|
||||
@ -237,7 +207,7 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MASKED, bMasked );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( COLORMODULATE, bColorModulate );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SECONDARY_NORMAL, bSecondaryNormal );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( refract_ps20 );
|
||||
}
|
||||
pShader->DefaultFog();
|
||||
@ -262,25 +232,11 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
pShaderAPI->BindStandardTexture( SHADER_SAMPLER2, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 );
|
||||
}
|
||||
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER3, SHADER_SAMPLER6, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER3, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
}
|
||||
pShader->BindTexture( SHADER_SAMPLER3, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
|
||||
if ( bSecondaryNormal )
|
||||
{
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER1, SHADER_SAMPLER7, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER1, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
pShader->BindTexture( SHADER_SAMPLER1, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
|
||||
if( bHasEnvmap )
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@ -31,6 +31,8 @@ BEGIN_VS_SHADER_FLAGS( screenspace_general_dx9, "Help for screenspace_general",
|
||||
SHADER_PARAM( PIXSHADER, SHADER_PARAM_TYPE_STRING, "", "Name of the pixel shader to use" )
|
||||
SHADER_PARAM( DISABLE_COLOR_WRITES,SHADER_PARAM_TYPE_INTEGER,"0","")
|
||||
SHADER_PARAM( ALPHATESTED,SHADER_PARAM_TYPE_FLOAT,"0","")
|
||||
SHADER_PARAM( ALPHA_BLEND_COLOR_OVERLAY, SHADER_PARAM_TYPE_INTEGER, "0", "")
|
||||
SHADER_PARAM( ALPHA_BLEND, SHADER_PARAM_TYPE_INTEGER, "0", "")
|
||||
SHADER_PARAM( TEXTURE1, SHADER_PARAM_TYPE_TEXTURE, "", "" )
|
||||
SHADER_PARAM( TEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "", "" )
|
||||
SHADER_PARAM( TEXTURE3, SHADER_PARAM_TYPE_TEXTURE, "", "" )
|
||||
@ -40,25 +42,66 @@ BEGIN_VS_SHADER_FLAGS( screenspace_general_dx9, "Help for screenspace_general",
|
||||
SHADER_PARAM( LINEARREAD_TEXTURE3, SHADER_PARAM_TYPE_INTEGER, "0", "" )
|
||||
SHADER_PARAM( LINEARWRITE,SHADER_PARAM_TYPE_INTEGER,"0","")
|
||||
SHADER_PARAM( X360APPCHOOSER, SHADER_PARAM_TYPE_INTEGER, "0", "Needed for movies in 360 launcher" )
|
||||
SHADER_PARAM( COPYALPHA, SHADER_PARAM_TYPE_INTEGER, "0", "")
|
||||
END_SHADER_PARAMS
|
||||
|
||||
SHADER_INIT
|
||||
{
|
||||
if ( params[BASETEXTURE]->IsDefined() )
|
||||
{
|
||||
#ifdef POSIX
|
||||
ImageFormat fmt = params[BASETEXTURE]->GetTextureValue()->GetImageFormat();
|
||||
bool bSRGB;
|
||||
if ( ( fmt == IMAGE_FORMAT_RGBA16161616F ) || ( fmt == IMAGE_FORMAT_RGBA16161616 ) )
|
||||
bSRGB = false;
|
||||
else
|
||||
bSRGB = !params[LINEARREAD_BASETEXTURE]->IsDefined() || !params[LINEARREAD_BASETEXTURE]->GetIntValue();
|
||||
LoadTexture( BASETEXTURE, bSRGB ? TEXTUREFLAGS_SRGB : 0 );
|
||||
#else
|
||||
LoadTexture( BASETEXTURE );
|
||||
#endif // POSIX
|
||||
}
|
||||
if ( params[TEXTURE1]->IsDefined() )
|
||||
{
|
||||
#ifdef POSIX
|
||||
ImageFormat fmt = params[TEXTURE1]->GetTextureValue()->GetImageFormat();
|
||||
bool bSRGB;
|
||||
if ( ( fmt == IMAGE_FORMAT_RGBA16161616F ) || ( fmt == IMAGE_FORMAT_RGBA16161616 ) )
|
||||
bSRGB = false;
|
||||
else
|
||||
bSRGB = !params[LINEARREAD_TEXTURE1]->IsDefined() || !params[LINEARREAD_TEXTURE1]->GetIntValue();
|
||||
LoadTexture( TEXTURE1, bSRGB ? TEXTUREFLAGS_SRGB : 0 );
|
||||
#else
|
||||
LoadTexture( TEXTURE1 );
|
||||
#endif // POSIX
|
||||
}
|
||||
if ( params[TEXTURE2]->IsDefined() )
|
||||
{
|
||||
#ifdef POSIX
|
||||
ImageFormat fmt = params[TEXTURE2]->GetTextureValue()->GetImageFormat();
|
||||
bool bSRGB;
|
||||
if ( ( fmt == IMAGE_FORMAT_RGBA16161616F ) || ( fmt == IMAGE_FORMAT_RGBA16161616 ) )
|
||||
bSRGB = false;
|
||||
else
|
||||
bSRGB = !params[LINEARREAD_TEXTURE2]->IsDefined() || !params[LINEARREAD_TEXTURE2]->GetIntValue();
|
||||
LoadTexture( TEXTURE2, bSRGB ? TEXTUREFLAGS_SRGB : 0 );
|
||||
#else
|
||||
LoadTexture( TEXTURE2 );
|
||||
#endif // POSIX
|
||||
}
|
||||
if ( params[TEXTURE3]->IsDefined() )
|
||||
{
|
||||
#ifdef POSIX
|
||||
ImageFormat fmt = params[TEXTURE3]->GetTextureValue()->GetImageFormat();
|
||||
bool bSRGB;
|
||||
if ( ( fmt == IMAGE_FORMAT_RGBA16161616F ) || ( fmt == IMAGE_FORMAT_RGBA16161616 ) )
|
||||
bSRGB = false;
|
||||
else
|
||||
bSRGB = !params[LINEARREAD_TEXTURE3]->IsDefined() || !params[LINEARREAD_TEXTURE3]->GetIntValue();
|
||||
LoadTexture( TEXTURE3, bSRGB ? TEXTUREFLAGS_SRGB : 0 );
|
||||
#else
|
||||
LoadTexture( TEXTURE3 );
|
||||
#endif // POSIX
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,8 +195,24 @@ BEGIN_VS_SHADER_FLAGS( screenspace_general_dx9, "Help for screenspace_general",
|
||||
{
|
||||
EnableAlphaBlending( SHADER_BLEND_ONE, SHADER_BLEND_ONE );
|
||||
}
|
||||
if ( params[ ALPHA_BLEND_COLOR_OVERLAY ]->GetIntValue() )
|
||||
{
|
||||
// Used for adding L4D-style halos
|
||||
EnableAlphaBlending( SHADER_BLEND_ONE, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
if ( params[ ALPHA_BLEND ]->GetIntValue() )
|
||||
{
|
||||
// Used for adding L4D-style halos
|
||||
EnableAlphaBlending( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
if( params[ COPYALPHA ]->GetIntValue() )
|
||||
{
|
||||
pShaderShadow->EnableBlending( false );
|
||||
pShaderShadow->AlphaFunc( SHADER_ALPHAFUNC_ALWAYS, 0.0f );
|
||||
}
|
||||
|
||||
if ( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
const char *szPixelShader = params[PIXSHADER]->GetStringValue();
|
||||
size_t iLength = Q_strlen( szPixelShader );
|
||||
@ -180,23 +239,44 @@ BEGIN_VS_SHADER_FLAGS( screenspace_general_dx9, "Help for screenspace_general",
|
||||
|
||||
DYNAMIC_STATE
|
||||
{
|
||||
// Using c4-c7 to store the pixel sizes of each texture
|
||||
if (params[BASETEXTURE]->IsDefined())
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER0, BASETEXTURE, -1 );
|
||||
|
||||
ITexture *pTarget = params[ BASETEXTURE ]->GetTextureValue();
|
||||
float vPixelSize[4] = { 1.0f / pTarget->GetActualWidth(), 1.0f / pTarget->GetActualHeight(), 0.0f, 0.0f };
|
||||
pShaderAPI->SetPixelShaderConstant( 4, vPixelSize, 1 );
|
||||
}
|
||||
|
||||
if (params[TEXTURE1]->IsDefined())
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER1, TEXTURE1, -1 );
|
||||
|
||||
ITexture *pTarget = params[ TEXTURE1 ]->GetTextureValue();
|
||||
float vPixelSize[4] = { 1.0f / pTarget->GetActualWidth(), 1.0f / pTarget->GetActualHeight(), 0.0f, 0.0f };
|
||||
pShaderAPI->SetPixelShaderConstant( 5, vPixelSize, 1 );
|
||||
}
|
||||
|
||||
if (params[TEXTURE2]->IsDefined())
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER2, TEXTURE2, -1 );
|
||||
|
||||
ITexture *pTarget = params[ TEXTURE2 ]->GetTextureValue();
|
||||
float vPixelSize[4] = { 1.0f / pTarget->GetActualWidth(), 1.0f / pTarget->GetActualHeight(), 0.0f, 0.0f };
|
||||
pShaderAPI->SetPixelShaderConstant( 6, vPixelSize, 1 );
|
||||
}
|
||||
|
||||
if (params[TEXTURE3]->IsDefined())
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER3, TEXTURE3, -1 );
|
||||
|
||||
ITexture *pTarget = params[ TEXTURE3 ]->GetTextureValue();
|
||||
float vPixelSize[4] = { 1.0f / pTarget->GetActualWidth(), 1.0f / pTarget->GetActualHeight(), 0.0f, 0.0f };
|
||||
pShaderAPI->SetPixelShaderConstant( 7, vPixelSize, 1 );
|
||||
}
|
||||
float c0[]={
|
||||
|
||||
float c0[] = {
|
||||
params[C0_X]->GetFloatValue(),
|
||||
params[C0_Y]->GetFloatValue(),
|
||||
params[C0_Z]->GetFloatValue(),
|
||||
@ -215,6 +295,7 @@ BEGIN_VS_SHADER_FLAGS( screenspace_general_dx9, "Help for screenspace_general",
|
||||
params[C3_W]->GetFloatValue()
|
||||
};
|
||||
|
||||
// c0-c3
|
||||
pShaderAPI->SetPixelShaderConstant( 0, c0, ARRAYSIZE(c0)/4 );
|
||||
|
||||
float eyePos[4];
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
static ConVar mat_fullbright( "mat_fullbright", "0", FCVAR_CHEAT );
|
||||
static ConVar r_lightwarpidentity( "r_lightwarpidentity", "0", FCVAR_CHEAT );
|
||||
static ConVar r_rimlight( "r_rimlight", "1", FCVAR_CHEAT );
|
||||
static ConVar r_rimlight( "r_rimlight", "1", FCVAR_NONE );
|
||||
|
||||
// Textures may be bound to the following samplers:
|
||||
// SHADER_SAMPLER0 Base (Albedo) / Gloss in alpha
|
||||
@ -270,6 +270,9 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad
|
||||
|
||||
float flTintReplacementAmount = GetFloatParam( info.m_nTintReplacesBaseColor, params );
|
||||
|
||||
float flPhongExponentFactor = ( info.m_nPhongExponentFactor != -1 ) ? GetFloatParam( info.m_nPhongExponentFactor, params ) : 0.0f;
|
||||
const bool bHasPhongExponentFactor = flPhongExponentFactor != 0.0f;
|
||||
|
||||
BlendType_t nBlendType= pShader->EvaluateBlendRequirements( bBlendTintByBaseAlpha ? -1 : info.m_nBaseTexture, true );
|
||||
|
||||
bool bFullyOpaque = (nBlendType != BT_BLENDADD) && (nBlendType != BT_BLEND) && !bIsAlphaTested && !bHasFlashlight; //dest alpha is free for special use
|
||||
@ -676,6 +679,7 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bWriteDepthToAlpha );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PHONG_USE_EXPONENT_FACTOR, bHasPhongExponentFactor );
|
||||
SET_DYNAMIC_PIXEL_SHADER( skin_ps20b );
|
||||
}
|
||||
#ifndef _X360
|
||||
@ -697,6 +701,7 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bWriteDepthToAlpha );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PHONG_USE_EXPONENT_FACTOR, bHasPhongExponentFactor );
|
||||
SET_DYNAMIC_PIXEL_SHADER( skin_ps30 );
|
||||
|
||||
bool bUnusedTexCoords[3] = { false, false, !pShaderAPI->IsHWMorphingEnabled() || !bIsDecal };
|
||||
@ -806,15 +811,23 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad
|
||||
float vSpecularTint[4] = {1, 1, 1, 4};
|
||||
pShaderAPI->GetWorldSpaceCameraPosition( vEyePos_SpecExponent );
|
||||
|
||||
// Use the alpha channel of the normal map for the exponent by default
|
||||
vEyePos_SpecExponent[3] = -1.f;
|
||||
if ( (info.m_nPhongExponent != -1) && params[info.m_nPhongExponent]->IsDefined() )
|
||||
// If we have a phong exponent factor, then use that as a multiplier against the texture.
|
||||
if ( bHasPhongExponentFactor )
|
||||
{
|
||||
float fValue = params[info.m_nPhongExponent]->GetFloatValue();
|
||||
if ( fValue > 0.f )
|
||||
vEyePos_SpecExponent[3] = flPhongExponentFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the alpha channel of the normal map for the exponent by default
|
||||
vEyePos_SpecExponent[3] = -1.f;
|
||||
if ( (info.m_nPhongExponent != -1) && params[info.m_nPhongExponent]->IsDefined() )
|
||||
{
|
||||
// Nonzero value in material overrides map channel
|
||||
vEyePos_SpecExponent[3] = fValue;
|
||||
float fValue = params[info.m_nPhongExponent]->GetFloatValue();
|
||||
if ( fValue > 0.f )
|
||||
{
|
||||
// Nonzero value in material overrides map channel
|
||||
vEyePos_SpecExponent[3] = fValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps30]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps30]
|
||||
// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..0" [ps20]
|
||||
// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..1" [ps20b] [ps30] [PC]
|
||||
|
||||
|
||||
// SKIP: ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
|
||||
@ -76,7 +78,9 @@ const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
||||
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
||||
const float4 g_FlashlightAttenuationFactors_RimMask : register( PSREG_FLASHLIGHT_ATTENUATION ); // On non-flashlight pass, x has rim mask control
|
||||
const float4 g_FlashlightPos_RimBoost : register( PSREG_FLASHLIGHT_POSITION_RIM_BOOST );
|
||||
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
|
||||
#if FLASHLIGHT
|
||||
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
|
||||
#endif
|
||||
const float4 g_FresnelSpecParams : register( PSREG_FRESNEL_SPEC_PARAMS ); // xyz are fresnel, w is specular boost
|
||||
const float4 g_SpecularRimParams : register( PSREG_SPEC_RIM_PARAMS ); // xyz are specular tint color, w is rim power
|
||||
PixelShaderLightInfo cLightInfo[3] : register( PSREG_LIGHT_INFO_ARRAY ); // 2 registers each - 6 registers total (4th light spread across w's)
|
||||
@ -96,6 +100,7 @@ const float4 g_ShaderControls : register( PSREG_CONSTANT_27 ); // x is
|
||||
#define g_fTintReplacementControl g_ShaderControls.z
|
||||
#define g_fInvertPhongMask g_ShaderControls.w
|
||||
|
||||
|
||||
sampler BaseTextureSampler : register( s0 ); // Base map, selfillum in alpha
|
||||
sampler SpecularWarpSampler : register( s1 ); // Specular warp sampler (for iridescence etc)
|
||||
sampler DiffuseWarpSampler : register( s2 ); // Lighting warp sampler (1D texture for diffuse lighting modification)
|
||||
@ -119,7 +124,6 @@ sampler DetailSampler : register( s13 ); // detail texture
|
||||
|
||||
sampler SelfIllumMaskSampler : register( s14 ); // selfillummask
|
||||
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 baseTexCoordDetailTexCoord : TEXCOORD0; // xy=base zw=detail
|
||||
@ -258,7 +262,11 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
[flatten]
|
||||
#endif
|
||||
|
||||
#if ( PHONG_USE_EXPONENT_FACTOR )
|
||||
fSpecExp = ( 1.0f + g_EyePos_SpecExponent.w * vSpecExpMap.r );
|
||||
#else
|
||||
fSpecExp = (g_EyePos_SpecExponent.w >= 0.0) ? g_EyePos_SpecExponent.w : (1.0f + 149.0f * vSpecExpMap.r);
|
||||
#endif
|
||||
|
||||
// If constant tint is negative, tint with albedo, based upon scalar tint map
|
||||
#if defined( _X360 )
|
||||
@ -286,15 +294,17 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
}
|
||||
else
|
||||
{
|
||||
float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture );
|
||||
#if FLASHLIGHT
|
||||
float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture );
|
||||
|
||||
DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal,
|
||||
g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w,
|
||||
FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z,
|
||||
fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks,
|
||||
DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal,
|
||||
g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w,
|
||||
FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z,
|
||||
fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks,
|
||||
|
||||
// These two values are output
|
||||
diffuseLighting, specularLighting );
|
||||
// These two values are output
|
||||
diffuseLighting, specularLighting );
|
||||
#endif
|
||||
}
|
||||
|
||||
// If we didn't already apply Fresnel to specular warp, modulate the specular
|
||||
|
@ -220,7 +220,7 @@ BEGIN_VS_SHADER( Sky_HDR_DX9, "Help for Sky_HDR_DX9 shader" )
|
||||
float w=txtr->GetActualWidth();
|
||||
float h=txtr->GetActualHeight();
|
||||
float FUDGE=0.01/max(w,h); // per ATI
|
||||
float c1[4]={0.5/w-FUDGE, 0.5/h-FUDGE, w, h };
|
||||
float c1[4]={(float)(0.5/w-FUDGE), (float)(0.5/h-FUDGE), w, h };
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, c1);
|
||||
|
||||
BindTexture( SHADER_SAMPLER0, HDRCOMPRESSEDTEXTURE, FRAME );
|
||||
|
@ -417,7 +417,7 @@ SHADER_DRAW
|
||||
if ( bZoomSeq2 )
|
||||
{
|
||||
float flZScale=1.0/(params[ZOOMANIMATESEQ2]->GetFloatValue());
|
||||
float C0[4]={ 0.5*(1.0+flZScale), flZScale, 0, 0 };
|
||||
float C0[4]={ (float)(0.5*(1.0+flZScale)), flZScale, 0, 0 };
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_7, C0,
|
||||
ARRAYSIZE(C0)/4 );
|
||||
}
|
||||
@ -428,7 +428,7 @@ SHADER_DRAW
|
||||
|
||||
float VC0[8]={ params[MINSIZE]->GetFloatValue(), params[MAXSIZE]->GetFloatValue(),
|
||||
params[STARTFADESIZE]->GetFloatValue(), params[ENDFADESIZE]->GetFloatValue(),
|
||||
flStartFade, 1.0/(flMaxDistance-flStartFade),
|
||||
flStartFade, (float)(1.0/(flMaxDistance-flStartFade)),
|
||||
0,0 };
|
||||
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_8, VC0, ARRAYSIZE(VC0)/4 );
|
||||
|
@ -236,7 +236,7 @@ BEGIN_VS_SHADER( Teeth_DX9, "Help for Teeth_DX9" )
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( teeth_bump_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, bUseStaticControlFlow ? 0 : lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER( teeth_bump_vs20 );
|
||||
@ -273,7 +273,7 @@ BEGIN_VS_SHADER( Teeth_DX9, "Help for Teeth_DX9" )
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( teeth_bump_vs30 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( MORPHING, pShaderAPI->IsHWMorphingEnabled() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( teeth_bump_vs30 );
|
||||
@ -306,7 +306,7 @@ BEGIN_VS_SHADER( Teeth_DX9, "Help for Teeth_DX9" )
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( NUM_LIGHTS, bUseStaticControlFlow ? 0 : lightState.m_nNumLights );
|
||||
SET_DYNAMIC_VERTEX_SHADER( teeth_vs20 );
|
||||
@ -334,7 +334,7 @@ BEGIN_VS_SHADER( Teeth_DX9, "Help for Teeth_DX9" )
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( MORPHING, pShaderAPI->IsHWMorphingEnabled() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( teeth_vs30 );
|
||||
|
@ -31,6 +31,9 @@
|
||||
// DYNAMIC: "LIGHTING_PREVIEW" "0..0" [XBOX]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps30]
|
||||
// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..1" [ps20b] [ps30]
|
||||
// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..0" [ps20]
|
||||
// DYNAMIC: "DEBUG_LUXELS" "0..1" [ps20b] [ps30]
|
||||
|
||||
// detail blend mode 6 = ps20b only
|
||||
// SKIP: $DETAIL_BLEND_MODE == 6 [ps20]
|
||||
@ -71,6 +74,9 @@
|
||||
|
||||
// SKIP: $CUBEMAP_SPHERE_LEGACY && ($CUBEMAP == 0)
|
||||
|
||||
// Debugging luxels only makes sense if we have lightmaps on this geometry.
|
||||
// SKIP: ($STATIC_LIGHT_LIGHTMAP == 0) && ($DEBUG_LUXELS == 1)
|
||||
|
||||
#include "common_flashlight_fxc.h"
|
||||
#include "common_vertexlitgeneric_dx9.h"
|
||||
|
||||
@ -105,6 +111,7 @@ sampler FlashlightSampler : register( s7 );
|
||||
sampler ShadowDepthSampler : register( s8 ); // Flashlight shadow depth map sampler
|
||||
sampler DepthSampler : register( s10 ); //depth buffer sampler for depth blending
|
||||
sampler SelfIllumMaskSampler : register( s11 ); // selfillummask
|
||||
sampler LightMapSampler : register( s12 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
@ -167,6 +174,10 @@ const float4 g_OutlineParams : register( c9 );
|
||||
const float3 g_DetailTint : register( c10 );
|
||||
#endif
|
||||
|
||||
#if DEBUG_LUXELS
|
||||
const float4 g_LuxelScale : register( c11 );
|
||||
#endif
|
||||
|
||||
|
||||
// Calculate unified fog
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float flEyePosZ, const float flWorldPosZ, const float flProjPosZ )
|
||||
@ -331,12 +342,24 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
}
|
||||
|
||||
float3 diffuseLighting = float3( 1.0f, 1.0f, 1.0f );
|
||||
if( bDiffuseLighting || bVertexColor && !( bVertexColor && bDiffuseLighting ) )
|
||||
if( bDiffuseLighting || bVertexColor )
|
||||
{
|
||||
diffuseLighting = i.color.rgb;
|
||||
}
|
||||
|
||||
#if STATIC_LIGHT_LIGHTMAP
|
||||
// This matches the behavior of vertex lighting, which multiplies by cOverbright (which is not accessible here)
|
||||
// And converts from Gamma space to Linear space before being used.
|
||||
float2 lightmapTexCoords = i.baseTexCoord.xy;
|
||||
#if DEBUG_LUXELS
|
||||
lightmapTexCoords.xy *= g_LuxelScale.xy;
|
||||
#endif
|
||||
float3 f3LightmapColor = GammaToLinear( 2.0f * tex2D( LightMapSampler, lightmapTexCoords ).rgb );
|
||||
diffuseLighting = f3LightmapColor;
|
||||
#endif
|
||||
|
||||
float3 albedo = baseColor;
|
||||
|
||||
if (bBlendTintByBaseAlpha)
|
||||
{
|
||||
float3 tintedColor = albedo * g_DiffuseModulation.rgb;
|
||||
|
@ -12,7 +12,8 @@
|
||||
// STATIC: "DONT_GAMMA_CONVERT_VERTEX_COLOR" "0..1"
|
||||
// DYNAMIC: "COMPRESSED_VERTS" "0..1"
|
||||
// DYNAMIC: "DYNAMIC_LIGHT" "0..1"
|
||||
// DYNAMIC: "STATIC_LIGHT" "0..1"
|
||||
// DYNAMIC: "STATIC_LIGHT_VERTEX" "0..1"
|
||||
// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..1"
|
||||
// DYNAMIC: "DOWATERFOG" "0..1"
|
||||
// DYNAMIC: "SKINNING" "0..1"
|
||||
// DYNAMIC: "LIGHTING_PREVIEW" "0..1" [PC]
|
||||
@ -125,7 +126,7 @@ VS_OUTPUT main( const VS_INPUT v )
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
bool bDynamicLight = DYNAMIC_LIGHT ? true : false;
|
||||
bool bStaticLight = STATIC_LIGHT ? true : false;
|
||||
bool bStaticLight = STATIC_LIGHT_VERTEX ? true : false;
|
||||
bool bDoLighting = !g_bVertexColor && (bDynamicLight || bStaticLight);
|
||||
|
||||
float4 vPosition = v.vPos;
|
||||
|
@ -41,6 +41,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SHADER_PARAM( SELFILLUMFRESNELMINMAXEXP, SHADER_PARAM_TYPE_VEC4, "0", "Self illum fresnel min, max, exp" )
|
||||
SHADER_PARAM( ALPHATESTREFERENCE, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
|
||||
SHADER_PARAM( FLASHLIGHTNOLAMBERT, SHADER_PARAM_TYPE_BOOL, "0", "Flashlight pass sets N.L=1.0" )
|
||||
SHADER_PARAM( LIGHTMAP, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "lightmap texture--will be bound by the engine")
|
||||
|
||||
// Debugging term for visualizing ambient data on its own
|
||||
SHADER_PARAM( AMBIENTONLY, SHADER_PARAM_TYPE_INTEGER, "0", "Control drawing of non-ambient light ()" )
|
||||
@ -53,6 +54,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SHADER_PARAM( PHONGFRESNELRANGES, SHADER_PARAM_TYPE_VEC3, "[0 0.5 1]", "Parameters for remapping fresnel output" )
|
||||
SHADER_PARAM( PHONGBOOST, SHADER_PARAM_TYPE_FLOAT, "1.0", "Phong overbrightening factor (specular mask channel should be authored to account for this)" )
|
||||
SHADER_PARAM( PHONGEXPONENTTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "Phong Exponent map" )
|
||||
SHADER_PARAM( PHONGEXPONENTFACTOR, SHADER_PARAM_TYPE_FLOAT, "0.0", "When using a phong exponent texture, this will be multiplied by the 0..1 that comes out of the texture." )
|
||||
SHADER_PARAM( PHONG, SHADER_PARAM_TYPE_BOOL, "0", "enables phong lighting" )
|
||||
SHADER_PARAM( BASEMAPALPHAPHONGMASK, SHADER_PARAM_TYPE_INTEGER, "0", "indicates that there is no normal map and that the phong mask is in base alpha" )
|
||||
SHADER_PARAM( INVERTPHONGMASK, SHADER_PARAM_TYPE_INTEGER, "0", "invert the phong mask (0=full phong, 1=no phong)" )
|
||||
@ -163,6 +165,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
info.m_nEnvmapSaturation = ENVMAPSATURATION;
|
||||
info.m_nAlphaTestReference = ALPHATESTREFERENCE;
|
||||
info.m_nFlashlightNoLambert = FLASHLIGHTNOLAMBERT;
|
||||
info.m_nLightmap = LIGHTMAP;
|
||||
|
||||
info.m_nFlashlightTexture = FLASHLIGHTTEXTURE;
|
||||
info.m_nFlashlightTextureFrame = FLASHLIGHTTEXTUREFRAME;
|
||||
@ -178,6 +181,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
info.m_nDiffuseWarpTexture = LIGHTWARPTEXTURE;
|
||||
info.m_nPhongWarpTexture = PHONGWARPTEXTURE;
|
||||
info.m_nPhongBoost = PHONGBOOST;
|
||||
info.m_nPhongExponentFactor = PHONGEXPONENTFACTOR;
|
||||
info.m_nPhongFresnelRanges = PHONGFRESNELRANGES;
|
||||
info.m_nPhong = PHONG;
|
||||
info.m_nBaseMapAlphaPhongMask = BASEMAPALPHAPHONGMASK;
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
static ConVar mat_fullbright( "mat_fullbright","0", FCVAR_CHEAT );
|
||||
static ConVar r_lightwarpidentity( "r_lightwarpidentity","0", FCVAR_CHEAT );
|
||||
static ConVar mat_luxels( "mat_luxels", "0", FCVAR_CHEAT );
|
||||
|
||||
|
||||
static inline bool WantsSkinShader( IMaterialVar** params, const VertexLitGeneric_DX9_Vars_t &info )
|
||||
@ -382,7 +383,8 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
|
||||
bool bIsAlphaTested = IS_FLAG_SET( MATERIAL_VAR_ALPHATEST ) != 0;
|
||||
bool bHasDiffuseWarp = (!bHasFlashlight || IsX360() ) && hasDiffuseLighting && (info.m_nDiffuseWarpTexture != -1) && params[info.m_nDiffuseWarpTexture]->IsTexture();
|
||||
|
||||
bool bHasLightmapTexture = IsTextureSet( info.m_nLightmap, params );
|
||||
bool bHasMatLuxel = bHasLightmapTexture && mat_luxels.GetBool();
|
||||
|
||||
//bool bNoCull = IS_FLAG_SET( MATERIAL_VAR_NOCULL );
|
||||
bool bFlashlightNoLambert = false;
|
||||
@ -622,6 +624,11 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER11, true ); // self illum mask
|
||||
}
|
||||
|
||||
|
||||
// Always enable this sampler, used for lightmaps depending on the dynamic combo.
|
||||
// Lightmaps are generated in gamma space, but not sRGB, so leave that disabled. Conversion is done in the shader.
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER12, true );
|
||||
|
||||
bool bSRGBWrite = true;
|
||||
if( (info.m_nLinearWrite != -1) && (params[info.m_nLinearWrite]->GetIntValue() == 1) )
|
||||
{
|
||||
@ -1188,12 +1195,32 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
|
||||
|
||||
// Set up light combo state
|
||||
LightState_t lightState = {0, false, false};
|
||||
LightState_t lightState = { 0, false, false, false };
|
||||
if ( bVertexLitGeneric && (!bHasFlashlight || IsX360() ) )
|
||||
{
|
||||
pShaderAPI->GetDX9LightState( &lightState );
|
||||
}
|
||||
|
||||
// Override the lighting desired if we have a lightmap set!
|
||||
if ( bHasLightmapTexture )
|
||||
{
|
||||
lightState.m_bStaticLightVertex = false;
|
||||
lightState.m_bStaticLightTexel = true;
|
||||
|
||||
// Usual case, not debugging.
|
||||
if (!bHasMatLuxel)
|
||||
{
|
||||
pShader->BindTexture(SHADER_SAMPLER12, info.m_nLightmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
float dimensions[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
DynamicCmdsOut.BindStandardTexture( SHADER_SAMPLER12, TEXTURE_DEBUG_LUXELS );
|
||||
pShader->GetTextureDimensions( &dimensions[0], &dimensions[1], info.m_nLightmap );
|
||||
DynamicCmdsOut.SetPixelShaderConstant( 11, dimensions, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
MaterialFogMode_t fogType = pShaderAPI->GetSceneFogMode();
|
||||
int fogIndex = ( fogType == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ? 1 : 0;
|
||||
int numBones = pShaderAPI->GetCurrentNumBones();
|
||||
@ -1277,7 +1304,7 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
if ( bAmbientOnly ) // Override selected light combo to be ambient only
|
||||
{
|
||||
lightState.m_bAmbientLight = true;
|
||||
lightState.m_bStaticLight = false;
|
||||
lightState.m_bStaticLightVertex = false;
|
||||
lightState.m_nNumLights = 0;
|
||||
}
|
||||
|
||||
@ -1289,7 +1316,8 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0);
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, numBones > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO(
|
||||
@ -1306,6 +1334,8 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
|
||||
// SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( DEBUG_LUXELS, bHasMatLuxel ? 1 : 0 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO(
|
||||
LIGHTING_PREVIEW,
|
||||
pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) );
|
||||
@ -1315,6 +1345,7 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( vertexlit_and_unlit_generic_ps20 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO(
|
||||
LIGHTING_PREVIEW,
|
||||
pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) );
|
||||
@ -1328,7 +1359,8 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs30 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLight ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, lightState.m_bStaticLightVertex ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, numBones > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW,
|
||||
@ -1340,6 +1372,8 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( vertexlit_and_unlit_generic_ps30 );
|
||||
// SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( DEBUG_LUXELS, bHasMatLuxel ? 1 : 0 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( LIGHTING_PREVIEW,
|
||||
pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) );
|
||||
SET_DYNAMIC_PIXEL_SHADER_CMD( DynamicCmdsOut, vertexlit_and_unlit_generic_ps30 );
|
||||
|
@ -54,6 +54,7 @@ struct VertexLitGeneric_DX9_Vars_t
|
||||
int m_nFlashlightNoLambert;
|
||||
int m_nFlashlightTexture;
|
||||
int m_nFlashlightTextureFrame;
|
||||
int m_nLightmap;
|
||||
|
||||
int m_nSelfIllumTint;
|
||||
int m_nSelfIllumFresnel;
|
||||
@ -67,6 +68,7 @@ struct VertexLitGeneric_DX9_Vars_t
|
||||
int m_nPhongWarpTexture;
|
||||
int m_nPhongBoost;
|
||||
int m_nPhongFresnelRanges;
|
||||
int m_nPhongExponentFactor;
|
||||
int m_nSelfIllumEnvMapMask_Alpha;
|
||||
int m_nAmbientOnly;
|
||||
int m_nHDRColorScale;
|
||||
@ -130,7 +132,6 @@ struct VertexLitGeneric_DX9_Vars_t
|
||||
int m_nBlendTintByBaseAlpha;
|
||||
|
||||
int m_nTintReplacesBaseColor;
|
||||
|
||||
};
|
||||
|
||||
void InitParamsVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );
|
||||
|
@ -225,17 +225,6 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
Vector4D Scroll1;
|
||||
params[SCROLL1]->GetVecValue( Scroll1.Base(), 4 );
|
||||
|
||||
NormalDecodeMode_t nNormalDecodeMode = NORMAL_DECODE_NONE;
|
||||
if ( params[NORMALMAP]->IsTexture() && g_pHardwareConfig->SupportsNormalMapCompression() )
|
||||
{
|
||||
ITexture *pNormalMap = params[NORMALMAP]->GetTextureValue();
|
||||
if ( pNormalMap )
|
||||
{
|
||||
// Clamp this to 0 or 1 since that's how we've authored the water shader (i.e. no separate alpha map/channel)
|
||||
nNormalDecodeMode = pNormalMap->GetNormalDecodeMode() == NORMAL_DECODE_NONE ? NORMAL_DECODE_NONE : NORMAL_DECODE_ATI2N;
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_STATIC_VERTEX_SHADER( water_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER_COMBO( MULTITEXTURE,fabs(Scroll1.x) > 0.0);
|
||||
SET_STATIC_VERTEX_SHADER_COMBO( BASETEXTURE, params[BASETEXTURE]->IsTexture() );
|
||||
@ -253,7 +242,7 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MULTITEXTURE,fabs(Scroll1.x) > 0.0);
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( BASETEXTURE, params[BASETEXTURE]->IsTexture() );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( BLURRY_REFRACT, params[BLURREFRACT]->GetIntValue() );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( water_ps20b );
|
||||
}
|
||||
else
|
||||
@ -264,7 +253,7 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( ABOVEWATER, params[ABOVEWATER]->GetIntValue() );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MULTITEXTURE,fabs(Scroll1.x) > 0.0);
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( BASETEXTURE, params[BASETEXTURE]->IsTexture() );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( water_ps20 );
|
||||
}
|
||||
|
||||
@ -419,17 +408,6 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
int fmt = VERTEX_POSITION | VERTEX_NORMAL | VERTEX_TANGENT_S | VERTEX_TANGENT_T;
|
||||
pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 );
|
||||
|
||||
NormalDecodeMode_t nNormalDecodeMode = NORMAL_DECODE_NONE;
|
||||
if ( params[NORMALMAP]->IsTexture() && g_pHardwareConfig->SupportsNormalMapCompression() )
|
||||
{
|
||||
ITexture *pNormalMap = params[NORMALMAP]->GetTextureValue();
|
||||
if ( pNormalMap )
|
||||
{
|
||||
// Clamp this to 0 or 1 since that's how we've authored the water shader (i.e. no separate alpha map/channel)
|
||||
nNormalDecodeMode = pNormalMap->GetNormalDecodeMode() == NORMAL_DECODE_NONE ? NORMAL_DECODE_NONE : NORMAL_DECODE_ATI2N;
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_STATIC_VERTEX_SHADER( watercheap_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER_COMBO( BLEND, bBlend && bRefraction );
|
||||
SET_STATIC_VERTEX_SHADER( watercheap_vs20 );
|
||||
@ -444,7 +422,7 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
Vector4D Scroll1;
|
||||
params[SCROLL1]->GetVecValue( Scroll1.Base(), 4 );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MULTITEXTURE,fabs(Scroll1.x) > 0.0);
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( watercheap_ps20b );
|
||||
}
|
||||
else
|
||||
@ -457,7 +435,7 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
Vector4D Scroll1;
|
||||
params[SCROLL1]->GetVecValue( Scroll1.Base(), 4 );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MULTITEXTURE,fabs(Scroll1.x) > 0.0);
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( watercheap_ps20 );
|
||||
}
|
||||
|
||||
@ -488,9 +466,9 @@ BEGIN_VS_SHADER( Water_DX90,
|
||||
float cheapWaterEndDistance = params[CHEAPWATERENDDISTANCE]->GetFloatValue();
|
||||
float cheapWaterParams[4] =
|
||||
{
|
||||
cheapWaterStartDistance * VSHADER_VECT_SCALE,
|
||||
cheapWaterEndDistance * VSHADER_VECT_SCALE,
|
||||
PSHADER_VECT_SCALE / ( cheapWaterEndDistance - cheapWaterStartDistance ),
|
||||
(float)(cheapWaterStartDistance * VSHADER_VECT_SCALE),
|
||||
(float)(cheapWaterEndDistance * VSHADER_VECT_SCALE),
|
||||
(float)(PSHADER_VECT_SCALE / ( cheapWaterEndDistance - cheapWaterStartDistance )),
|
||||
cheapWaterStartDistance / ( cheapWaterEndDistance - cheapWaterStartDistance ),
|
||||
};
|
||||
pShaderAPI->SetPixelShaderConstant( 1, cheapWaterParams );
|
||||
|
Loading…
Reference in New Issue
Block a user