1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-13 09:48:04 +00:00

separate shader for stretched Sol, to avoid glitches

This commit is contained in:
Zeno Rogue
2019-10-04 13:03:50 +02:00
parent ac8b866978
commit ec465b2afc
3 changed files with 56 additions and 10 deletions

View File

@@ -534,6 +534,44 @@ EX namespace solnihv {
"return res;"
"}";
EX string shader_nsymsol = solnihv::common + R"*(
vec4 inverse_exp(vec4 h) {
float ix = h[0] >= 0. ? x_to_ix(h[0]) : x_to_ix(-h[0]);
float iy = h[1] >= 0. ? x_to_ix(h[1]) : x_to_ix(-h[1]);
float iz = (tanh(h[2]/4.)+1.) / 2.;
vec4 res;
float cx = ix*(1.-1./PRECX) + .5/PRECX;
float cy = iy*(1.-1./PRECY) + .5/PRECY;
float cz = iz*(1.-1./PRECZ) + .5/PRECZ;
if(ix > .65 && iy > .5 && iz > .45 && iz < .55)
res = vec4(0.,0.,0.,1.);
else if(ix > .55 && iy > .75 && ix < .7 && iz > .45 && iz < .55)
res = vec4(0.,0.,0.,1.);
else if(ix > .45 && iy > .75 && ix < .7 && iz > .4 && iz < .5)
res = vec4(0.,0.,0.,1.);
else if(ix > .85 && iy > .5 && iz > .55 && iz < .75)
res = vec4(0.,0.,0.,1.);
else if(ix > .7 && iy > .55 && iz > .42 && iz < .58)
res = vec4(0.,0.,0.,1.);
else if(iz > 0.45 && ix > 0.8 && iy > 0.3 && iy < 0.6)
res = vec4(0.,0.,0.,1.);
else if(iz > 0.45 && ix > 0.8 && iy > 0.3 && iy < 0.6)
res = vec4(0.,0.,0.,1.);
else if(iz > .4 && iz < .55 && ix > .7 && iy > .36 && iy < .5 && ix < .8 && ix+iy > 1.2)
res = vec4(0.,0.,0.,1.);
else res = texture3D(tInvExpTable, vec3(cx, cy, cz));
if(h[0] < 0.) res[0] = -res[0];
if(h[1] < 0.) res[1] = -res[1];
return res;
})*";
EX string shader_nsym = solnihv::common +
"vec4 inverse_exp(vec4 h) {"