From 4588e41ffc7dbd752925bc677a2f23f3d709d6db Mon Sep 17 00:00:00 2001 From: celisej567 Date: Sat, 3 Sep 2022 14:04:27 +0300 Subject: [PATCH] fixes -csm_ortho now have description. -fixed depth bias problem. -added csm_second_intensity convar. -maybe fixed angle problems. --- client/c_env_cascade_light.cpp | 7 ++++--- server/env_cascade_light.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client/c_env_cascade_light.cpp b/client/c_env_cascade_light.cpp index ead1bfc..616f674 100644 --- a/client/c_env_cascade_light.cpp +++ b/client/c_env_cascade_light.cpp @@ -22,13 +22,15 @@ static ConVarRef mat_slopescaledepthbias_shadowmap("mat_slopescaledepthbias_shad static ConVarRef mat_depthbias_shadowmap("mat_depthbias_shadowmap"); static ConVar scissor("r_flashlightscissor", "0"); -static ConVar csm_ortho("csm_ortho","0"); +#ifdef MAPBASE +static ConVar csm_ortho("csm_ortho","0", 0, "Turn light into ortho. Im lazy right now to make this works fine"); ConVar csm_ortho_nearz("csm_ortho_nearz", "512"); ConVar csm_ortho_left("csm_ortho_left", "-1000"); ConVar csm_ortho_top("csm_ortho_top", "-1000"); ConVar csm_ortho_bottom("csm_ortho_bottom", "1000"); ConVar csm_ortho_right("csm_ortho_right", "1000"); //ConVar csm_test_color_interpolation("csm_test_color_interpolation","0"); //я не помню что она делает, но она определённо этого не делает +#endif //----------------------------------------------------------------------------- // Purpose: main point for change angle of the light @@ -66,8 +68,7 @@ void C_LightOrigin::Simulate() BaseClass::Simulate(); } -const char* filter = CommandLine()->ParmValue("-ptfilter", "0.5"); -ConVar bebra("csm_filter", filter); +ConVar bebra("csm_filter", "1"); //----------------------------------------------------------------------------- // Purpose: main csm code diff --git a/server/env_cascade_light.cpp b/server/env_cascade_light.cpp index ae3d990..898170c 100644 --- a/server/env_cascade_light.cpp +++ b/server/env_cascade_light.cpp @@ -350,7 +350,7 @@ CEnvCascadeLight::CEnvCascadeLight(void) m_flFarZ = 16000.0f; m_nShadowQuality = 0; } - +ConVar csm_second_intensity("csm_second_intensity", "2"); void CEnvCascadeLight::Preparation() { CreateEntityByName("csmorigin"); @@ -371,11 +371,12 @@ void CEnvCascadeLight::Preparation() //if second csm is exist if (CSMSecond) { - CEnvCascadeLightSecond* SecondCSM = dynamic_cast(CSMSecond); + CEnvCascadeLightSecond* SecondCSM = dynamic_cast(CSMSecond); SecondCSM->SetAbsAngles(GetAbsAngles()); SecondCSM->SetAbsOrigin(GetAbsOrigin()); SecondCSM->SetParent(GetBaseEntity()); - SecondCSM->m_LinearFloatLightColor = m_LinearFloatLightColor; + SecondCSM->m_LinearFloatLightColor = m_LinearFloatLightColor * csm_second_intensity.GetFloat(); + DispatchSpawn(SecondCSM); } @@ -391,7 +392,7 @@ void CEnvCascadeLight::Preparation() } else { - pEnv->SetAbsAngles(QAngle(-(GetLocalAngles().x - 90), GetLocalAngles().y,-GetLocalAngles().z)); + pEnv->SetAbsAngles(QAngle(-(GetLocalAngles().x - 90), -GetLocalAngles().y,-GetLocalAngles().z)); Msg("pEnv local angle = %f %f %f \n", pEnv->GetLocalAngles().x, pEnv->GetLocalAngles().y, pEnv->GetLocalAngles().z); @@ -402,6 +403,7 @@ void CEnvCascadeLight::Preparation() float bibigon = defdist.GetFloat() / curdist.GetFloat(); curFOV.SetValue(defFOV.GetFloat() * bibigon); m_flLightFOV = curFOV.GetFloat(); + //DispatchSpawn(CSMSecond); DispatchSpawn(CSMOrigin); } else