mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-05 22:09:59 +03:00
Revert "materialsystem/shaderapidx9: restore shaders from source-sdk-2013"
This reverts commit cca56d5a6f.
This commit is contained in:
@@ -112,26 +112,6 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
bool bTranslucentNormal = pShader->TextureIsTranslucent( info.m_nNormalMap, false );
|
||||
bFullyOpaque &= (! bTranslucentNormal );
|
||||
|
||||
NormalDecodeMode_t nNormalDecodeMode = NORMAL_DECODE_NONE;
|
||||
if ( g_pHardwareConfig->SupportsNormalMapCompression() )
|
||||
{
|
||||
ITexture *pBumpTex = params[info.m_nNormalMap]->GetTextureValue();
|
||||
if ( pBumpTex )
|
||||
{
|
||||
nNormalDecodeMode = pBumpTex->GetNormalDecodeMode();
|
||||
|
||||
if ( bSecondaryNormal ) // Check encoding of secondary normal if there is one
|
||||
{
|
||||
ITexture *pBumpTex2 = params[info.m_nNormalMap2]->GetTextureValue();
|
||||
if ( pBumpTex2 && ( pBumpTex2->GetNormalDecodeMode() != nNormalDecodeMode ) )
|
||||
{
|
||||
DevMsg("Refract: Primary and Secondary normal map compression formats don't match. This is unsupported!\n");
|
||||
Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SHADOW_STATE
|
||||
{
|
||||
pShader->SetInitialShadowState( );
|
||||
@@ -154,19 +134,9 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
|
||||
// normal map
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER3, true );
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER6, true ); // Normal map alpha, in the compressed normal case
|
||||
}
|
||||
|
||||
if ( bSecondaryNormal )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
|
||||
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShaderShadow->EnableTexture( SHADER_SAMPLER7, true ); // Secondary normal map alpha, in the compressed normal case
|
||||
}
|
||||
}
|
||||
|
||||
if( bHasEnvmap )
|
||||
@@ -223,7 +193,7 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MASKED, bMasked );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( COLORMODULATE, bColorModulate );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SECONDARY_NORMAL, bSecondaryNormal );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SHADER_SRGB_READ, bShaderSRGBConvert );
|
||||
SET_STATIC_PIXEL_SHADER( refract_ps20b );
|
||||
}
|
||||
@@ -237,7 +207,7 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( MASKED, bMasked );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( COLORMODULATE, bColorModulate );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( SECONDARY_NORMAL, bSecondaryNormal );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) nNormalDecodeMode );
|
||||
SET_STATIC_PIXEL_SHADER_COMBO( NORMAL_DECODE_MODE, (int) NORMAL_DECODE_NONE );
|
||||
SET_STATIC_PIXEL_SHADER( refract_ps20 );
|
||||
}
|
||||
pShader->DefaultFog();
|
||||
@@ -262,25 +232,11 @@ void DrawRefract_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDyna
|
||||
pShaderAPI->BindStandardTexture( SHADER_SAMPLER2, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 );
|
||||
}
|
||||
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER3, SHADER_SAMPLER6, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER3, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
}
|
||||
pShader->BindTexture( SHADER_SAMPLER3, info.m_nNormalMap, info.m_nBumpFrame );
|
||||
|
||||
if ( bSecondaryNormal )
|
||||
{
|
||||
if ( nNormalDecodeMode == NORMAL_DECODE_ATI2N_ALPHA )
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER1, SHADER_SAMPLER7, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pShader->BindTexture( SHADER_SAMPLER1, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
pShader->BindTexture( SHADER_SAMPLER1, info.m_nNormalMap2, info.m_nBumpFrame2 );
|
||||
}
|
||||
|
||||
if( bHasEnvmap )
|
||||
|
||||
Reference in New Issue
Block a user