diff --git a/CMakeLists.txt b/CMakeLists.txt index 259fdd2a4a7b87628edfe024dd0b2ee1f871b629..ec25eb2a7c6659d51707c6ee52031b36b9ac258e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,6 +280,9 @@ if (GLCV_FULL_BUILD) render_still(wn-exp-rnd-08 png_gray png ${SAMPLES_DIR}/wn_zoom.ini 5 "-Dphi=phi_linear;-Dai_fun=ai_fun_exp;-Dpos_fun=pos_fun_rnd;-Dhmin=.2500;-W512" ${WN_DEPS}) render_still(wn-exp-rnd-04 png_gray png ${SAMPLES_DIR}/wn_zoom.ini 5 "-Dphi=phi_linear;-Dai_fun=ai_fun_exp;-Dpos_fun=pos_fun_rnd;-Dhmin=.5000;-W512" ${WN_DEPS}) + render_still(wn-exp-def-16-noradial png_gray png ${SAMPLES_DIR}/wn_zoom_noradial.ini 5 "-Dphi=phi_linear;-Dai_fun=ai_fun_exp;-Dpos_fun=pos_fun_def;-Dhmin=.1250;-W512" ${WN_DEPS}) + render_still(wn-exp-def-08-noradial png_gray png ${SAMPLES_DIR}/wn_zoom_noradial.ini 5 "-Dphi=phi_linear;-Dai_fun=ai_fun_exp;-Dpos_fun=pos_fun_def;-Dhmin=.2500;-W512" ${WN_DEPS}) + add_custom_target(stills DEPENDS ${STILLS_OUTPUTS}) if (OLD_RENDER_DIRECTORY) set(CMD "([ ! -e ${OLD_RENDER_DIRECTORY} ] && ln -fs ${RENDER_DIRECTORY} ${OLD_RENDER_DIRECTORY}) | true") diff --git a/samples/wn_zoom_noradial.fsh b/samples/wn_zoom_noradial.fsh new file mode 100644 index 0000000000000000000000000000000000000000..3e3970e771f84d6c7199d80ab4d07f21ddd6318c --- /dev/null +++ b/samples/wn_zoom_noradial.fsh @@ -0,0 +1,50 @@ +float corr(in vec2 x1, in vec2 x2) { + return (phi(x1, x2)-mu2)/(sqrt(phi(x1, x1)-mu2)*sqrt(phi(x2, x2)-mu2)); +} + +vec4 nrm(vec4 x, float sr2) +{ + float so2 = sigma_f2; + + float nc = mu2 - 2.*mu3 + mu4 - sr2 + 3.*mu*sr2 - 3.*mu2*sr2; + float b = -(-2.*mu2 + 3.*mu3 - mu4 + 3.*mu2*sr2 + mu2*sqrt(so2/sr2) - mu3*sqrt(so2/sr2) + sr2*sqrt(so2/sr2) - 3.*mu*sr2*sqrt(so2/sr2)), + c = -(mu - mu3 - 3.*mu*sr2 - mu*sqrt(so2/sr2) + mu3*sqrt(so2/sr2) + 3.*mu*sr2*sqrt(so2/sr2)), + d = -(-mu + mu2 + sr2 + mu*sqrt(so2/sr2) - mu2*sqrt(so2/sr2) - sr2*sqrt(so2/sr2)); + + return x/nc*(b+x*(c+x*d)); +} + +float var(in vec2 x) { + return phi(x, x) - mu2; +} + +void mainImage(out vec4 O, in vec2 U) +{ + // screen-centered coordinates + vec2 uv = (U.xy / iResolution.xy - .5); + + O = vec4(0.); + float barLen = 7.; + if (uv.x > 0. && uv.y > 0.) { + if (uv.x < barLen / iResolution.x && + (uv.y > 0. ? (mod(uv.y * iResolution.y / 2., 10.) < 1.) + : (mod(((-5.+uv.y)*iResolution.y - 4.) / 2., 10.) < 1.)) || + uv.y > 0. && uv.y < barLen / iResolution.y && + (mod(uv.x * iResolution.x / 2., 10.) < 1.) || + uv.y*iResolution.y < -.5*iResolution.y+barLen && + (mod(uv.x * iResolution.x / 2., 10.) < 1.)) + { + O = vec4(0.); + } + else + { + if (uv.y > 0.) + { + O = vec4(corr(vec2(uv.x*iResolution.x, 0.), uv*iResolution.xy)); + } + + O = 1. - O; + } + + } +} diff --git a/samples/wn_zoom_noradial.ini b/samples/wn_zoom_noradial.ini new file mode 100644 index 0000000000000000000000000000000000000000..7d7b75a3b54022c710feee29ec4f5412d41d22d1 --- /dev/null +++ b/samples/wn_zoom_noradial.ini @@ -0,0 +1,7 @@ +[image] +shader = ../configs/np_def.fsh;wn_zoom_noradial.fsh + +[image.0] +type = noise +filter = linear +