diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 8757b840..d00d5caf 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -607,9 +607,25 @@ EX namespace sn { "float cz = iz*(1.-1./PRECZ) + .5/PRECZ;" // "if(ix > .5 && iy > .6 && ix < iy + .05 && iz < .2 && iz < (iy - 0.5) * 0.6)" - "if(ix > .65 + iz * .25 && iy > .55) res = vec4(0.,0.,0.,1.); " - - "else " + "\n#ifndef SOLV_ALL\n" + + "bool ok = true;" + + // hard to tell which triangles fall on the other sides + "if(iz < .03 && ix > .65 && iy > .65) ok = false;" + "if(iz < .013 && ix > .55 && iy > .55) ok = false;" + "if(iz < .0075 && ix > .45 && iy > .45) ok = false;" + "if(iz > 0.004 && ix > 0.4 && iy > 0.4 && ix < .6 && iy < .6) ok = true;" + "if(iz > 0.000004 && ix > 0.4 && ix < 0.7 && iy > 0.4 && iy < 0.7) ok = true;" + "if(iz < 0.04 && ix > 0.70 && ix < 0.8 && iy > 0.5 && iy < 0.7) ok = false;" + "if(iz < 0.05 && ix > .45 && iy > .75 && ix < .55 && iy < .95) ok = false;" + "if(iz < 0.05 && ix > .85 && iy > .45 && iy < .75) ok = false;" + "if(iz < 0.025 && ix > .65 && iy > .65 && ix < .8 && iy < .8) ok = false;" + + "if(!ok) res = vec4(0,0,0,1);" + "else " + + "\n#endif\n" "res = texture3D(tInvExpTable, vec3(cx, cy, cz));" diff --git a/shaders.cpp b/shaders.cpp index 1a64e84d..df43f377 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -32,6 +32,8 @@ constexpr flagtype SF_ZFOG = 65536; constexpr flagtype SF_ODSBOX = (1<<17); #endif +EX bool solv_all; + #if HDR /* standard attribute bindings */ /* taken from: https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/attributes.php */ @@ -189,6 +191,9 @@ shared_ptr write_shader(flagtype shader_flags) { case gcSolNIH: switch(sn::geom()) { case gSol: + if(solv_all) { + vsh += "\n#define SOLV_ALL\n"; + } vsh += sn::shader_symsol; break; case gNIH: @@ -320,6 +325,7 @@ void display_data::set_projection(int ed) { id <<= 6; id |= spherephase; id <<= 1; if(vid.consider_shader_projection) id |= 1; id <<= 2; id |= (spherespecial & 3); + if(sol && solv_all) id |= 1; if(in_h2xe()) id |= 1; if(in_s2xe()) id |= 2; shared_ptr selected;