1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-24 18:37:39 +00:00

logarithmic fog parameter (logfog)

This commit is contained in:
Zeno Rogue
2022-04-07 20:50:59 +02:00
parent 589d2dd72c
commit 8c0600d8fe
2 changed files with 8 additions and 1 deletions

View File

@@ -402,7 +402,10 @@ shared_ptr<glhr::GLprogram> write_shader(flagtype shader_flags) {
}
else if(distfun != "") {
have_vfogs = true;
vmain += "vFogs = (uFogBase - " + distfun + " / uFog);\n";
if(logfog)
vmain += "vFogs = uFogBase * exp(- " + distfun + " / uFog);\n";
else
vmain += "vFogs = clamp(uFogBase - " + distfun + " / uFog, 0.0, 1.0);\n";
vsh +=
"uniform mediump float uFog;\n"
"uniform mediump float uFogBase;\n";