mirror of
https://github.com/celisej567/BCWSsrc.git
synced 2026-09-21 20:15:08 +03:00
Merged dev changes 9/28/2019
- Experimental RPC stuff for the future - Fixed players running over allies with vehicles (kind of) - Modified redirect filter infrastructure to support when there's no target filter (meaning it will just make sure the entity exists) - Fixed SDK_EyeRefract - Fixed env_beam SetStart/EndEntity - New "OnStateChange" output on NPCs - scripted_face removed (use generic facing VCDs instead) - Fixed RPC - View ID nodraw keyvalue + reflective glass view ID fix - CopyAnimationDataFrom expansion (more variables copied) - Fixed pre-Mapbase env_projectedtextures not updating after loading a save - Fixed(?) player companion grenade throwing being interrupted - Added convars for secondary and NPC shotgun pellet amounts - NPC fade distance/scale transfers to its ragdoll - Made node graph rebuild occur sooner after map load - Added option to disable "node graph out of date" message - Fixed ent_fire delay (decimals discarded before) - "SetFilter" on func_clip_vphysics - Fixed func_tank zero barrel (untested) - Fixed npc_turret_ground parenting fix - Added toggle-able weapon_crossbow experimental hit location code - Fixed ally grenades being considered Combine grenades - Added SDK_MonitorScreen and SDK_UnlitTwoTexture - Updated README - Added !activator/!caller support to logic_collision_pair - Fixed ortho not working in script_intro - Added Nbc66's closed captioning language fix - Applied fade fix to server ragdolls - Added combine_mine friend/foe filters - Fixed env_starfield pausing - Reworked PickupWeapon/Item inputs - Fixed context response system $ usage - Fixed env_break_shooter velocity/speed - Made func_breakable "Spawn on break" support other entities - Fixed OnThrowGrenade > point_entity_replace blip - Added mapname to logic_externaldata - Added "Random Template" to point_template - Added "Use LOS" to trigger_look - Added flags based on L4D(2) to trigger_playermovement - Added npc_combine_s "Alternate Capable" keyvalue that enables both grenades and alt-fire at the same time regardless of elite status - Fixed npc_combine_s DropGrenade input - Miscellaneous code and comment changes
This commit is contained in:
182
sp/src/materialsystem/stdshaders/MonitorScreen_dx9.cpp
Normal file
182
sp/src/materialsystem/stdshaders/MonitorScreen_dx9.cpp
Normal file
@@ -0,0 +1,182 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "BaseVSShader.h"
|
||||
#include "sdk_unlittwotexture_vs20.inc"
|
||||
#include "sdk_monitorscreen_ps20.inc"
|
||||
#include "sdk_monitorscreen_ps20b.inc"
|
||||
#include "cpp_shader_constant_register_map.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
DEFINE_FALLBACK_SHADER( SDK_MonitorScreen, SDK_MonitorScreen_DX9 )
|
||||
|
||||
BEGIN_VS_SHADER( SDK_MonitorScreen_DX9,
|
||||
"This is a shader that does a contrast/saturation version of base times lightmap." )
|
||||
|
||||
BEGIN_SHADER_PARAMS
|
||||
SHADER_PARAM( CONTRAST, SHADER_PARAM_TYPE_FLOAT, "0.0", "contrast 0 == normal 1 == color*color" )
|
||||
SHADER_PARAM( SATURATION, SHADER_PARAM_TYPE_FLOAT, "1.0", "saturation 0 == greyscale 1 == normal" )
|
||||
SHADER_PARAM( TINT, SHADER_PARAM_TYPE_COLOR, "[1 1 1]", "monitor tint" )
|
||||
SHADER_PARAM( TEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "shadertest/lightmappedtexture", "second texture" )
|
||||
SHADER_PARAM( FRAME2, SHADER_PARAM_TYPE_INTEGER, "0", "frame number for $texture2" )
|
||||
SHADER_PARAM( TEXTURE2TRANSFORM, SHADER_PARAM_TYPE_MATRIX, "center .5 .5 scale 1 1 rotate 0 translate 0 0", "$texture2 texcoord transform" )
|
||||
END_SHADER_PARAMS
|
||||
|
||||
// Set up anything that is necessary to make decisions in SHADER_FALLBACK.
|
||||
SHADER_INIT_PARAMS()
|
||||
{
|
||||
SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );
|
||||
if( !params[CONTRAST]->IsDefined() )
|
||||
{
|
||||
params[CONTRAST]->SetFloatValue( 0.0f );
|
||||
}
|
||||
if( !params[SATURATION]->IsDefined() )
|
||||
{
|
||||
params[SATURATION]->SetFloatValue( 1.0f );
|
||||
}
|
||||
if( !params[TINT]->IsDefined() )
|
||||
{
|
||||
params[TINT]->SetVecValue( 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
if (!IS_FLAG_DEFINED( MATERIAL_VAR_MODEL ))
|
||||
{
|
||||
CLEAR_FLAGS( MATERIAL_VAR_MODEL );
|
||||
}
|
||||
}
|
||||
|
||||
SHADER_FALLBACK
|
||||
{
|
||||
if( params && !params[BASETEXTURE]->IsDefined() )
|
||||
return "SDK_LightmappedGeneric";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SHADER_INIT
|
||||
{
|
||||
if (params[BASETEXTURE]->IsDefined())
|
||||
{
|
||||
LoadTexture( BASETEXTURE );
|
||||
}
|
||||
if (params[TEXTURE2]->IsDefined())
|
||||
{
|
||||
LoadTexture( TEXTURE2 );
|
||||
}
|
||||
}
|
||||
|
||||
SHADER_DRAW
|
||||
{
|
||||
bool bHasTexture2 = params[TEXTURE2]->IsTexture();
|
||||
BlendType_t nBlendType = EvaluateBlendRequirements( BASETEXTURE, true );
|
||||
bool bFullyOpaque = (nBlendType != BT_BLENDADD) && (nBlendType != BT_BLEND) && !IS_FLAG_SET(MATERIAL_VAR_ALPHATEST); //dest alpha is free for special use
|
||||
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
|
||||
pShaderShadow->EnableSRGBRead( SHADER_SAMPLER0, true );
|
||||
if ( bHasTexture2 )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
|
||||
pShaderShadow->EnableSRGBRead( SHADER_SAMPLER1, true );
|
||||
}
|
||||
|
||||
pShaderShadow->EnableSRGBWrite( true );
|
||||
|
||||
// Either we've got a constant modulation
|
||||
bool isTranslucent = IsAlphaModulating();
|
||||
|
||||
// Or we've got a texture alpha on either texture
|
||||
isTranslucent = isTranslucent || TextureIsTranslucent( BASETEXTURE, true ) ||
|
||||
TextureIsTranslucent( TEXTURE2, true );
|
||||
|
||||
if ( isTranslucent )
|
||||
{
|
||||
if ( IS_FLAG_SET(MATERIAL_VAR_ADDITIVE) )
|
||||
EnableAlphaBlending( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE );
|
||||
else
|
||||
EnableAlphaBlending( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IS_FLAG_SET(MATERIAL_VAR_ADDITIVE) )
|
||||
EnableAlphaBlending( SHADER_BLEND_ONE, SHADER_BLEND_ONE );
|
||||
else
|
||||
DisableAlphaBlending( );
|
||||
}
|
||||
|
||||
// Set stream format (note that this shader supports compression)
|
||||
unsigned int flags = VERTEX_POSITION | VERTEX_NORMAL | VERTEX_FORMAT_COMPRESSED;
|
||||
int nTexCoordCount = 1;
|
||||
int userDataSize = 0;
|
||||
pShaderShadow->VertexShaderVertexFormat( flags, nTexCoordCount, NULL, userDataSize );
|
||||
|
||||
DECLARE_STATIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( sdk_monitorscreen_ps20b );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( TEXTURE2, (bHasTexture2)?(1):(0) );
|
||||
SET_STATIC_PIXEL_SHADER( sdk_monitorscreen_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( sdk_monitorscreen_ps20 );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( TEXTURE2, (bHasTexture2)?(1):(0) );
|
||||
SET_STATIC_PIXEL_SHADER( sdk_monitorscreen_ps20 );
|
||||
}
|
||||
|
||||
DefaultFog();
|
||||
|
||||
pShaderShadow->EnableAlphaWrites( bFullyOpaque );
|
||||
}
|
||||
DYNAMIC_STATE
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
|
||||
if( bHasTexture2 )
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER1, TEXTURE2, FRAME2 );
|
||||
SetVertexShaderTextureTransform( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, TEXTURE2TRANSFORM );
|
||||
}
|
||||
SetVertexShaderTextureTransform( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, BASETEXTURETRANSFORM );
|
||||
SetPixelShaderConstant( 1, CONTRAST );
|
||||
SetPixelShaderConstant( 2, SATURATION );
|
||||
SetPixelShaderConstant( 3, TINT );
|
||||
SetModulationVertexShaderDynamicState();
|
||||
|
||||
pShaderAPI->SetPixelShaderFogParams( PSREG_FOG_PARAMS );
|
||||
|
||||
float vEyePos_SpecExponent[4];
|
||||
pShaderAPI->GetWorldSpaceCameraPosition( vEyePos_SpecExponent );
|
||||
vEyePos_SpecExponent[3] = 0.0f;
|
||||
pShaderAPI->SetPixelShaderConstant( PSREG_EYEPOS_SPEC_EXPONENT, vEyePos_SpecExponent, 1 );
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( sdk_monitorscreen_ps20b );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bFullyOpaque && pShaderAPI->ShouldWriteDepthToDestAlpha() );
|
||||
SET_DYNAMIC_PIXEL_SHADER( sdk_monitorscreen_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( sdk_monitorscreen_ps20 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER( sdk_monitorscreen_ps20 );
|
||||
}
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
END_SHADER
|
||||
@@ -107,10 +107,10 @@ float IntersectRaySphere ( float3 cameraPos, float3 ray, float3 sphereCenter, fl
|
||||
}
|
||||
|
||||
// Calculate both types of Fog and lerp to get result
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float flEyePosZ, const float flWorldPosZ, const float flProjPosZ )
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float3 vEyePos, const float3 vWorldPos, const float flProjPosZ )
|
||||
{
|
||||
float fRangeFog = CalcRangeFog( flProjPosZ, fogParams.x, fogParams.z, fogParams.w );
|
||||
float fHeightFog = CalcWaterFogAlpha( fogParams.y, flEyePosZ, flWorldPosZ, flProjPosZ, fogParams.w );
|
||||
float fRangeFog = CalcRangeFogFactorNonFixedFunction( vWorldPos, vEyePos, fogParams.z, fogParams.x, fogParams.w );
|
||||
float fHeightFog = CalcWaterFogAlpha( fogParams.y, vEyePos.z, vWorldPos.z, flProjPosZ, fogParams.w );
|
||||
return lerp( fRangeFog, fHeightFog, fPixelFogType );
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
result.a = 1.0;
|
||||
|
||||
#if !defined( SHADER_MODEL_PS_2_0 )
|
||||
float fogFactor = CalcPixelFogFactor( g_fPixelFogType, g_FogParams, g_vCameraPosition.xyz, i.vWorldPosition_ProjPosZ.xyz, i.vWorldPosition_ProjPosZ.w );
|
||||
float fogFactor = CalcPixelFogFactorConst( g_fPixelFogType, g_FogParams, g_vCameraPosition.xyz, i.vWorldPosition_ProjPosZ.xyz, i.vWorldPosition_ProjPosZ.w );
|
||||
return FinalOutputConst( result, fogFactor, g_fPixelFogType, TONEMAP_SCALE_LINEAR );
|
||||
#else
|
||||
float fogFactor = CalcPixelFogFactor( PIXEL_FOG_TYPE_NONE, g_FogParams, g_vCameraPosition.xyz, i.vWorldPosition_ProjPosZ.xyz, i.vWorldPosition_ProjPosZ.w );
|
||||
|
||||
55
sp/src/materialsystem/stdshaders/SDK_monitorscreen_ps2x.fxc
Normal file
55
sp/src/materialsystem/stdshaders/SDK_monitorscreen_ps2x.fxc
Normal file
@@ -0,0 +1,55 @@
|
||||
//========== Copyright (c) Valve Corporation, All rights reserved. ==========//
|
||||
//paired with unlittwotexture_vs20
|
||||
|
||||
// STATIC: "TEXTURE2" "0..1"
|
||||
|
||||
// DYNAMIC: "PIXELFOGTYPE" "0..1"
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [XBOX]
|
||||
|
||||
#if defined( SHADER_MODEL_PS_2_0 )
|
||||
# define WRITE_DEPTH_TO_DESTALPHA 0
|
||||
#endif
|
||||
|
||||
#include "shader_constant_register_map.h"
|
||||
#include "common_ps_fxc.h"
|
||||
|
||||
sampler BaseTextureSampler : register( s0 );
|
||||
sampler SecondaryTextureSampler : register( s1 );
|
||||
|
||||
|
||||
const float4 g_Contrast : register( c1 );
|
||||
const float4 g_Saturation : register( c2 );
|
||||
const float4 g_Tint : register( c3 );
|
||||
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
||||
const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
||||
|
||||
#define g_Grey float4( 0.33333f, 0.33333f, 0.33333f, 0.33333f )
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float2 vTexCoord0 : TEXCOORD0;
|
||||
float2 vTexCoord1 : TEXCOORD1;
|
||||
|
||||
float4 vColor : COLOR0;
|
||||
|
||||
float4 worldPos_projPosZ : TEXCOORD7;
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 resultColor = tex2D( BaseTextureSampler, i.vTexCoord0 ) * i.vColor; // base texture modulated with vertex color
|
||||
|
||||
#if (TEXTURE2 == 1)
|
||||
resultColor = tex2D( SecondaryTextureSampler, i.vTexCoord1 ) * resultColor; // modulate base color by another texture
|
||||
#endif
|
||||
|
||||
float3 tempColor = resultColor.rgb * resultColor.rgb; //base * base
|
||||
resultColor.rgb = lerp( resultColor.rgb, tempColor.rgb, g_Contrast.rgb ); // blend between color and color * color
|
||||
tempColor = dot( resultColor.rgb, g_Grey ); // color greyscaled
|
||||
resultColor.rgb = lerp( tempColor.rgb, resultColor.rgb, g_Saturation.rgb ); // blend between color and greyscale
|
||||
resultColor.rgb = resultColor.rgb * g_Tint.rgb; // tint
|
||||
|
||||
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos_SpecExponent.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
||||
return FinalOutput( resultColor, fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_NONE, (WRITE_DEPTH_TO_DESTALPHA != 0), i.worldPos_projPosZ.w );
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
//========== Copyright (c) Valve Corporation, All rights reserved. ==========//
|
||||
|
||||
// STATIC: "TRANSLUCENT" "0..1"
|
||||
|
||||
// DYNAMIC: "PIXELFOGTYPE" "0..1"
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
|
||||
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [XBOX]
|
||||
|
||||
#if defined( SHADER_MODEL_PS_2_0 )
|
||||
#define WRITE_DEPTH_TO_DESTALPHA 0
|
||||
#endif
|
||||
|
||||
#include "common_ps_fxc.h"
|
||||
#include "shader_constant_register_map.h"
|
||||
|
||||
const HALF4 g_DiffuseModulation : register( c1 );
|
||||
#if !FLASHLIGHT
|
||||
// we don't use these with HDR.
|
||||
const HALF3 g_EnvmapContrast : register( c2 );
|
||||
const HALF3 g_EnvmapSaturation : register( c3 );
|
||||
#endif
|
||||
|
||||
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
||||
const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
||||
|
||||
const float4 g_FlashlightAttenuationFactors : register( c22 );
|
||||
const HALF3 g_FlashlightPos : register( c23 );
|
||||
const float4x4 g_FlashlightWorldToTexture : register( c24 ); // through c27
|
||||
|
||||
sampler BaseTextureSampler : register( s0 );
|
||||
sampler BaseTextureSampler2 : register( s1 );
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 projPos : POSITION; // Projection-space position
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
HALF2 baseTexCoord2 : TEXCOORD1; // Base texture coordinate
|
||||
float4 worldPos_projPosZ : TEXCOORD7; // Necessary for water fog dest alpha
|
||||
|
||||
#if defined( _X360 ) //matching pixel shader inputs to vertex shader outputs to avoid shader patches
|
||||
float4 vColor : COLOR0;
|
||||
#endif
|
||||
};
|
||||
|
||||
float4 main( PS_INPUT i ) : COLOR
|
||||
{
|
||||
float4 baseColor = tex2D( BaseTextureSampler, i.baseTexCoord.xy );
|
||||
float4 baseColor2 = tex2D( BaseTextureSampler2, i.baseTexCoord2.xy );
|
||||
float4 result = baseColor * baseColor2 * g_DiffuseModulation;
|
||||
|
||||
// This material can only get a non-opaque alpha if the material is marked as translucent
|
||||
# if ( TRANSLUCENT == 0 )
|
||||
result.a = 1.0f;
|
||||
# endif
|
||||
|
||||
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos_SpecExponent.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
||||
return FinalOutput( result, fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR, (WRITE_DEPTH_TO_DESTALPHA != 0), i.worldPos_projPosZ.w );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//========== Copyright (c) Valve Corporation, All rights reserved. ==========//
|
||||
|
||||
// DYNAMIC: "COMPRESSED_VERTS" "0..1"
|
||||
// DYNAMIC: "DOWATERFOG" "0..1"
|
||||
// DYNAMIC: "SKINNING" "0..1"
|
||||
|
||||
#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 ); // 0 & 1
|
||||
const float4 cBaseTexCoordTransform2[2] : register( SHADER_SPECIFIC_CONST_2 ); // 2 & 3
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float4 vPos : POSITION;
|
||||
float4 vBoneWeights : BLENDWEIGHT;
|
||||
float4 vBoneIndices : BLENDINDICES;
|
||||
// make these float2's and stick the [n n 0 1] in the dot math.
|
||||
float4 vTexCoord0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 projPos : POSITION; // Projection-space position
|
||||
#if !defined( _X360 ) && !defined( SHADER_MODEL_VS_3_0 )
|
||||
float fog : FOG;
|
||||
#endif
|
||||
HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
|
||||
HALF2 baseTexCoord2 : TEXCOORD1; // Base texture coordinate
|
||||
float4 worldPos_projPosZ : TEXCOORD7; // Necessary for water fog dest alpha
|
||||
|
||||
float4 vColor : COLOR0;
|
||||
};
|
||||
|
||||
VS_OUTPUT main( const VS_INPUT v )
|
||||
{
|
||||
VS_OUTPUT o = ( VS_OUTPUT )0;
|
||||
|
||||
float4 vPosition = v.vPos;
|
||||
|
||||
// Perform skinning
|
||||
float3 worldNormal, worldPos;
|
||||
SkinPosition( g_bSkinning, vPosition, v.vBoneWeights, v.vBoneIndices, worldPos );
|
||||
|
||||
// Transform into projection space
|
||||
float4 projPos = mul( float4( worldPos, 1 ), cViewProj );
|
||||
o.projPos = projPos;
|
||||
|
||||
#if !defined( _X360 ) && !defined( SHADER_MODEL_VS_3_0 )
|
||||
o.fog = CalcFixedFunctionFog( worldPos, g_FogType );
|
||||
#endif
|
||||
|
||||
// Needed for water fog alpha;
|
||||
o.worldPos_projPosZ = float4( worldPos.xyz, o.projPos.z ); // FIXME: we shouldn't have to compute this all thie time.
|
||||
|
||||
o.baseTexCoord.x = dot( v.vTexCoord0, cBaseTexCoordTransform[0] ); // Base texture coordinates
|
||||
o.baseTexCoord.y = dot( v.vTexCoord0, cBaseTexCoordTransform[1] );
|
||||
o.baseTexCoord2.x = dot( v.vTexCoord0, cBaseTexCoordTransform2[0] ); // Secondary texture coordinates
|
||||
o.baseTexCoord2.y = dot( v.vTexCoord0, cBaseTexCoordTransform2[1] );
|
||||
|
||||
o.vColor = cModulationColor;
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -131,10 +131,10 @@ struct PS_INPUT
|
||||
};
|
||||
|
||||
// Calculate both types of Fog and lerp to get result
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float flEyePosZ, const float flWorldPosZ, const float flProjPosZ )
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float3 vEyePos, const float3 vWorldPos, const float flProjPosZ )
|
||||
{
|
||||
float fRangeFog = CalcRangeFog( flProjPosZ, fogParams.x, fogParams.z, fogParams.w );
|
||||
float fHeightFog = CalcWaterFogAlpha( fogParams.y, flEyePosZ, flWorldPosZ, flProjPosZ, fogParams.w );
|
||||
float fRangeFog = CalcRangeFogFactorNonFixedFunction( vWorldPos, vEyePos, fogParams.z, fogParams.x, fogParams.w );
|
||||
float fHeightFog = CalcWaterFogAlpha( fogParams.y, vEyePos.z, vWorldPos.z, flProjPosZ, fogParams.w );
|
||||
return lerp( fRangeFog, fHeightFog, fPixelFogType );
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
#if defined(SHADER_MODEL_PS_2_0)
|
||||
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
||||
#else
|
||||
float fogFactor = CalcPixelFogFactor( g_fPixelFogType, g_FogParams, g_EyePos.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
||||
float fogFactor = CalcPixelFogFactorConst( g_fPixelFogType, g_FogParams, g_EyePos.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
||||
#endif
|
||||
|
||||
#if defined( SHADER_MODEL_PS_2_0 )
|
||||
@@ -343,7 +343,7 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
#if defined( SHADER_MODEL_PS_2_0 )
|
||||
return FinalOutput( float4( result.rgb, alpha ), fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR, false, i.worldPos_projPosZ.w );
|
||||
#else
|
||||
return FinalOutput( float4( result.rgb, alpha ), fogFactor, g_fPixelFogType, TONEMAP_SCALE_LINEAR, g_fWriteDepthToAlpha, i.worldPos_projPosZ.w );
|
||||
return FinalOutputConst( float4( result.rgb, alpha ), fogFactor, g_fPixelFogType, TONEMAP_SCALE_LINEAR, g_fWriteDepthToAlpha, i.worldPos_projPosZ.w );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -169,13 +169,17 @@ const float3 g_DetailTint : register( c10 );
|
||||
|
||||
|
||||
// Calculate unified fog
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float flEyePosZ, const float flWorldPosZ, const float flProjPosZ )
|
||||
float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float3 vEyePos, const float3 vWorldPos, const float flProjPosZ )
|
||||
{
|
||||
float flDepthBelowWater = fPixelFogType*fogParams.y - flWorldPosZ; // above water = negative, below water = positive
|
||||
/*float flDepthBelowWater = fPixelFogType*fogParams.y - flWorldPosZ; // above water = negative, below water = positive
|
||||
float flDepthBelowEye = fPixelFogType*flEyePosZ - flWorldPosZ; // above eye = negative, below eye = positive
|
||||
// if fPixelFogType == 0, then flDepthBelowWater == flDepthBelowEye and frac will be 1
|
||||
float frac = (flDepthBelowEye == 0) ? 1 : saturate(flDepthBelowWater/flDepthBelowEye);
|
||||
return saturate( min(fogParams.z, flProjPosZ * fogParams.w * frac - fogParams.x) );
|
||||
return saturate( min(fogParams.z, flProjPosZ * fogParams.w * frac - fogParams.x) );*/
|
||||
|
||||
float fRangeFog = CalcRangeFogFactorNonFixedFunction( vWorldPos, vEyePos, fogParams.z, fogParams.x, fogParams.w );
|
||||
float fHeightFog = CalcWaterFogAlpha( fogParams.y, vEyePos.z, vWorldPos.z, flProjPosZ, fogParams.w );
|
||||
return lerp( fRangeFog, fHeightFog, fPixelFogType );
|
||||
}
|
||||
|
||||
// Blend both types of Fog and lerp to get result
|
||||
@@ -474,7 +478,7 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
#endif
|
||||
return FinalOutput( float4( result.rgb, alpha ), fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR, false, i.projPos.z );
|
||||
#else // 2b or higher
|
||||
float fogFactor = CalcPixelFogFactor( g_fPixelFogType, g_FogParams, g_EyePos.xyz, i.worldPos_projPosZ.xyz, i.projPos.z );
|
||||
float fogFactor = CalcPixelFogFactorConst( g_fPixelFogType, g_FogParams, g_EyePos.xyz, i.worldPos_projPosZ.xyz, i.projPos.z );
|
||||
alpha = lerp( alpha, fogFactor, g_fWriteWaterFogToDestAlpha ); // Use the fog factor if it's height fog
|
||||
return FinalOutputConst( float4( result.rgb, alpha ), fogFactor, g_fPixelFogType, TONEMAP_SCALE_LINEAR, g_fWriteDepthToAlpha, i.projPos.z );
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#ifdef MAPBASE
|
||||
ConVar mat_decalmodulate_noflashdraw( "mat_decalmodulate_noflashdraw", "0" );
|
||||
ConVar mat_decalmodulate_flashdraw( "mat_decalmodulate_flashdraw", "0" );
|
||||
#endif
|
||||
|
||||
DEFINE_FALLBACK_SHADER( SDK_DecalModulate, SDK_DecalModulate_DX9 )
|
||||
@@ -76,6 +76,8 @@ BEGIN_VS_SHADER( SDK_DecalModulate_dx9,
|
||||
// The flashlight part is transparent and overlaid on top of the decal.
|
||||
// When a fix is found, this flashlight code could be removed.
|
||||
bool bHasFlashlight = UsingFlashlight( params );
|
||||
if (bHasFlashlight && !mat_decalmodulate_flashdraw.GetBool())
|
||||
return;
|
||||
#endif
|
||||
SHADOW_STATE
|
||||
{
|
||||
|
||||
@@ -437,7 +437,7 @@ void Draw_Eyes_Refract_Internal( CBaseVSShader *pShader, IMaterialVar** params,
|
||||
{
|
||||
params[info.m_nEntityOrigin]->GetVecValue( timeVec, 3 );
|
||||
}
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_6, timeVec, 1 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_5, timeVec, 1 );
|
||||
}
|
||||
}
|
||||
pShader->Draw();
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_monitorscreen_ps20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTEXTURE2;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTEXTURE2;
|
||||
#endif
|
||||
public:
|
||||
void SetTEXTURE2( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTEXTURE2 = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
void SetTEXTURE2( bool i )
|
||||
{
|
||||
m_nTEXTURE2 = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = false;
|
||||
#endif // _DEBUG
|
||||
m_nTEXTURE2 = 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_bTEXTURE2;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 2 * m_nTEXTURE2 ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_monitorscreen_ps20 psh_forgot_to_set_static_TEXTURE2 + 0
|
||||
class sdk_monitorscreen_ps20_Dynamic_Index
|
||||
{
|
||||
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
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 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_bPIXELFOGTYPE;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_monitorscreen_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0
|
||||
@@ -0,0 +1,112 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_monitorscreen_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTEXTURE2;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTEXTURE2;
|
||||
#endif
|
||||
public:
|
||||
void SetTEXTURE2( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTEXTURE2 = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
void SetTEXTURE2( bool i )
|
||||
{
|
||||
m_nTEXTURE2 = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = false;
|
||||
#endif // _DEBUG
|
||||
m_nTEXTURE2 = 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_bTEXTURE2;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 4 * m_nTEXTURE2 ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_monitorscreen_ps20b psh_forgot_to_set_static_TEXTURE2 + 0
|
||||
class sdk_monitorscreen_ps20b_Dynamic_Index
|
||||
{
|
||||
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_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
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20b_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 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_bPIXELFOGTYPE && m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_monitorscreen_ps20b psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_ps20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTRANSLUCENT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTRANSLUCENT;
|
||||
#endif
|
||||
public:
|
||||
void SetTRANSLUCENT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTRANSLUCENT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
void SetTRANSLUCENT( bool i )
|
||||
{
|
||||
m_nTRANSLUCENT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = false;
|
||||
#endif // _DEBUG
|
||||
m_nTRANSLUCENT = 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_bTRANSLUCENT;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 2 * m_nTRANSLUCENT ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_unlittwotexture_ps20 psh_forgot_to_set_static_TRANSLUCENT + 0
|
||||
class sdk_unlittwotexture_ps20_Dynamic_Index
|
||||
{
|
||||
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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 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_bPIXELFOGTYPE;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0
|
||||
@@ -0,0 +1,112 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTRANSLUCENT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTRANSLUCENT;
|
||||
#endif
|
||||
public:
|
||||
void SetTRANSLUCENT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTRANSLUCENT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
void SetTRANSLUCENT( bool i )
|
||||
{
|
||||
m_nTRANSLUCENT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = false;
|
||||
#endif // _DEBUG
|
||||
m_nTRANSLUCENT = 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_bTRANSLUCENT;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 4 * m_nTRANSLUCENT ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_unlittwotexture_ps20b psh_forgot_to_set_static_TRANSLUCENT + 0
|
||||
class sdk_unlittwotexture_ps20b_Dynamic_Index
|
||||
{
|
||||
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_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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20b_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 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_bPIXELFOGTYPE && m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_ps20b psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
|
||||
@@ -0,0 +1,110 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_vs20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_unlittwotexture_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_sdk_unlittwotexture_vs20 0
|
||||
class sdk_unlittwotexture_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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_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;
|
||||
}
|
||||
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;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + 0
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_monitorscreen_ps20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTEXTURE2;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTEXTURE2;
|
||||
#endif
|
||||
public:
|
||||
void SetTEXTURE2( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTEXTURE2 = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
void SetTEXTURE2( bool i )
|
||||
{
|
||||
m_nTEXTURE2 = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = false;
|
||||
#endif // _DEBUG
|
||||
m_nTEXTURE2 = 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_bTEXTURE2;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 2 * m_nTEXTURE2 ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_monitorscreen_ps20 psh_forgot_to_set_static_TEXTURE2 + 0
|
||||
class sdk_monitorscreen_ps20_Dynamic_Index
|
||||
{
|
||||
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
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 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_bPIXELFOGTYPE;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_monitorscreen_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0
|
||||
@@ -0,0 +1,112 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_monitorscreen_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTEXTURE2;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTEXTURE2;
|
||||
#endif
|
||||
public:
|
||||
void SetTEXTURE2( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTEXTURE2 = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
void SetTEXTURE2( bool i )
|
||||
{
|
||||
m_nTEXTURE2 = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTEXTURE2 = false;
|
||||
#endif // _DEBUG
|
||||
m_nTEXTURE2 = 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_bTEXTURE2;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 4 * m_nTEXTURE2 ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_monitorscreen_ps20b psh_forgot_to_set_static_TEXTURE2 + 0
|
||||
class sdk_monitorscreen_ps20b_Dynamic_Index
|
||||
{
|
||||
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_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
|
||||
}
|
||||
public:
|
||||
sdk_monitorscreen_ps20b_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 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_bPIXELFOGTYPE && m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_monitorscreen_ps20b psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_ps20_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTRANSLUCENT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTRANSLUCENT;
|
||||
#endif
|
||||
public:
|
||||
void SetTRANSLUCENT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTRANSLUCENT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
void SetTRANSLUCENT( bool i )
|
||||
{
|
||||
m_nTRANSLUCENT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = false;
|
||||
#endif // _DEBUG
|
||||
m_nTRANSLUCENT = 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_bTRANSLUCENT;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 2 * m_nTRANSLUCENT ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_unlittwotexture_ps20 psh_forgot_to_set_static_TRANSLUCENT + 0
|
||||
class sdk_unlittwotexture_ps20_Dynamic_Index
|
||||
{
|
||||
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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 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_bPIXELFOGTYPE;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0
|
||||
@@ -0,0 +1,112 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_ps20b_Static_Index
|
||||
{
|
||||
private:
|
||||
int m_nTRANSLUCENT;
|
||||
#ifdef _DEBUG
|
||||
bool m_bTRANSLUCENT;
|
||||
#endif
|
||||
public:
|
||||
void SetTRANSLUCENT( int i )
|
||||
{
|
||||
Assert( i >= 0 && i <= 1 );
|
||||
m_nTRANSLUCENT = i;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
void SetTRANSLUCENT( bool i )
|
||||
{
|
||||
m_nTRANSLUCENT = i ? 1 : 0;
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = true;
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20b_Static_Index( )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bTRANSLUCENT = false;
|
||||
#endif // _DEBUG
|
||||
m_nTRANSLUCENT = 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_bTRANSLUCENT;
|
||||
Assert( bAllStaticVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 4 * m_nTRANSLUCENT ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderStaticTest_sdk_unlittwotexture_ps20b psh_forgot_to_set_static_TRANSLUCENT + 0
|
||||
class sdk_unlittwotexture_ps20b_Dynamic_Index
|
||||
{
|
||||
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_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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_ps20b_Dynamic_Index()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bPIXELFOGTYPE = false;
|
||||
#endif // _DEBUG
|
||||
m_nPIXELFOGTYPE = 0;
|
||||
#ifdef _DEBUG
|
||||
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
||||
#endif // _DEBUG
|
||||
m_nWRITE_DEPTH_TO_DESTALPHA = 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_bPIXELFOGTYPE && m_bWRITE_DEPTH_TO_DESTALPHA;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_ps20b psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
|
||||
@@ -0,0 +1,110 @@
|
||||
#include "shaderlib/cshader.h"
|
||||
class sdk_unlittwotexture_vs20_Static_Index
|
||||
{
|
||||
public:
|
||||
sdk_unlittwotexture_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_sdk_unlittwotexture_vs20 0
|
||||
class sdk_unlittwotexture_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
|
||||
}
|
||||
public:
|
||||
sdk_unlittwotexture_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;
|
||||
}
|
||||
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;
|
||||
Assert( bAllDynamicVarsDefined );
|
||||
#endif // _DEBUG
|
||||
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + 0;
|
||||
}
|
||||
};
|
||||
#define shaderDynamicTest_sdk_unlittwotexture_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + 0
|
||||
@@ -47,6 +47,9 @@ $Project
|
||||
$File "sprite_dx9.cpp"
|
||||
|
||||
$File "decalmodulate_dx9.cpp"
|
||||
|
||||
$File "unlittwotexture_dx9.cpp"
|
||||
$File "MonitorScreen_dx9.cpp"
|
||||
}
|
||||
|
||||
//$Shaders "mapbase_dx9_20b.txt"
|
||||
|
||||
@@ -86,4 +86,8 @@ SDK_sprite_ps2x.fxc
|
||||
SDK_sprite_vs20.fxc
|
||||
|
||||
SDK_decalmodulate_ps2x.fxc
|
||||
SDK_decalmodulate_vs20.fxc
|
||||
SDK_decalmodulate_vs20.fxc
|
||||
|
||||
SDK_unlittwotexture_ps2x.fxc
|
||||
SDK_unlittwotexture_vs20.fxc
|
||||
SDK_monitorscreen_ps2x.fxc
|
||||
265
sp/src/materialsystem/stdshaders/unlittwotexture_dx9.cpp
Normal file
265
sp/src/materialsystem/stdshaders/unlittwotexture_dx9.cpp
Normal file
@@ -0,0 +1,265 @@
|
||||
//===== Copyright <20> 1996-2007, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $Header: $
|
||||
// $NoKeywords: $
|
||||
//===========================================================================//
|
||||
|
||||
#include "BaseVSShader.h"
|
||||
#include "cloak_blended_pass_helper.h"
|
||||
#include "cpp_shader_constant_register_map.h"
|
||||
|
||||
#include "sdk_unlittwotexture_vs20.inc"
|
||||
#include "sdk_unlittwotexture_ps20.inc"
|
||||
#include "sdk_unlittwotexture_ps20b.inc"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
DEFINE_FALLBACK_SHADER( SDK_UnlitTwoTexture, SDK_UnlitTwoTexture_DX9 )
|
||||
BEGIN_VS_SHADER( SDK_UnlitTwoTexture_DX9, "Help for SDK_UnlitTwoTexture_DX9" )
|
||||
BEGIN_SHADER_PARAMS
|
||||
SHADER_PARAM( TEXTURE2, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "second texture" )
|
||||
SHADER_PARAM( FRAME2, SHADER_PARAM_TYPE_INTEGER, "0", "frame number for $texture2" )
|
||||
SHADER_PARAM( TEXTURE2TRANSFORM, SHADER_PARAM_TYPE_MATRIX, "center .5 .5 scale 1 1 rotate 0 translate 0 0", "$texture2 texcoord transform" )
|
||||
|
||||
// Cloak Pass
|
||||
SHADER_PARAM( CLOAKPASSENABLED, SHADER_PARAM_TYPE_BOOL, "0", "Enables cloak render in a second pass" )
|
||||
SHADER_PARAM( CLOAKFACTOR, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
|
||||
SHADER_PARAM( CLOAKCOLORTINT, SHADER_PARAM_TYPE_COLOR, "[1 1 1]", "Cloak color tint" )
|
||||
SHADER_PARAM( REFRACTAMOUNT, SHADER_PARAM_TYPE_FLOAT, "2", "" )
|
||||
END_SHADER_PARAMS
|
||||
|
||||
SHADER_FALLBACK
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Cloak Pass
|
||||
void SetupVarsCloakBlendedPass( CloakBlendedPassVars_t &info )
|
||||
{
|
||||
info.m_nCloakFactor = CLOAKFACTOR;
|
||||
info.m_nCloakColorTint = CLOAKCOLORTINT;
|
||||
info.m_nRefractAmount = REFRACTAMOUNT;
|
||||
}
|
||||
|
||||
bool NeedsPowerOfTwoFrameBufferTexture( IMaterialVar **params, bool bCheckSpecificToThisFrame ) const
|
||||
{
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() ) // If material supports cloaking
|
||||
{
|
||||
if ( bCheckSpecificToThisFrame == false ) // For setting model flag at load time
|
||||
return true;
|
||||
else if ( ( params[CLOAKFACTOR]->GetFloatValue() > 0.0f ) && ( params[CLOAKFACTOR]->GetFloatValue() < 1.0f ) ) // Per-frame check
|
||||
return true;
|
||||
// else, not cloaking this frame, so check flag2 in case the base material still needs it
|
||||
}
|
||||
|
||||
// Check flag2 if not drawing cloak pass
|
||||
return IS_FLAG2_SET( MATERIAL_VAR2_NEEDS_POWER_OF_TWO_FRAME_BUFFER_TEXTURE );
|
||||
}
|
||||
|
||||
bool IsTranslucent( IMaterialVar **params ) const
|
||||
{
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() ) // If material supports cloaking
|
||||
{
|
||||
if ( ( params[CLOAKFACTOR]->GetFloatValue() > 0.0f ) && ( params[CLOAKFACTOR]->GetFloatValue() < 1.0f ) ) // Per-frame check
|
||||
return true;
|
||||
// else, not cloaking this frame, so check flag in case the base material still needs it
|
||||
}
|
||||
|
||||
// Check flag if not drawing cloak pass
|
||||
return IS_FLAG_SET( MATERIAL_VAR_TRANSLUCENT );
|
||||
}
|
||||
|
||||
SHADER_INIT_PARAMS()
|
||||
{
|
||||
SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );
|
||||
|
||||
// Cloak Pass
|
||||
if ( !params[CLOAKPASSENABLED]->IsDefined() )
|
||||
{
|
||||
params[CLOAKPASSENABLED]->SetIntValue( 0 );
|
||||
}
|
||||
else if ( params[CLOAKPASSENABLED]->GetIntValue() )
|
||||
{
|
||||
CloakBlendedPassVars_t info;
|
||||
SetupVarsCloakBlendedPass( info );
|
||||
InitParamsCloakBlendedPass( this, params, pMaterialName, info );
|
||||
}
|
||||
}
|
||||
|
||||
SHADER_INIT
|
||||
{
|
||||
if (params[BASETEXTURE]->IsDefined())
|
||||
LoadTexture( BASETEXTURE );
|
||||
if (params[TEXTURE2]->IsDefined())
|
||||
LoadTexture( TEXTURE2 );
|
||||
|
||||
// Cloak Pass
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() )
|
||||
{
|
||||
CloakBlendedPassVars_t info;
|
||||
SetupVarsCloakBlendedPass( info );
|
||||
InitCloakBlendedPass( this, params, info );
|
||||
}
|
||||
}
|
||||
|
||||
SHADER_DRAW
|
||||
{
|
||||
// Skip the standard rendering if cloak pass is fully opaque
|
||||
bool bDrawStandardPass = true;
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() && ( pShaderShadow == NULL ) ) // && not snapshotting
|
||||
{
|
||||
CloakBlendedPassVars_t info;
|
||||
SetupVarsCloakBlendedPass( info );
|
||||
if ( CloakBlendedPassIsFullyOpaque( params, info ) )
|
||||
{
|
||||
bDrawStandardPass = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Skip flashlight pass for unlit stuff
|
||||
bool bNewFlashlightPath = IsX360();
|
||||
if ( bDrawStandardPass && ( pShaderShadow == NULL ) && ( pShaderAPI != NULL ) &&
|
||||
!bNewFlashlightPath && ( pShaderAPI->InFlashlightMode() ) ) // not snapshotting && flashlight pass)
|
||||
{
|
||||
bDrawStandardPass = false;
|
||||
}
|
||||
|
||||
// Standard rendering pass
|
||||
if ( bDrawStandardPass )
|
||||
{
|
||||
BlendType_t nBlendType = EvaluateBlendRequirements( BASETEXTURE, true );
|
||||
bool bFullyOpaque = (nBlendType != BT_BLENDADD) && (nBlendType != BT_BLEND) && !IS_FLAG_SET(MATERIAL_VAR_ALPHATEST); //dest alpha is free for special use
|
||||
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
|
||||
pShaderShadow->EnableSRGBRead( SHADER_SAMPLER0, true );
|
||||
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
|
||||
pShaderShadow->EnableSRGBRead( SHADER_SAMPLER1, true );
|
||||
|
||||
s_pShaderShadow->EnableSRGBWrite( true );
|
||||
|
||||
// Either we've got a constant modulation or we've got a texture alpha on either texture
|
||||
if ( IsAlphaModulating() || IS_FLAG_SET( MATERIAL_VAR_TRANSLUCENT ) || TextureIsTranslucent( BASETEXTURE, true ) || TextureIsTranslucent( TEXTURE2, true ) )
|
||||
{
|
||||
if ( IS_FLAG_SET(MATERIAL_VAR_ADDITIVE) )
|
||||
{
|
||||
EnableAlphaBlending( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE );
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableAlphaBlending( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IS_FLAG_SET(MATERIAL_VAR_ADDITIVE) )
|
||||
{
|
||||
EnableAlphaBlending( SHADER_BLEND_ONE, SHADER_BLEND_ONE );
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableAlphaBlending( );
|
||||
}
|
||||
}
|
||||
|
||||
// Set stream format (note that this shader supports compression)
|
||||
unsigned int flags = VERTEX_POSITION | VERTEX_NORMAL | VERTEX_FORMAT_COMPRESSED;
|
||||
int nTexCoordCount = 1;
|
||||
int userDataSize = 0;
|
||||
if (IS_FLAG_SET( MATERIAL_VAR_VERTEXCOLOR ))
|
||||
{
|
||||
flags |= VERTEX_COLOR;
|
||||
}
|
||||
pShaderShadow->VertexShaderVertexFormat( flags, nTexCoordCount, NULL, userDataSize );
|
||||
|
||||
// If this is set, blend with the alpha channels of the textures and modulation color
|
||||
bool bTranslucent = IsAlphaModulating() || IS_FLAG_SET( MATERIAL_VAR_TRANSLUCENT ) || TextureIsTranslucent( BASETEXTURE, true ) || TextureIsTranslucent( TEXTURE2, true );
|
||||
|
||||
DECLARE_STATIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
SET_STATIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( sdk_unlittwotexture_ps20b );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( TRANSLUCENT, bTranslucent );
|
||||
SET_STATIC_PIXEL_SHADER( sdk_unlittwotexture_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_STATIC_PIXEL_SHADER( sdk_unlittwotexture_ps20 );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( TRANSLUCENT, bTranslucent );
|
||||
SET_STATIC_PIXEL_SHADER( sdk_unlittwotexture_ps20 );
|
||||
}
|
||||
|
||||
DefaultFog();
|
||||
|
||||
pShaderShadow->EnableAlphaWrites( bFullyOpaque );
|
||||
}
|
||||
DYNAMIC_STATE
|
||||
{
|
||||
BindTexture( SHADER_SAMPLER0, BASETEXTURE, FRAME );
|
||||
BindTexture( SHADER_SAMPLER1, TEXTURE2, FRAME2 );
|
||||
SetVertexShaderTextureTransform( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, BASETEXTURETRANSFORM );
|
||||
SetVertexShaderTextureTransform( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, TEXTURE2TRANSFORM );
|
||||
SetModulationPixelShaderDynamicState_LinearColorSpace( 1 );
|
||||
|
||||
pShaderAPI->SetPixelShaderFogParams( PSREG_FOG_PARAMS );
|
||||
|
||||
float vEyePos_SpecExponent[4];
|
||||
pShaderAPI->GetWorldSpaceCameraPosition( vEyePos_SpecExponent );
|
||||
vEyePos_SpecExponent[3] = 0.0f;
|
||||
pShaderAPI->SetPixelShaderConstant( PSREG_EYEPOS_SPEC_EXPONENT, vEyePos_SpecExponent, 1 );
|
||||
|
||||
int numBones = pShaderAPI->GetCurrentNumBones();
|
||||
|
||||
DECLARE_DYNAMIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, numBones > 0 );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
|
||||
SET_DYNAMIC_VERTEX_SHADER_COMBO( COMPRESSED_VERTS, (int)vertexCompression );
|
||||
SET_DYNAMIC_VERTEX_SHADER( sdk_unlittwotexture_vs20 );
|
||||
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( sdk_unlittwotexture_ps20b );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bFullyOpaque && pShaderAPI->ShouldWriteDepthToDestAlpha() );
|
||||
SET_DYNAMIC_PIXEL_SHADER( sdk_unlittwotexture_ps20b );
|
||||
}
|
||||
else
|
||||
{
|
||||
DECLARE_DYNAMIC_PIXEL_SHADER( sdk_unlittwotexture_ps20 );
|
||||
SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() );
|
||||
SET_DYNAMIC_PIXEL_SHADER( sdk_unlittwotexture_ps20 );
|
||||
}
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Skip this pass!
|
||||
Draw( false );
|
||||
}
|
||||
|
||||
// Cloak Pass
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() )
|
||||
{
|
||||
// If ( snapshotting ) or ( we need to draw this frame )
|
||||
if ( ( pShaderShadow != NULL ) || ( ( params[CLOAKFACTOR]->GetFloatValue() > 0.0f ) && ( params[CLOAKFACTOR]->GetFloatValue() < 1.0f ) ) )
|
||||
{
|
||||
CloakBlendedPassVars_t info;
|
||||
SetupVarsCloakBlendedPass( info );
|
||||
DrawCloakBlendedPass( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
|
||||
}
|
||||
else // We're not snapshotting and we don't need to draw this frame
|
||||
{
|
||||
// Skip this pass!
|
||||
Draw( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
END_SHADER
|
||||
41
sp/src/materialsystem/stdshaders/vortwarp_vs20_helper.h
Normal file
41
sp/src/materialsystem/stdshaders/vortwarp_vs20_helper.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "common_vs_fxc.h"
|
||||
|
||||
float Sine( float min, float max, float t )
|
||||
{
|
||||
return ( sin( t ) * 0.5f + 0.5f ) * ( max - min ) + min;
|
||||
}
|
||||
|
||||
float3 QuadraticBezier( float3 A, float3 B, float3 C, float t )
|
||||
{
|
||||
return lerp( lerp( A, B, t ), lerp( B, C, t ), t );
|
||||
}
|
||||
|
||||
float3 CubicBezier( float3 A, float3 B, float3 C, float3 D, float t )
|
||||
{
|
||||
return QuadraticBezier( lerp( A, B, t ), lerp( B, C, t ), lerp( C, D, t ), t );
|
||||
}
|
||||
|
||||
void WorldSpaceVertexProcess( in float time, in float3 modelOrigin, inout float3 worldPos, inout float3 worldNormal, inout float3 worldTangentS, inout float3 worldTangentT )
|
||||
{
|
||||
float myTime = time;
|
||||
myTime = saturate( 1.0f - myTime );
|
||||
myTime *= myTime;
|
||||
myTime *= myTime;
|
||||
myTime *= myTime;
|
||||
// worldPos.z += 72.0f * myTime;
|
||||
|
||||
// end
|
||||
float3 A = float3( 0.0f, 0.0f, 1.0f );
|
||||
float3 B = float3( 1.0f, 1.0f, 1.0f );
|
||||
float3 C = float3( 0.0f, 0.0f, 1.0f );
|
||||
float3 D = float3( 0.0f, 0.0f, 1.0f );
|
||||
// start
|
||||
|
||||
// float3 modelOrigin = float3( 70.0f, -14.0f, 0.0f );
|
||||
|
||||
float t = worldPos.z * ( 1.0f / ( 72.0f ) ); // about 72 inches tall
|
||||
t = saturate( t );
|
||||
float3 worldPosDelta = ( worldPos - modelOrigin ) * CubicBezier( A, B, C, D, t );
|
||||
worldPosDelta.z += Sine( 0.0f, 10.0, worldPos.z );
|
||||
worldPos = lerp( worldPos, worldPosDelta + modelOrigin, myTime );
|
||||
}
|
||||
Reference in New Issue
Block a user