-csm_ortho now have description.
-fixed depth bias problem.
-added csm_second_intensity convar.
-maybe fixed angle problems.
This commit is contained in:
2022-09-03 14:04:27 +03:00
parent 0ed9d055cd
commit 4588e41ffc
2 changed files with 10 additions and 7 deletions
+4 -3
View File
@@ -22,13 +22,15 @@ static ConVarRef mat_slopescaledepthbias_shadowmap("mat_slopescaledepthbias_shad
static ConVarRef mat_depthbias_shadowmap("mat_depthbias_shadowmap"); static ConVarRef mat_depthbias_shadowmap("mat_depthbias_shadowmap");
static ConVar scissor("r_flashlightscissor", "0"); 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_nearz("csm_ortho_nearz", "512");
ConVar csm_ortho_left("csm_ortho_left", "-1000"); ConVar csm_ortho_left("csm_ortho_left", "-1000");
ConVar csm_ortho_top("csm_ortho_top", "-1000"); ConVar csm_ortho_top("csm_ortho_top", "-1000");
ConVar csm_ortho_bottom("csm_ortho_bottom", "1000"); ConVar csm_ortho_bottom("csm_ortho_bottom", "1000");
ConVar csm_ortho_right("csm_ortho_right", "1000"); ConVar csm_ortho_right("csm_ortho_right", "1000");
//ConVar csm_test_color_interpolation("csm_test_color_interpolation","0"); //ÿ íå ïîìíþ ÷òî îíà äåëàåò, íî îíà îïðåäåë¸ííî ýòîãî íå äåëàåò //ConVar csm_test_color_interpolation("csm_test_color_interpolation","0"); //ÿ íå ïîìíþ ÷òî îíà äåëàåò, íî îíà îïðåäåë¸ííî ýòîãî íå äåëàåò
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: main point for change angle of the light // Purpose: main point for change angle of the light
@@ -66,8 +68,7 @@ void C_LightOrigin::Simulate()
BaseClass::Simulate(); BaseClass::Simulate();
} }
const char* filter = CommandLine()->ParmValue("-ptfilter", "0.5"); ConVar bebra("csm_filter", "1");
ConVar bebra("csm_filter", filter);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: main csm code // Purpose: main csm code
+6 -4
View File
@@ -350,7 +350,7 @@ CEnvCascadeLight::CEnvCascadeLight(void)
m_flFarZ = 16000.0f; m_flFarZ = 16000.0f;
m_nShadowQuality = 0; m_nShadowQuality = 0;
} }
ConVar csm_second_intensity("csm_second_intensity", "2");
void CEnvCascadeLight::Preparation() void CEnvCascadeLight::Preparation()
{ {
CreateEntityByName("csmorigin"); CreateEntityByName("csmorigin");
@@ -371,11 +371,12 @@ void CEnvCascadeLight::Preparation()
//if second csm is exist //if second csm is exist
if (CSMSecond) if (CSMSecond)
{ {
CEnvCascadeLightSecond* SecondCSM = dynamic_cast<CEnvCascadeLightSecond*>(CSMSecond); CEnvCascadeLightSecond* SecondCSM = dynamic_cast<CEnvCascadeLightSecond*>(CSMSecond);
SecondCSM->SetAbsAngles(GetAbsAngles()); SecondCSM->SetAbsAngles(GetAbsAngles());
SecondCSM->SetAbsOrigin(GetAbsOrigin()); SecondCSM->SetAbsOrigin(GetAbsOrigin());
SecondCSM->SetParent(GetBaseEntity()); SecondCSM->SetParent(GetBaseEntity());
SecondCSM->m_LinearFloatLightColor = m_LinearFloatLightColor; SecondCSM->m_LinearFloatLightColor = m_LinearFloatLightColor * csm_second_intensity.GetFloat();
DispatchSpawn(SecondCSM); DispatchSpawn(SecondCSM);
} }
@@ -391,7 +392,7 @@ void CEnvCascadeLight::Preparation()
} }
else 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); 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(); float bibigon = defdist.GetFloat() / curdist.GetFloat();
curFOV.SetValue(defFOV.GetFloat() * bibigon); curFOV.SetValue(defFOV.GetFloat() * bibigon);
m_flLightFOV = curFOV.GetFloat(); m_flLightFOV = curFOV.GetFloat();
//DispatchSpawn(CSMSecond);
DispatchSpawn(CSMOrigin); DispatchSpawn(CSMOrigin);
} }
else else