From 0bdc52796f9a6b288b551fc7b5ced42643fc80df Mon Sep 17 00:00:00 2001 From: pierow Date: Thu, 29 Feb 2024 01:33:35 -0500 Subject: [PATCH] presets and postprocessing update --- main/32av.cfg | 3 ++- main/33av.cfg | 3 ++- main/compav.cfg | 3 ++- main/shaders/fs.shaders | 9 ++++----- main/source/cl_dll/input.cpp | 21 ++++++++++++--------- main/source/mod/AvHHud.cpp | 13 +++++++------ main/source/mod/AvHHudRender.cpp | 8 ++++---- 7 files changed, 33 insertions(+), 27 deletions(-) diff --git a/main/32av.cfg b/main/32av.cfg index e7f77f62..d0f6259e 100644 --- a/main/32av.cfg +++ b/main/32av.cfg @@ -2,7 +2,8 @@ brightness "1" gamma "2.5" lightgamma "2.5" -cl_shader "1" +cl_postprocess "1" +cl_intensity "1" // Bobbing cl_bob "0.01" diff --git a/main/33av.cfg b/main/33av.cfg index 4af1eb91..b59219a6 100644 --- a/main/33av.cfg +++ b/main/33av.cfg @@ -2,7 +2,8 @@ brightness "0" gamma "2.5" lightgamma "1.81" -cl_shader "1" +cl_postprocess "1" +cl_intensity "1" // Bobbing cl_bob "0.006" diff --git a/main/compav.cfg b/main/compav.cfg index 8bc185b8..a8d261c2 100644 --- a/main/compav.cfg +++ b/main/compav.cfg @@ -2,7 +2,8 @@ brightness "2" gamma "3" lightgamma "2" -cl_shader "0" +cl_postprocess "0" +cl_intensity "0" // No bobbing cl_bob "0" diff --git a/main/shaders/fs.shaders b/main/shaders/fs.shaders index aad9f9fa..10f99827 100644 --- a/main/shaders/fs.shaders +++ b/main/shaders/fs.shaders @@ -7,9 +7,8 @@ uniform sampler2D textureSampler; uniform float colorMultiplier; // Uniform float to multiply color by void main() { - // Sample the texture - vec4 texColor = texture(textureSampler, texCoord); - - // Multiply the color by the uniform float - fragColor = texColor * colorMultiplier; + // Sample the texture + vec4 texColor = texture(textureSampler, texCoord); + // Multiply the color + fragColor = vec4(texColor.rgb * colorMultiplier, 1.0f); } diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp index 9df85169..f7efee84 100644 --- a/main/source/cl_dll/input.cpp +++ b/main/source/cl_dll/input.cpp @@ -1547,9 +1547,10 @@ void NsPreset(void) if (printToChat) { // Localize later. - //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset1")); - snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Classic NS audio/visual presets applied. See console for details."); - gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset1")); + snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Classic NS audio/visual presets applied. Left click once to fix bug. See console for details."); + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + ClientCmd("echo \"NOTE: Left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order. } else { @@ -1562,9 +1563,10 @@ void NsPreset(void) if (printToChat) { // Localize later. - //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset2")); - snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "NS 3.3 audio/visual presets applied. See console for details."); - gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset2")); + snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "NS 3.3 audio/visual presets applied. Left click once to fix bug. See console for details. "); + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + ClientCmd("echo \"NOTE: Left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order. } else { @@ -1577,9 +1579,10 @@ void NsPreset(void) if (printToChat) { // Localize later. - //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset3")); - snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Competive audio/visual presets applied. See console for details."); - gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + //sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset3")); + snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Competive audio/visual presets applied. Left click once to fix bug. See console for details."); + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText); + ClientCmd("echo \"NOTE: Left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order. } else { diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index d748459c..6a73766e 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -4929,10 +4929,11 @@ void AvHHud::InitExploitPrevention() { ForceCvar("r_detailtextures", r_detailtextures, 0.0f); ForceCvar("gl_max_size", gl_max_size, 512.0f); + //2024 - Lighting changes: lower min lightgamma to engine limit. Engine crashes below 1.81, so enforce the limit. //RemoveAlias("lightgamma"); - //if(lightgamma && lightgamma->value < 2.0) { - // ForceCvar("lightgamma", lightgamma, 2.0f); - //} + if(lightgamma && lightgamma->value < 1.81f) { + ForceCvar("lightgamma", lightgamma, 1.81f); + } //if(lightgamma && lightgamma->value > 5.0) { // ForceCvar("lightgamma", lightgamma, 5.0f); //} @@ -4964,9 +4965,9 @@ void AvHHud::UpdateExploitPrevention() if(lightgamma && lightgamma->value < 1.81f) { ForceCvar("lightgamma", lightgamma, 1.81f); } - if(lightgamma && lightgamma->value > 5.0) { - ForceCvar("lightgamma", lightgamma, 5.0f); - } + //if(lightgamma && lightgamma->value > 5.0) { + // ForceCvar("lightgamma", lightgamma, 5.0f); + //} if(texgamma && texgamma->value < 1.0) { ForceCvar("texgamma", texgamma, 1.0f); } diff --git a/main/source/mod/AvHHudRender.cpp b/main/source/mod/AvHHudRender.cpp index 729bd332..b388c5b2 100644 --- a/main/source/mod/AvHHudRender.cpp +++ b/main/source/mod/AvHHudRender.cpp @@ -2876,11 +2876,11 @@ void AvHHud::RenderShowSpeed() float theGroundSpeed = sqrtf(pmove->velocity[0] * pmove->velocity[0] + pmove->velocity[1] * pmove->velocity[1]); maxGroundSpeed = max(theGroundSpeed, maxGroundSpeed); - //sprintf(buffer, "Ground speed = %d (%d)", (int)theGroundSpeed, maxGroundSpeed); - //mFont.DrawString(10, 12 + mFont.GetStringHeight(), buffer, theR, theG, theB); + sprintf(buffer, "Ground speed = %d (%d)", (int)theGroundSpeed, maxGroundSpeed); + mFont.DrawString(10, 12 + mFont.GetStringHeight(), buffer, theR, theG, theB); - sprintf(buffer, "vangle0= %f vangle1= %f vangle2= %f)", pmove->angles[0], pmove->angles[1], pmove->angles[2]); - mFont.DrawString(10, 12 + mFont.GetStringHeight() * 2, buffer, theR, theG, theB); + //sprintf(buffer, "vangle0= %f vangle1= %f vangle2= %f)", pmove->angles[0], pmove->angles[1], pmove->angles[2]); + //mFont.DrawString(10, 12 + mFont.GetStringHeight() * 2, buffer, theR, theG, theB); speedMeasured = true; } else if (speedMeasured == true) {