mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
logarithmic fog parameter (logfog)
This commit is contained in:
parent
589d2dd72c
commit
8c0600d8fe
@ -492,6 +492,8 @@ EX const char *conffile = "hyperrogue.ini";
|
||||
/* extra space if more geometries are added */
|
||||
EX array<ld, gGUARD+64> sightranges;
|
||||
|
||||
EX bool logfog;
|
||||
|
||||
EX videopar vid;
|
||||
|
||||
#define DEFAULT_WALLMODE (ISMOBILE ? 3 : 5)
|
||||
@ -774,6 +776,8 @@ EX void initConfig() {
|
||||
|
||||
param_b(vid.darkhepta, "mark heptagons", false);
|
||||
|
||||
param_b(logfog, "logfog", false);
|
||||
|
||||
for(auto& lp: linepatterns::patterns) {
|
||||
addsaver(lp->color, "lpcolor-" + lp->lpname);
|
||||
addsaver(lp->multiplier, "lpwidth-" + lp->lpname);
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user