diff options
Diffstat (limited to 'internal_rewrite/chams.cpp')
| -rw-r--r-- | internal_rewrite/chams.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/internal_rewrite/chams.cpp b/internal_rewrite/chams.cpp index c50e40e..1d46bb2 100644 --- a/internal_rewrite/chams.cpp +++ b/internal_rewrite/chams.cpp @@ -18,13 +18,14 @@ static auto chams_mat = xors_raw( ( "$flat" "1"
"$envmap" "env_cubemap"
"$envmaptint" "[.3 .3 .3]"
- "$envmapcontrast" ".4"
+ "$envmapcontrast" "1"
"$envmapsaturation" "1.0"
- "$phongexponent" "255.0"
+ "$phong" "1"
+ "$phongexponent" "15.0"
"$normalmapalphaenvmask" "1"
"$phongboost" "6.0"
- "$phongfresnelranges" "[0 0.5 1]"
- "$BasemapAlphaPhongMask" "1"
+ "$phongfresnelranges" "[.5 .5 1]"
+ "$BasemapAlphaPhongMask" "1"
})"
) );
@@ -73,7 +74,7 @@ namespace features sprintf_s( buf, len - 1, chams_mat_flat.decrypt( ) );
break;
case 2:
- sprintf_s( buf, len - 1, chams_mat_shine.decrypt( ) );
+ sprintf_s( buf, len - 1, chams_mat.decrypt( ) );
break;
default:
sprintf_s( buf, len - 1, chams_mat.decrypt( ) );
@@ -136,8 +137,10 @@ namespace features static float last_reflectivity{ };
static float last_shine{ };
+ static float last_luminance{ };
static KeyValues* reflectivity;
static KeyValues* shine;
+ static KeyValues* luminance;
if( !reflectivity ) {
for( auto it = m_chams.m_keyvalues->m_pSub; !!it; it = it->m_pPeer ) {
@@ -155,6 +158,14 @@ namespace features }
}
+ if( !luminance ) {
+ for( auto it = m_chams.m_keyvalues->m_pSub; !!it; it = it->m_pPeer ) {
+ if( it->m_flValue == 15.0f ) {
+ luminance = it;
+ }
+ }
+ }
+
if( reflectivity ) {
if( last_reflectivity != g_settings.visuals.chams.reflectivity( ) ) {
char buf[ 32 ];
@@ -171,11 +182,22 @@ namespace features if( shine ) {
if( last_shine != g_settings.visuals.chams.shine( ) ) {
- shine->m_flValue = g_settings.visuals.chams.shine( ) * 100.f;
+ shine->m_flValue = g_settings.visuals.chams.shine( ) * 3.f;
m_chams.m_mat->Refresh( );
}
last_shine = g_settings.visuals.chams.shine( );
}
+
+ if( luminance ) {
+ if( last_luminance != g_settings.visuals.chams.luminance( ) ) {
+ if( g_settings.visuals.chams.luminance == 0.f )
+ luminance->m_flValue = 0.f;
+ else
+ luminance->m_flValue = ( 1.05f - g_settings.visuals.chams.luminance( ) ) * 10.f;
+ m_chams.m_mat->Refresh( );
+ }
+ last_luminance = g_settings.visuals.chams.luminance( );
+ }
}
void c_chams::d3d_render_chams( c_base_player* ent, int type, int v_index, uint32_t min_index, uint32_t num_vert, uint32_t start_index, uint32_t prim_count ) {
|
