Line-ending fixes for most of the remaining files.
Fixes line-endings for files with extensions vcd, cc, txt, bat, fxc, inc, lst, proto, mak, mm, cfg, res, rc, def, vmt, vsh, vbsp, inl, asm, m4, vcproj, vcxproj, sln, in, java, la, manifest, am, and rad. Also fixes README, CONTRIBUTING, CONTRIBUTORS, LICENSE, CHANGES, COPYING, and gitignore. Finally, fixes executable bits.
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()] [PC]
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..0" [= 0] [XBOX]
|
||||
|
||||
#define HDRTYPE HDR_TYPE_NONE
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler FBSampler : register( s0 );
|
||||
sampler BlurSampler : register( s1 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 fbSample = tex2D( FBSampler, i.texCoord );
|
||||
float4 blurSample = tex2D( BlurSampler, i.texCoord );
|
||||
|
||||
return FinalOutput( float4( fbSample + blurSample.rgb * blurSample.a * MAX_HDR_OVERBRIGHT, 1.0f ), 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()] [PC]
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..0" [= 0] [XBOX]
|
||||
|
||||
#define HDRTYPE HDR_TYPE_NONE
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler FBSampler : register( s0 );
|
||||
sampler BlurSampler : register( s1 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 fbSample = tex2D( FBSampler, i.texCoord );
|
||||
float4 blurSample = tex2D( BlurSampler, i.texCoord );
|
||||
|
||||
return FinalOutput( float4( fbSample + blurSample.rgb * blurSample.a * MAX_HDR_OVERBRIGHT, 1.0f ), 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
//======= Copyright © 1996-2006, Valve Corporation, All rights reserved. ======
|
||||
#define CONVERT_TO_SRGB 0
|
||||
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler TexSampler : register( s0 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 result = tex2D( TexSampler, i.baseTexCoord );
|
||||
result.a = 1.0f;
|
||||
return result; //FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
}
|
||||
//======= Copyright © 1996-2006, Valve Corporation, All rights reserved. ======
|
||||
#define CONVERT_TO_SRGB 0
|
||||
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler TexSampler : register( s0 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 result = tex2D( TexSampler, i.baseTexCoord );
|
||||
result.a = 1.0f;
|
||||
return result; //FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
//======= Copyright © 1996-2006, Valve Corporation, All rights reserved. ======
|
||||
#define CONVERT_TO_SRGB 0
|
||||
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler TexSampler : register( s0 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
|
||||
#if defined( _X360 ) //matching pixel shader inputs to vertex shader outputs to avoid shader patches
|
||||
float2 ZeroTexCoord : TEXCOORD1;
|
||||
float2 bloomTexCoord : TEXCOORD2;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 result = tex2D( TexSampler, i.baseTexCoord );
|
||||
result.a = 1.0f;
|
||||
return result; //FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
}
|
||||
//======= Copyright © 1996-2006, Valve Corporation, All rights reserved. ======
|
||||
#define CONVERT_TO_SRGB 0
|
||||
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler TexSampler : register( s0 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
|
||||
#if defined( _X360 ) //matching pixel shader inputs to vertex shader outputs to avoid shader patches
|
||||
float2 ZeroTexCoord : TEXCOORD1;
|
||||
float2 bloomTexCoord : TEXCOORD2;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 result = tex2D( TexSampler, i.baseTexCoord );
|
||||
result.a = 1.0f;
|
||||
return result; //FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
|
||||
}
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
//========= Copyright © 1996-2006, Valve Corporation, All rights reserved. ============//
|
||||
|
||||
// STATIC: "X360APPCHOOSER" "0..1" [= 0]
|
||||
|
||||
#include "common_vs_fxc.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float3 vPos : POSITION;
|
||||
float2 vBaseTexCoord : TEXCOORD0;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
float4 vColor : COLOR0;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 projPos : POSITION;
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float2 ZeroTexCoord : TEXCOORD1;
|
||||
float2 bloomTexCoord : TEXCOORD2;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
float4 vColor : TEXCOORD3;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 Texel_Sizes : register (SHADER_SPECIFIC_CONST_0);
|
||||
|
||||
VS_OUTPUT main( const VS_INPUT v )
|
||||
{
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
o.projPos = float4( v.vPos, 1.0f );
|
||||
o.baseTexCoord = v.vBaseTexCoord;
|
||||
o.ZeroTexCoord=float2(0,0);
|
||||
o.bloomTexCoord.x=v.vBaseTexCoord.x+Texel_Sizes.z;
|
||||
o.bloomTexCoord.y=v.vBaseTexCoord.y+Texel_Sizes.w;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
o.vColor.rgba = v.vColor.rgba;
|
||||
o.projPos.xyzw = mul( float4( v.vPos.xyz, 1.0f ), cModelViewProj );
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
//========= Copyright © 1996-2006, Valve Corporation, All rights reserved. ============//
|
||||
|
||||
// STATIC: "X360APPCHOOSER" "0..1" [= 0]
|
||||
|
||||
#include "common_vs_fxc.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float3 vPos : POSITION;
|
||||
float2 vBaseTexCoord : TEXCOORD0;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
float4 vColor : COLOR0;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 projPos : POSITION;
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float2 ZeroTexCoord : TEXCOORD1;
|
||||
float2 bloomTexCoord : TEXCOORD2;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
float4 vColor : TEXCOORD3;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 Texel_Sizes : register (SHADER_SPECIFIC_CONST_0);
|
||||
|
||||
VS_OUTPUT main( const VS_INPUT v )
|
||||
{
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
o.projPos = float4( v.vPos, 1.0f );
|
||||
o.baseTexCoord = v.vBaseTexCoord;
|
||||
o.ZeroTexCoord=float2(0,0);
|
||||
o.bloomTexCoord.x=v.vBaseTexCoord.x+Texel_Sizes.z;
|
||||
o.bloomTexCoord.y=v.vBaseTexCoord.y+Texel_Sizes.w;
|
||||
|
||||
#if X360APPCHOOSER
|
||||
o.vColor.rgba = v.vColor.rgba;
|
||||
o.projPos.xyzw = mul( float4( v.vPos.xyz, 1.0f ), cModelViewProj );
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
42
mp/src/materialsystem/stdshaders/buildhl2mpshaders.bat
Normal file → Executable file
42
mp/src/materialsystem/stdshaders/buildhl2mpshaders.bat
Normal file → Executable file
@@ -1,21 +1,21 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem ================================
|
||||
rem ==== MOD PATH CONFIGURATIONS ===
|
||||
|
||||
rem == Set the absolute path to your mod's game directory here ==
|
||||
set GAMEDIR=%cd%\..\..\..\game\mod_hl2mp
|
||||
|
||||
rem == Set the relative or absolute path to Source SDK Base 2013 Singleplayer\bin ==
|
||||
set SDKBINDIR=C:\SteamBetaLibrary\SteamApps\common\Source SDK Base 2013 Singleplayer\bin
|
||||
|
||||
rem == Set the Path to your mod's root source code ==
|
||||
rem This should already be correct, accepts relative paths only!
|
||||
set SOURCEDIR=..\..
|
||||
|
||||
rem ==== MOD PATH CONFIGURATIONS END ===
|
||||
rem ====================================
|
||||
|
||||
|
||||
call buildsdkshaders.bat
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem ================================
|
||||
rem ==== MOD PATH CONFIGURATIONS ===
|
||||
|
||||
rem == Set the absolute path to your mod's game directory here ==
|
||||
set GAMEDIR=%cd%\..\..\..\game\mod_hl2mp
|
||||
|
||||
rem == Set the relative or absolute path to Source SDK Base 2013 Singleplayer\bin ==
|
||||
set SDKBINDIR=C:\SteamBetaLibrary\SteamApps\common\Source SDK Base 2013 Singleplayer\bin
|
||||
|
||||
rem == Set the Path to your mod's root source code ==
|
||||
rem This should already be correct, accepts relative paths only!
|
||||
set SOURCEDIR=..\..
|
||||
|
||||
rem ==== MOD PATH CONFIGURATIONS END ===
|
||||
rem ====================================
|
||||
|
||||
|
||||
call buildsdkshaders.bat
|
||||
|
||||
80
mp/src/materialsystem/stdshaders/buildsdkshaders.bat
Normal file → Executable file
80
mp/src/materialsystem/stdshaders/buildsdkshaders.bat
Normal file → Executable file
@@ -1,40 +1,40 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem Use dynamic shaders to build .inc files only
|
||||
rem set dynamic_shaders=1
|
||||
rem == Setup path to nmake.exe, from vc 2005 common tools directory ==
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
|
||||
|
||||
set TTEXE=..\..\devtools\bin\timeprecise.exe
|
||||
if not exist %TTEXE% goto no_ttexe
|
||||
goto no_ttexe_end
|
||||
|
||||
:no_ttexe
|
||||
set TTEXE=time /t
|
||||
:no_ttexe_end
|
||||
|
||||
|
||||
rem echo.
|
||||
rem echo ~~~~~~ buildsdkshaders %* ~~~~~~
|
||||
%TTEXE% -cur-Q
|
||||
set tt_all_start=%ERRORLEVEL%
|
||||
set tt_all_chkpt=%tt_start%
|
||||
|
||||
set BUILD_SHADER=call buildshaders.bat
|
||||
set ARG_EXTRA=
|
||||
|
||||
%BUILD_SHADER% stdshader_dx9_20b -game %GAMEDIR% -source %SOURCEDIR%
|
||||
%BUILD_SHADER% stdshader_dx9_30 -game %GAMEDIR% -source %SOURCEDIR% -dx9_30 -force30
|
||||
|
||||
|
||||
rem echo.
|
||||
if not "%dynamic_shaders%" == "1" (
|
||||
rem echo Finished full buildallshaders %*
|
||||
) else (
|
||||
rem echo Finished dynamic buildallshaders %*
|
||||
)
|
||||
|
||||
rem %TTEXE% -diff %tt_all_start% -cur
|
||||
rem echo.
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem Use dynamic shaders to build .inc files only
|
||||
rem set dynamic_shaders=1
|
||||
rem == Setup path to nmake.exe, from vc 2005 common tools directory ==
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
|
||||
|
||||
set TTEXE=..\..\devtools\bin\timeprecise.exe
|
||||
if not exist %TTEXE% goto no_ttexe
|
||||
goto no_ttexe_end
|
||||
|
||||
:no_ttexe
|
||||
set TTEXE=time /t
|
||||
:no_ttexe_end
|
||||
|
||||
|
||||
rem echo.
|
||||
rem echo ~~~~~~ buildsdkshaders %* ~~~~~~
|
||||
%TTEXE% -cur-Q
|
||||
set tt_all_start=%ERRORLEVEL%
|
||||
set tt_all_chkpt=%tt_start%
|
||||
|
||||
set BUILD_SHADER=call buildshaders.bat
|
||||
set ARG_EXTRA=
|
||||
|
||||
%BUILD_SHADER% stdshader_dx9_20b -game %GAMEDIR% -source %SOURCEDIR%
|
||||
%BUILD_SHADER% stdshader_dx9_30 -game %GAMEDIR% -source %SOURCEDIR% -dx9_30 -force30
|
||||
|
||||
|
||||
rem echo.
|
||||
if not "%dynamic_shaders%" == "1" (
|
||||
rem echo Finished full buildallshaders %*
|
||||
) else (
|
||||
rem echo Finished dynamic buildallshaders %*
|
||||
)
|
||||
|
||||
rem %TTEXE% -diff %tt_all_start% -cur
|
||||
rem echo.
|
||||
|
||||
418
mp/src/materialsystem/stdshaders/buildshaders.bat
Normal file → Executable file
418
mp/src/materialsystem/stdshaders/buildshaders.bat
Normal file → Executable file
@@ -1,209 +1,209 @@
|
||||
@echo off
|
||||
|
||||
set TTEXE=..\..\devtools\bin\timeprecise.exe
|
||||
if not exist %TTEXE% goto no_ttexe
|
||||
goto no_ttexe_end
|
||||
|
||||
:no_ttexe
|
||||
set TTEXE=time /t
|
||||
:no_ttexe_end
|
||||
|
||||
echo.
|
||||
echo ==================== buildshaders %* ==================
|
||||
%TTEXE% -cur-Q
|
||||
set tt_start=%ERRORLEVEL%
|
||||
set tt_chkpt=%tt_start%
|
||||
|
||||
|
||||
REM ****************
|
||||
REM usage: buildshaders <shaderProjectName>
|
||||
REM ****************
|
||||
|
||||
setlocal
|
||||
set arg_filename=%1
|
||||
set shadercompilecommand=shadercompile.exe
|
||||
set targetdir=shaders
|
||||
set SrcDirBase=..\..
|
||||
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
|
||||
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_end
|
||||
|
||||
if /i "%7" == "-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" == "-game" goto set_mod_args
|
||||
goto build_shaders
|
||||
|
||||
REM ****************
|
||||
REM USAGE
|
||||
REM ****************
|
||||
:usage
|
||||
echo.
|
||||
echo "usage: buildshaders <shaderProjectName> [-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 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 /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"
|
||||
|
||||
if not exist "%~3\gameinfo.txt" goto InvalidGameDirectory
|
||||
goto build_shaders
|
||||
|
||||
REM ****************
|
||||
REM ERRORS
|
||||
REM ****************
|
||||
:InvalidGameDirectory
|
||||
echo -
|
||||
echo Error: "%~3" is not a valid game directory.
|
||||
echo (The -game directory must have a gameinfo.txt file)
|
||||
echo -
|
||||
goto end
|
||||
|
||||
:NoSourceDirSpecified
|
||||
echo ERROR: If you specify -game on the command line, you must specify -source.
|
||||
goto usage
|
||||
goto end
|
||||
|
||||
:NoShaderCompile
|
||||
echo -
|
||||
echo - ERROR: shadercompile.exe doesn't exist in %SDKBINDIR%
|
||||
echo -
|
||||
goto end
|
||||
|
||||
REM ****************
|
||||
REM BUILD SHADERS
|
||||
REM ****************
|
||||
:build_shaders
|
||||
|
||||
rem echo --------------------------------
|
||||
rem echo %inputbase%
|
||||
rem echo --------------------------------
|
||||
REM make sure that target dirs exist
|
||||
REM files will be built in these targets and copied to their final destination
|
||||
if not exist %shaderDir% mkdir %shaderDir%
|
||||
if not exist %shaderDir%\fxc mkdir %shaderDir%\fxc
|
||||
if not exist %shaderDir%\vsh mkdir %shaderDir%\vsh
|
||||
if not exist %shaderDir%\psh mkdir %shaderDir%\psh
|
||||
REM Nuke some files that we will add to later.
|
||||
if exist filelist.txt del /f /q filelist.txt
|
||||
if exist filestocopy.txt del /f /q filestocopy.txt
|
||||
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 Generate a makefile for the shader project
|
||||
REM ****************
|
||||
perl "%SrcDirBase%\devtools\bin\updateshaders.pl" -source "%SrcDirBase%" %inputbase%
|
||||
|
||||
|
||||
REM ****************
|
||||
REM Run the makefile, generating minimal work/build list for fxc files, go ahead and compile vsh and psh files.
|
||||
REM ****************
|
||||
rem nmake /S /C -f makefile.%inputbase% clean > clean.txt 2>&1
|
||||
echo Building inc files, asm vcs files, and VMPI worklist for %inputbase%...
|
||||
nmake /S /C -f makefile.%inputbase%
|
||||
|
||||
REM ****************
|
||||
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
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Add the executables to the worklist.
|
||||
REM ****************
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc09.00" (
|
||||
rem echo "Copy extra files for dx 9 std
|
||||
)
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc09.30" (
|
||||
echo %SrcDirBase%\devtools\bin\d3dx9_33.dll >> filestocopy.txt
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
REM ****************
|
||||
REM Cull duplicate entries in work/build list
|
||||
REM ****************
|
||||
if exist filestocopy.txt type filestocopy.txt | perl "%SrcDirBase%\devtools\bin\uniqifylist.pl" > uniquefilestocopy.txt
|
||||
if exist filelistgen.txt if not "%dynamic_shaders%" == "1" (
|
||||
echo Generating action list...
|
||||
copy filelistgen.txt filelist.txt >nul
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Execute distributed process on work/build list
|
||||
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%
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM PC Shader copy
|
||||
REM Publish the generated files to the output dir using 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
|
||||
)
|
||||
goto end
|
||||
|
||||
REM ****************
|
||||
REM END
|
||||
REM ****************
|
||||
:end
|
||||
|
||||
|
||||
%TTEXE% -diff %tt_start%
|
||||
echo.
|
||||
|
||||
@echo off
|
||||
|
||||
set TTEXE=..\..\devtools\bin\timeprecise.exe
|
||||
if not exist %TTEXE% goto no_ttexe
|
||||
goto no_ttexe_end
|
||||
|
||||
:no_ttexe
|
||||
set TTEXE=time /t
|
||||
:no_ttexe_end
|
||||
|
||||
echo.
|
||||
echo ==================== buildshaders %* ==================
|
||||
%TTEXE% -cur-Q
|
||||
set tt_start=%ERRORLEVEL%
|
||||
set tt_chkpt=%tt_start%
|
||||
|
||||
|
||||
REM ****************
|
||||
REM usage: buildshaders <shaderProjectName>
|
||||
REM ****************
|
||||
|
||||
setlocal
|
||||
set arg_filename=%1
|
||||
set shadercompilecommand=shadercompile.exe
|
||||
set targetdir=shaders
|
||||
set SrcDirBase=..\..
|
||||
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
|
||||
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_end
|
||||
|
||||
if /i "%7" == "-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" == "-game" goto set_mod_args
|
||||
goto build_shaders
|
||||
|
||||
REM ****************
|
||||
REM USAGE
|
||||
REM ****************
|
||||
:usage
|
||||
echo.
|
||||
echo "usage: buildshaders <shaderProjectName> [-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 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 /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"
|
||||
|
||||
if not exist "%~3\gameinfo.txt" goto InvalidGameDirectory
|
||||
goto build_shaders
|
||||
|
||||
REM ****************
|
||||
REM ERRORS
|
||||
REM ****************
|
||||
:InvalidGameDirectory
|
||||
echo -
|
||||
echo Error: "%~3" is not a valid game directory.
|
||||
echo (The -game directory must have a gameinfo.txt file)
|
||||
echo -
|
||||
goto end
|
||||
|
||||
:NoSourceDirSpecified
|
||||
echo ERROR: If you specify -game on the command line, you must specify -source.
|
||||
goto usage
|
||||
goto end
|
||||
|
||||
:NoShaderCompile
|
||||
echo -
|
||||
echo - ERROR: shadercompile.exe doesn't exist in %SDKBINDIR%
|
||||
echo -
|
||||
goto end
|
||||
|
||||
REM ****************
|
||||
REM BUILD SHADERS
|
||||
REM ****************
|
||||
:build_shaders
|
||||
|
||||
rem echo --------------------------------
|
||||
rem echo %inputbase%
|
||||
rem echo --------------------------------
|
||||
REM make sure that target dirs exist
|
||||
REM files will be built in these targets and copied to their final destination
|
||||
if not exist %shaderDir% mkdir %shaderDir%
|
||||
if not exist %shaderDir%\fxc mkdir %shaderDir%\fxc
|
||||
if not exist %shaderDir%\vsh mkdir %shaderDir%\vsh
|
||||
if not exist %shaderDir%\psh mkdir %shaderDir%\psh
|
||||
REM Nuke some files that we will add to later.
|
||||
if exist filelist.txt del /f /q filelist.txt
|
||||
if exist filestocopy.txt del /f /q filestocopy.txt
|
||||
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 Generate a makefile for the shader project
|
||||
REM ****************
|
||||
perl "%SrcDirBase%\devtools\bin\updateshaders.pl" -source "%SrcDirBase%" %inputbase%
|
||||
|
||||
|
||||
REM ****************
|
||||
REM Run the makefile, generating minimal work/build list for fxc files, go ahead and compile vsh and psh files.
|
||||
REM ****************
|
||||
rem nmake /S /C -f makefile.%inputbase% clean > clean.txt 2>&1
|
||||
echo Building inc files, asm vcs files, and VMPI worklist for %inputbase%...
|
||||
nmake /S /C -f makefile.%inputbase%
|
||||
|
||||
REM ****************
|
||||
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
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Add the executables to the worklist.
|
||||
REM ****************
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc09.00" (
|
||||
rem echo "Copy extra files for dx 9 std
|
||||
)
|
||||
if /i "%DIRECTX_SDK_VER%" == "pc09.30" (
|
||||
echo %SrcDirBase%\devtools\bin\d3dx9_33.dll >> filestocopy.txt
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
REM ****************
|
||||
REM Cull duplicate entries in work/build list
|
||||
REM ****************
|
||||
if exist filestocopy.txt type filestocopy.txt | perl "%SrcDirBase%\devtools\bin\uniqifylist.pl" > uniquefilestocopy.txt
|
||||
if exist filelistgen.txt if not "%dynamic_shaders%" == "1" (
|
||||
echo Generating action list...
|
||||
copy filelistgen.txt filelist.txt >nul
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM Execute distributed process on work/build list
|
||||
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%
|
||||
)
|
||||
|
||||
REM ****************
|
||||
REM PC Shader copy
|
||||
REM Publish the generated files to the output dir using 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
|
||||
)
|
||||
goto end
|
||||
|
||||
REM ****************
|
||||
REM END
|
||||
REM ****************
|
||||
:end
|
||||
|
||||
|
||||
%TTEXE% -diff %tt_start%
|
||||
echo.
|
||||
|
||||
|
||||
64
mp/src/materialsystem/stdshaders/clean.bat
Normal file → Executable file
64
mp/src/materialsystem/stdshaders/clean.bat
Normal file → Executable file
@@ -1,33 +1,33 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if /i "%1" == "-game" goto CleanGameDir
|
||||
|
||||
rem Clean out hl2
|
||||
if exist ..\..\..\game\hl2\shaders rd /s /q ..\..\..\game\hl2\shaders
|
||||
goto CleanOtherStuff
|
||||
|
||||
:CleanGameDir
|
||||
set __GameDir=%~2
|
||||
if not exist "%__GameDir%\gameinfo.txt" goto MissingGameInfo
|
||||
if exist "%__GameDir%\shaders" rd /s /q "%2\shaders"
|
||||
goto CleanOtherStuff
|
||||
|
||||
:CleanOtherStuff
|
||||
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_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 shaders rd /s /q shaders
|
||||
goto end
|
||||
|
||||
:MissingGameInfo
|
||||
echo Invalid -game parameter specified (no "%__GameDir%\gameinfo.txt" exists).
|
||||
goto end
|
||||
|
||||
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if /i "%1" == "-game" goto CleanGameDir
|
||||
|
||||
rem Clean out hl2
|
||||
if exist ..\..\..\game\hl2\shaders rd /s /q ..\..\..\game\hl2\shaders
|
||||
goto CleanOtherStuff
|
||||
|
||||
:CleanGameDir
|
||||
set __GameDir=%~2
|
||||
if not exist "%__GameDir%\gameinfo.txt" goto MissingGameInfo
|
||||
if exist "%__GameDir%\shaders" rd /s /q "%2\shaders"
|
||||
goto CleanOtherStuff
|
||||
|
||||
:CleanOtherStuff
|
||||
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_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 shaders rd /s /q shaders
|
||||
goto end
|
||||
|
||||
:MissingGameInfo
|
||||
echo Invalid -game parameter specified (no "%__GameDir%\gameinfo.txt" exists).
|
||||
goto end
|
||||
|
||||
|
||||
:end
|
||||
24
mp/src/materialsystem/stdshaders/cleantemps.bat
Normal file → Executable file
24
mp/src/materialsystem/stdshaders/cleantemps.bat
Normal file → Executable file
@@ -1,12 +1,12 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
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
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
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
|
||||
|
||||
@@ -1,92 +1,92 @@
|
||||
//===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
|
||||
//
|
||||
// Example pixel shader that can be applied to models
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..0"
|
||||
// STATIC: "FLASHLIGHT" "0..1"
|
||||
// STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..2" [ps20b]
|
||||
|
||||
// DYNAMIC: "WRITEWATERFOGTODESTALPHA" "0..1"
|
||||
// DYNAMIC: "PIXELFOGTYPE" "0..1"
|
||||
// DYNAMIC: "NUM_LIGHTS" "0..4"
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b]
|
||||
|
||||
// SKIP: ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
|
||||
|
||||
// We don't care about flashlight depth unless the flashlight is on
|
||||
// SKIP: ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
|
||||
|
||||
// Flashlight shadow filter mode is irrelevant if there is no flashlight
|
||||
// SKIP: ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) [ps20b]
|
||||
|
||||
#include "common_flashlight_fxc.h"
|
||||
#include "shader_constant_register_map.h"
|
||||
|
||||
const float4 g_DiffuseModulation : register( PSREG_DIFFUSE_MODULATION );
|
||||
const float4 g_ShadowTweaks : register( PSREG_ENVMAP_TINT__SHADOW_TWEAKS );
|
||||
const float3 cAmbientCube[6] : register( PSREG_AMBIENT_CUBE );
|
||||
const float4 g_EyePos : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
||||
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
||||
const float4 g_FlashlightAttenuationFactors : register( PSREG_FLASHLIGHT_ATTENUATION ); // On non-flashlight pass
|
||||
const float4 g_FlashlightPos_RimBoost : register( PSREG_FLASHLIGHT_POSITION_RIM_BOOST );
|
||||
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
|
||||
PixelShaderLightInfo cLightInfo[3] : register( PSREG_LIGHT_INFO_ARRAY ); // 2 registers each - 6 registers total (4th light spread across w's)
|
||||
|
||||
#define g_FlashlightPos g_FlashlightPos_RimBoost.xyz
|
||||
|
||||
sampler BaseTextureSampler : register( s0 ); // Base map, selfillum in alpha
|
||||
sampler ShadowDepthSampler : register( s4 ); // Flashlight shadow depth map sampler
|
||||
sampler NormalizeRandRotSampler : register( s5 ); // Normalization / RandomRotation samplers
|
||||
sampler FlashlightSampler : register( s6 ); // Flashlight cookie
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float4 lightAtten : TEXCOORD1;
|
||||
float3 worldNormal : TEXCOORD2;
|
||||
float3 worldPos : TEXCOORD3;
|
||||
float3 projPos : TEXCOORD4;
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 baseColor = tex2D( BaseTextureSampler, i.baseTexCoord );
|
||||
|
||||
float3 diffuseLighting;
|
||||
if ( FLASHLIGHT != 0 )
|
||||
{
|
||||
float4 flashlightSpacePosition = mul( float4( i.worldPos, 1.0f ), g_FlashlightWorldToTexture );
|
||||
|
||||
diffuseLighting = DoFlashlight( g_FlashlightPos, i.worldPos, flashlightSpacePosition,
|
||||
i.worldNormal, g_FlashlightAttenuationFactors.xyz,
|
||||
g_FlashlightAttenuationFactors.w, FlashlightSampler, ShadowDepthSampler,
|
||||
NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, i.projPos, false, g_ShadowTweaks );
|
||||
}
|
||||
else // non-flashlight path
|
||||
{
|
||||
// Summation of diffuse illumination from all local lights
|
||||
diffuseLighting = PixelShaderDoLighting( i.worldPos, i.worldNormal,
|
||||
float3( 0.0f, 0.0f, 0.0f ), false, true, i.lightAtten,
|
||||
cAmbientCube, NormalizeRandRotSampler, NUM_LIGHTS, cLightInfo, true,
|
||||
|
||||
// These are dummy parameters:
|
||||
false, 1.0f,
|
||||
false, BaseTextureSampler );
|
||||
}
|
||||
|
||||
float3 result = baseColor.rgb * g_DiffuseModulation.rgb * diffuseLighting;
|
||||
float alpha = g_DiffuseModulation.a * baseColor.a;
|
||||
|
||||
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos.z, i.worldPos.z, i.projPos.z );
|
||||
|
||||
#if WRITEWATERFOGTODESTALPHA && ( PIXELFOGTYPE == PIXEL_FOG_TYPE_HEIGHT )
|
||||
alpha = fogFactor;
|
||||
#endif
|
||||
|
||||
bool bWriteDepthToAlpha = ( WRITE_DEPTH_TO_DESTALPHA != 0 ) && ( WRITEWATERFOGTODESTALPHA == 0 );
|
||||
|
||||
return FinalOutput( float4( result, alpha ), fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR, bWriteDepthToAlpha, i.projPos.z );
|
||||
}
|
||||
//===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
|
||||
//
|
||||
// Example pixel shader that can be applied to models
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
// STATIC: "CONVERT_TO_SRGB" "0..0"
|
||||
// STATIC: "FLASHLIGHT" "0..1"
|
||||
// STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..2" [ps20b]
|
||||
|
||||
// DYNAMIC: "WRITEWATERFOGTODESTALPHA" "0..1"
|
||||
// DYNAMIC: "PIXELFOGTYPE" "0..1"
|
||||
// DYNAMIC: "NUM_LIGHTS" "0..4"
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b]
|
||||
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b]
|
||||
|
||||
// SKIP: ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
|
||||
|
||||
// We don't care about flashlight depth unless the flashlight is on
|
||||
// SKIP: ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
|
||||
|
||||
// Flashlight shadow filter mode is irrelevant if there is no flashlight
|
||||
// SKIP: ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) [ps20b]
|
||||
|
||||
#include "common_flashlight_fxc.h"
|
||||
#include "shader_constant_register_map.h"
|
||||
|
||||
const float4 g_DiffuseModulation : register( PSREG_DIFFUSE_MODULATION );
|
||||
const float4 g_ShadowTweaks : register( PSREG_ENVMAP_TINT__SHADOW_TWEAKS );
|
||||
const float3 cAmbientCube[6] : register( PSREG_AMBIENT_CUBE );
|
||||
const float4 g_EyePos : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
||||
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
||||
const float4 g_FlashlightAttenuationFactors : register( PSREG_FLASHLIGHT_ATTENUATION ); // On non-flashlight pass
|
||||
const float4 g_FlashlightPos_RimBoost : register( PSREG_FLASHLIGHT_POSITION_RIM_BOOST );
|
||||
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
|
||||
PixelShaderLightInfo cLightInfo[3] : register( PSREG_LIGHT_INFO_ARRAY ); // 2 registers each - 6 registers total (4th light spread across w's)
|
||||
|
||||
#define g_FlashlightPos g_FlashlightPos_RimBoost.xyz
|
||||
|
||||
sampler BaseTextureSampler : register( s0 ); // Base map, selfillum in alpha
|
||||
sampler ShadowDepthSampler : register( s4 ); // Flashlight shadow depth map sampler
|
||||
sampler NormalizeRandRotSampler : register( s5 ); // Normalization / RandomRotation samplers
|
||||
sampler FlashlightSampler : register( s6 ); // Flashlight cookie
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float4 lightAtten : TEXCOORD1;
|
||||
float3 worldNormal : TEXCOORD2;
|
||||
float3 worldPos : TEXCOORD3;
|
||||
float3 projPos : TEXCOORD4;
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 baseColor = tex2D( BaseTextureSampler, i.baseTexCoord );
|
||||
|
||||
float3 diffuseLighting;
|
||||
if ( FLASHLIGHT != 0 )
|
||||
{
|
||||
float4 flashlightSpacePosition = mul( float4( i.worldPos, 1.0f ), g_FlashlightWorldToTexture );
|
||||
|
||||
diffuseLighting = DoFlashlight( g_FlashlightPos, i.worldPos, flashlightSpacePosition,
|
||||
i.worldNormal, g_FlashlightAttenuationFactors.xyz,
|
||||
g_FlashlightAttenuationFactors.w, FlashlightSampler, ShadowDepthSampler,
|
||||
NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, i.projPos, false, g_ShadowTweaks );
|
||||
}
|
||||
else // non-flashlight path
|
||||
{
|
||||
// Summation of diffuse illumination from all local lights
|
||||
diffuseLighting = PixelShaderDoLighting( i.worldPos, i.worldNormal,
|
||||
float3( 0.0f, 0.0f, 0.0f ), false, true, i.lightAtten,
|
||||
cAmbientCube, NormalizeRandRotSampler, NUM_LIGHTS, cLightInfo, true,
|
||||
|
||||
// These are dummy parameters:
|
||||
false, 1.0f,
|
||||
false, BaseTextureSampler );
|
||||
}
|
||||
|
||||
float3 result = baseColor.rgb * g_DiffuseModulation.rgb * diffuseLighting;
|
||||
float alpha = g_DiffuseModulation.a * baseColor.a;
|
||||
|
||||
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos.z, i.worldPos.z, i.projPos.z );
|
||||
|
||||
#if WRITEWATERFOGTODESTALPHA && ( PIXELFOGTYPE == PIXEL_FOG_TYPE_HEIGHT )
|
||||
alpha = fogFactor;
|
||||
#endif
|
||||
|
||||
bool bWriteDepthToAlpha = ( WRITE_DEPTH_TO_DESTALPHA != 0 ) && ( WRITEWATERFOGTODESTALPHA == 0 );
|
||||
|
||||
return FinalOutput( float4( result, alpha ), fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR, bWriteDepthToAlpha, i.projPos.z );
|
||||
}
|
||||
|
||||
@@ -1,91 +1,91 @@
|
||||
//===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
|
||||
//
|
||||
// Example vertex shader that can be applied to models
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
// DYNAMIC: "COMPRESSED_VERTS" "0..1"
|
||||
// DYNAMIC: "DOWATERFOG" "0..1"
|
||||
// DYNAMIC: "SKINNING" "0..1"
|
||||
// DYNAMIC: "LIGHTING_PREVIEW" "0..1"
|
||||
// DYNAMIC: "NUM_LIGHTS" "0..4"
|
||||
|
||||
#include "common_vs_fxc.h"
|
||||
|
||||
static const bool g_bSkinning = SKINNING ? true : false;
|
||||
static const int g_FogType = DOWATERFOG;
|
||||
|
||||
const float4 cBaseTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Input vertex format
|
||||
//-----------------------------------------------------------------------------
|
||||
struct VS_INPUT
|
||||
{
|
||||
// This is all of the stuff that we ever use.
|
||||
float4 vPos : POSITION;
|
||||
float4 vBoneWeights : BLENDWEIGHT;
|
||||
float4 vBoneIndices : BLENDINDICES;
|
||||
float4 vNormal : NORMAL;
|
||||
float2 vTexCoord0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
// Stuff that isn't seen by the pixel shader
|
||||
float4 projPosSetup : POSITION;
|
||||
float fog : FOG;
|
||||
// Stuff that is seen by the pixel shader
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float4 lightAtten : TEXCOORD1;
|
||||
float3 worldNormal : TEXCOORD2;
|
||||
float3 worldPos : TEXCOORD3;
|
||||
float3 projPos : TEXCOORD4;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main shader entry point
|
||||
//-----------------------------------------------------------------------------
|
||||
VS_OUTPUT main( const VS_INPUT v )
|
||||
{
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
float3 vNormal;
|
||||
DecompressVertex_Normal( v.vNormal, vNormal );
|
||||
|
||||
float3 worldNormal, worldPos;
|
||||
SkinPositionAndNormal( g_bSkinning, v.vPos, vNormal, v.vBoneWeights, v.vBoneIndices, worldPos, worldNormal );
|
||||
|
||||
// Transform into projection space
|
||||
float4 vProjPos = mul( float4( worldPos, 1 ), cViewProj );
|
||||
o.projPosSetup = vProjPos;
|
||||
vProjPos.z = dot( float4( worldPos, 1 ), cViewProjZ );
|
||||
|
||||
o.projPos = vProjPos.xyz;
|
||||
o.fog = CalcFog( worldPos, vProjPos.xyz, g_FogType );
|
||||
|
||||
// Needed for water fog alpha and diffuse lighting
|
||||
o.worldPos = worldPos;
|
||||
o.worldNormal = normalize( worldNormal );
|
||||
|
||||
// Scalar attenuations for four lights
|
||||
o.lightAtten.xyz = float4(0,0,0,0);
|
||||
#if ( NUM_LIGHTS > 0 )
|
||||
o.lightAtten.x = GetVertexAttenForLight( worldPos, 0, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 1 )
|
||||
o.lightAtten.y = GetVertexAttenForLight( worldPos, 1, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 2 )
|
||||
o.lightAtten.z = GetVertexAttenForLight( worldPos, 2, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 3 )
|
||||
o.lightAtten.w = GetVertexAttenForLight( worldPos, 3, false );
|
||||
#endif
|
||||
|
||||
// Base texture coordinate transform
|
||||
o.baseTexCoord.x = dot( v.vTexCoord0, cBaseTexCoordTransform[0] );
|
||||
o.baseTexCoord.y = dot( v.vTexCoord0, cBaseTexCoordTransform[1] );
|
||||
|
||||
return o;
|
||||
}
|
||||
//===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
|
||||
//
|
||||
// Example vertex shader that can be applied to models
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
// DYNAMIC: "COMPRESSED_VERTS" "0..1"
|
||||
// DYNAMIC: "DOWATERFOG" "0..1"
|
||||
// DYNAMIC: "SKINNING" "0..1"
|
||||
// DYNAMIC: "LIGHTING_PREVIEW" "0..1"
|
||||
// DYNAMIC: "NUM_LIGHTS" "0..4"
|
||||
|
||||
#include "common_vs_fxc.h"
|
||||
|
||||
static const bool g_bSkinning = SKINNING ? true : false;
|
||||
static const int g_FogType = DOWATERFOG;
|
||||
|
||||
const float4 cBaseTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Input vertex format
|
||||
//-----------------------------------------------------------------------------
|
||||
struct VS_INPUT
|
||||
{
|
||||
// This is all of the stuff that we ever use.
|
||||
float4 vPos : POSITION;
|
||||
float4 vBoneWeights : BLENDWEIGHT;
|
||||
float4 vBoneIndices : BLENDINDICES;
|
||||
float4 vNormal : NORMAL;
|
||||
float2 vTexCoord0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
// Stuff that isn't seen by the pixel shader
|
||||
float4 projPosSetup : POSITION;
|
||||
float fog : FOG;
|
||||
// Stuff that is seen by the pixel shader
|
||||
float2 baseTexCoord : TEXCOORD0;
|
||||
float4 lightAtten : TEXCOORD1;
|
||||
float3 worldNormal : TEXCOORD2;
|
||||
float3 worldPos : TEXCOORD3;
|
||||
float3 projPos : TEXCOORD4;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main shader entry point
|
||||
//-----------------------------------------------------------------------------
|
||||
VS_OUTPUT main( const VS_INPUT v )
|
||||
{
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
float3 vNormal;
|
||||
DecompressVertex_Normal( v.vNormal, vNormal );
|
||||
|
||||
float3 worldNormal, worldPos;
|
||||
SkinPositionAndNormal( g_bSkinning, v.vPos, vNormal, v.vBoneWeights, v.vBoneIndices, worldPos, worldNormal );
|
||||
|
||||
// Transform into projection space
|
||||
float4 vProjPos = mul( float4( worldPos, 1 ), cViewProj );
|
||||
o.projPosSetup = vProjPos;
|
||||
vProjPos.z = dot( float4( worldPos, 1 ), cViewProjZ );
|
||||
|
||||
o.projPos = vProjPos.xyz;
|
||||
o.fog = CalcFog( worldPos, vProjPos.xyz, g_FogType );
|
||||
|
||||
// Needed for water fog alpha and diffuse lighting
|
||||
o.worldPos = worldPos;
|
||||
o.worldNormal = normalize( worldNormal );
|
||||
|
||||
// Scalar attenuations for four lights
|
||||
o.lightAtten.xyz = float4(0,0,0,0);
|
||||
#if ( NUM_LIGHTS > 0 )
|
||||
o.lightAtten.x = GetVertexAttenForLight( worldPos, 0, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 1 )
|
||||
o.lightAtten.y = GetVertexAttenForLight( worldPos, 1, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 2 )
|
||||
o.lightAtten.z = GetVertexAttenForLight( worldPos, 2, false );
|
||||
#endif
|
||||
#if ( NUM_LIGHTS > 3 )
|
||||
o.lightAtten.w = GetVertexAttenForLight( worldPos, 3, false );
|
||||
#endif
|
||||
|
||||
// Base texture coordinate transform
|
||||
o.baseTexCoord.x = dot( v.vTexCoord0, cBaseTexCoordTransform[0] );
|
||||
o.baseTexCoord.y = dot( v.vTexCoord0, cBaseTexCoordTransform[1] );
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloom_ps20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloom_ps20 0
|
||||
class sdk_bloom_ps20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloom_ps20 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloom_ps20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloom_ps20 0
|
||||
class sdk_bloom_ps20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloom_ps20 0
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloom_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
void SetCONVERT_TO_SRGB( bool i )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_bloom_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = g_pHardwareConfig->NeedsShaderSRGBConversion();
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCONVERT_TO_SRGB ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloom_ps20b 0
|
||||
class sdk_bloom_ps20b_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20b_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloom_ps20b 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloom_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
void SetCONVERT_TO_SRGB( bool i )
|
||||
{
|
||||
m_nCONVERT_TO_SRGB = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_bloom_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = g_pHardwareConfig->NeedsShaderSRGBConversion();
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCONVERT_TO_SRGB ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloom_ps20b 0
|
||||
class sdk_bloom_ps20b_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloom_ps20b_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloom_ps20b 0
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloomadd_ps20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloomadd_ps20 0
|
||||
class sdk_bloomadd_ps20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloomadd_ps20 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloomadd_ps20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloomadd_ps20 0
|
||||
class sdk_bloomadd_ps20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloomadd_ps20 0
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloomadd_ps20b_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20b_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloomadd_ps20b 0
|
||||
class sdk_bloomadd_ps20b_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20b_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloomadd_ps20b 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_bloomadd_ps20b_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20b_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_bloomadd_ps20b 0
|
||||
class sdk_bloomadd_ps20b_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_bloomadd_ps20b_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_bloomadd_ps20b 0
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_screenspaceeffect_vs20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nX360APPCHOOSER;
|
||||
#ifdef _DEBUG
|
||||
bool m_bX360APPCHOOSER;
|
||||
#endif
|
||||
public:
|
||||
void SetX360APPCHOOSER( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nX360APPCHOOSER = i;
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif
|
||||
}
|
||||
void SetX360APPCHOOSER( bool i )
|
||||
{
|
||||
m_nX360APPCHOOSER = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_screenspaceeffect_vs20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif // _DEBUG
|
||||
m_nX360APPCHOOSER = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_bX360APPCHOOSER;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nX360APPCHOOSER ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_screenspaceeffect_vs20 0
|
||||
class sdk_screenspaceeffect_vs20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_screenspaceeffect_vs20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_screenspaceeffect_vs20 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_screenspaceeffect_vs20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nX360APPCHOOSER;
|
||||
#ifdef _DEBUG
|
||||
bool m_bX360APPCHOOSER;
|
||||
#endif
|
||||
public:
|
||||
void SetX360APPCHOOSER( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nX360APPCHOOSER = i;
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif
|
||||
}
|
||||
void SetX360APPCHOOSER( bool i )
|
||||
{
|
||||
m_nX360APPCHOOSER = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_screenspaceeffect_vs20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bX360APPCHOOSER = true;
|
||||
#endif // _DEBUG
|
||||
m_nX360APPCHOOSER = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_bX360APPCHOOSER;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nX360APPCHOOSER ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_screenspaceeffect_vs20 0
|
||||
class sdk_screenspaceeffect_vs20_Dynamic_Index
|
||||
{
|
||||
public:
|
||||
sdk_screenspaceeffect_vs20_Dynamic_Index()
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_screenspaceeffect_vs20 0
|
||||
|
||||
@@ -1,237 +1,237 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class example_model_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 0 );
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#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_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
|
||||
}
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = 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
|
||||
}
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = false;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_bFLASHLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nFLASHLIGHT ) + ( 160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_example_model_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
|
||||
class example_model_ps20b_Dynamic_Index
|
||||
{
|
||||
private:
|
||||
int m_nWRITEWATERFOGTODESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITEWATERFOGTODESTALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRITEWATERFOGTODESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_ps20b_Dynamic_Index()
|
||||
{
|
||||
#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
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_example_model_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 + 0
|
||||
#include "shaderlib/cshader.h"
|
||||
class example_model_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nCONVERT_TO_SRGB;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCONVERT_TO_SRGB;
|
||||
#endif
|
||||
public:
|
||||
void SetCONVERT_TO_SRGB( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 0 );
|
||||
m_nCONVERT_TO_SRGB = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = true;
|
||||
#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_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
|
||||
}
|
||||
void SetFLASHLIGHT( bool i )
|
||||
{
|
||||
m_nFLASHLIGHT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = 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
|
||||
}
|
||||
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bCONVERT_TO_SRGB = false;
|
||||
#endif // _DEBUG
|
||||
m_nCONVERT_TO_SRGB = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHT = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHT = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
||||
#endif // _DEBUG
|
||||
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_bFLASHLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nFLASHLIGHT ) + ( 160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_example_model_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
|
||||
class example_model_ps20b_Dynamic_Index
|
||||
{
|
||||
private:
|
||||
int m_nWRITEWATERFOGTODESTALPHA;
|
||||
#ifdef _DEBUG
|
||||
bool m_bWRITEWATERFOGTODESTALPHA;
|
||||
#endif
|
||||
public:
|
||||
void SetWRITEWATERFOGTODESTALPHA( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nWRITEWATERFOGTODESTALPHA = i;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITEWATERFOGTODESTALPHA = true;
|
||||
#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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
void SetFLASHLIGHTSHADOWS( bool i )
|
||||
{
|
||||
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bFLASHLIGHTSHADOWS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_ps20b_Dynamic_Index()
|
||||
{
|
||||
#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
|
||||
m_nFLASHLIGHTSHADOWS = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_example_model_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 + 0
|
||||
|
||||
@@ -1,160 +1,160 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class example_model_vs20_Static_Index
|
||||
{
|
||||
public:
|
||||
example_model_vs20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_example_model_vs20 0
|
||||
class example_model_vs20_Dynamic_Index
|
||||
{
|
||||
private:
|
||||
int m_nCOMPRESSED_VERTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS;
|
||||
#endif
|
||||
public:
|
||||
void SetCOMPRESSED_VERTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCOMPRESSED_VERTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
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 <= 4 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_vs20_Dynamic_Index()
|
||||
{
|
||||
#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
|
||||
m_nNUM_LIGHTS = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_example_model_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
|
||||
#include "shaderlib/cshader.h"
|
||||
class example_model_vs20_Static_Index
|
||||
{
|
||||
public:
|
||||
example_model_vs20_Static_Index( )
|
||||
{
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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
|
||||
#endif // _DEBUG
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_example_model_vs20 0
|
||||
class example_model_vs20_Dynamic_Index
|
||||
{
|
||||
private:
|
||||
int m_nCOMPRESSED_VERTS;
|
||||
#ifdef _DEBUG
|
||||
bool m_bCOMPRESSED_VERTS;
|
||||
#endif
|
||||
public:
|
||||
void SetCOMPRESSED_VERTS( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nCOMPRESSED_VERTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bCOMPRESSED_VERTS = true;
|
||||
#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
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
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 <= 4 );
|
||||
m_nNUM_LIGHTS = i;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
void SetNUM_LIGHTS( bool i )
|
||||
{
|
||||
m_nNUM_LIGHTS = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bNUM_LIGHTS = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
example_model_vs20_Dynamic_Index()
|
||||
{
|
||||
#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
|
||||
m_nNUM_LIGHTS = 0;
|
||||
}
|
||||
int GetIndex()
|
||||
{
|
||||
// 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_example_model_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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,16 @@
|
||||
//
|
||||
// Standard shaders collection
|
||||
//
|
||||
// These shaders are compiled as the following shader models:
|
||||
// _ps20.vcs
|
||||
// _ps20b.vcs
|
||||
// _vs20.vcs
|
||||
//
|
||||
|
||||
example_model_ps20b.fxc
|
||||
example_model_vs20.fxc
|
||||
|
||||
SDK_Bloom_ps2x.fxc
|
||||
SDK_screenspaceeffect_vs20.fxc
|
||||
|
||||
SDK_bloomadd_ps2x.fxc
|
||||
//
|
||||
// Standard shaders collection
|
||||
//
|
||||
// These shaders are compiled as the following shader models:
|
||||
// _ps20.vcs
|
||||
// _ps20b.vcs
|
||||
// _vs20.vcs
|
||||
//
|
||||
|
||||
example_model_ps20b.fxc
|
||||
example_model_vs20.fxc
|
||||
|
||||
SDK_Bloom_ps2x.fxc
|
||||
SDK_screenspaceeffect_vs20.fxc
|
||||
|
||||
SDK_bloomadd_ps2x.fxc
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
//
|
||||
// vs 3.0 ps 3.0 shaders collection
|
||||
//
|
||||
// These shaders are forced to compile as shader model 3.0
|
||||
// using the new compiler.
|
||||
// _ps30.vcs
|
||||
// _vs30.vcs
|
||||
//
|
||||
|
||||
// There are no examples of such shaders in the SDK, but add yours here.
|
||||
//
|
||||
// vs 3.0 ps 3.0 shaders collection
|
||||
//
|
||||
// These shaders are forced to compile as shader model 3.0
|
||||
// using the new compiler.
|
||||
// _ps30.vcs
|
||||
// _vs30.vcs
|
||||
//
|
||||
|
||||
// There are no examples of such shaders in the SDK, but add yours here.
|
||||
|
||||
Reference in New Issue
Block a user