This commit is contained in:
Zeno Rogue 2020-04-29 15:15:18 +02:00
parent 39f82e55ba
commit a6a0995e85
2 changed files with 25 additions and 3 deletions

View File

@ -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));"

View File

@ -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<glhr::GLprogram> 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<glhr::GLprogram> selected;