materialsystem/stdshaders: restore original vertexlit_and_unlit_generic and skin shaders to work with steam resources( fixes #75 )

This commit is contained in:
nillerusr
2022-07-25 19:09:57 +03:00
parent 5e1ed3bd26
commit a26270cb57
16 changed files with 1724 additions and 3057 deletions
+9 -19
View File
@@ -24,8 +24,6 @@
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps30]
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b]
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps30]
// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..0" [ps20]
// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..1" [ps20b] [ps30] [PC]
// SKIP: ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0)
@@ -78,9 +76,7 @@ const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
const float4 g_FlashlightAttenuationFactors_RimMask : register( PSREG_FLASHLIGHT_ATTENUATION ); // On non-flashlight pass, x has rim mask control
const float4 g_FlashlightPos_RimBoost : register( PSREG_FLASHLIGHT_POSITION_RIM_BOOST );
#if FLASHLIGHT
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
#endif
const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE );
const float4 g_FresnelSpecParams : register( PSREG_FRESNEL_SPEC_PARAMS ); // xyz are fresnel, w is specular boost
const float4 g_SpecularRimParams : register( PSREG_SPEC_RIM_PARAMS ); // xyz are specular tint color, w is rim power
PixelShaderLightInfo cLightInfo[3] : register( PSREG_LIGHT_INFO_ARRAY ); // 2 registers each - 6 registers total (4th light spread across w's)
@@ -100,7 +96,6 @@ const float4 g_ShaderControls : register( PSREG_CONSTANT_27 ); // x is
#define g_fTintReplacementControl g_ShaderControls.z
#define g_fInvertPhongMask g_ShaderControls.w
sampler BaseTextureSampler : register( s0 ); // Base map, selfillum in alpha
sampler SpecularWarpSampler : register( s1 ); // Specular warp sampler (for iridescence etc)
sampler DiffuseWarpSampler : register( s2 ); // Lighting warp sampler (1D texture for diffuse lighting modification)
@@ -124,6 +119,7 @@ sampler DetailSampler : register( s13 ); // detail texture
sampler SelfIllumMaskSampler : register( s14 ); // selfillummask
struct PS_INPUT
{
float4 baseTexCoordDetailTexCoord : TEXCOORD0; // xy=base zw=detail
@@ -262,11 +258,7 @@ float4 main( PS_INPUT i ) : COLOR
[flatten]
#endif
#if ( PHONG_USE_EXPONENT_FACTOR )
fSpecExp = ( 1.0f + g_EyePos_SpecExponent.w * vSpecExpMap.r );
#else
fSpecExp = (g_EyePos_SpecExponent.w >= 0.0) ? g_EyePos_SpecExponent.w : (1.0f + 149.0f * vSpecExpMap.r);
#endif
// If constant tint is negative, tint with albedo, based upon scalar tint map
#if defined( _X360 )
@@ -294,17 +286,15 @@ float4 main( PS_INPUT i ) : COLOR
}
else
{
#if FLASHLIGHT
float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture );
float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture );
DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal,
g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w,
FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z,
fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks,
DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal,
g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w,
FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z,
fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks,
// These two values are output
diffuseLighting, specularLighting );
#endif
// These two values are output
diffuseLighting, specularLighting );
}
// If we didn't already apply Fresnel to specular warp, modulate the specular