diff --git a/shaders/colorizers/gradient.glsl b/shaders/colorizers/gradient.glsl index b379abd..65348f9 100644 --- a/shaders/colorizers/gradient.glsl +++ b/shaders/colorizers/gradient.glsl @@ -97,6 +97,7 @@ vec4 deriveTexturePixel(vec2 coord, float nrmRe, float nrmIm) void main() { vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; // Get diffuse color from palette image vec3 diffuseColor = deriveColor(coord); diff --git a/shaders/illuminators/lambert.glsl b/shaders/illuminators/lambert.glsl index 5894e99..b146f91 100644 --- a/shaders/illuminators/lambert.glsl +++ b/shaders/illuminators/lambert.glsl @@ -79,6 +79,7 @@ vec3 makeSpatial(vec3 color, float nrmRe, float nrmIm) void main() { vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; // Get color pixel vec3 diffuseColor = texture2D(image, coord).rgb; diff --git a/shaders/illuminators/normalmap.glsl b/shaders/illuminators/normalmap.glsl index de541d8..5ee90b4 100644 --- a/shaders/illuminators/normalmap.glsl +++ b/shaders/illuminators/normalmap.glsl @@ -18,6 +18,7 @@ float decode_float(vec4 v) void main() { vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; // Get the normal vector float nrmRe = decode_float(texture2D(normalRe, coord)); diff --git a/shaders/illuminators/relief.glsl b/shaders/illuminators/relief.glsl index 4917afd..98cb874 100644 --- a/shaders/illuminators/relief.glsl +++ b/shaders/illuminators/relief.glsl @@ -39,15 +39,12 @@ vec3 makeSpatial(float nrmRe, float nrmIm) void main() { vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; // Get the normal vector float nrmRe = decode_float(texture2D(normalRe, coord)); float nrmIm = decode_float(texture2D(normalIm, coord)); - // Normalize - vec3 N = normalize(vec3(nrmRe, nrmIm, 1.0)); - vec3 L = normalize(lightDir); - // Apply 3D effect vec3 final = makeSpatial(nrmRe, nrmIm); diff --git a/shaders/scalers/bicubic.glsl b/shaders/scalers/bicubic.glsl index eef6ca1..27df0c2 100644 --- a/shaders/scalers/bicubic.glsl +++ b/shaders/scalers/bicubic.glsl @@ -63,7 +63,10 @@ vec4 bicubic(sampler2D sampler, vec2 texCoords) void main() { - vec2 coord = zoomed(gl_TexCoord[0].xy); + vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; + coord = zoomed(coord); + vec4 color1 = bicubic(curr, coord); gl_FragColor = gl_Color * color1; } diff --git a/shaders/scalers/bilinear.glsl b/shaders/scalers/bilinear.glsl index 5e154b2..a20195f 100644 --- a/shaders/scalers/bilinear.glsl +++ b/shaders/scalers/bilinear.glsl @@ -40,7 +40,10 @@ vec4 bilinear(sampler2D sampler, vec2 coord) void main() { - vec2 coord = zoomed(gl_TexCoord[0].xy); + vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; + coord = zoomed(coord); + vec4 color1 = bilinear(curr, coord); gl_FragColor = gl_Color * color1; } diff --git a/shaders/scalers/nearest.glsl b/shaders/scalers/nearest.glsl index 4499077..3d1a293 100644 --- a/shaders/scalers/nearest.glsl +++ b/shaders/scalers/nearest.glsl @@ -10,7 +10,10 @@ vec2 zoomed(vec2 coord) void main() { - vec2 coord = zoomed(gl_TexCoord[0].xy); + vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; + coord = zoomed(coord); + vec4 pixel = texture2D(curr, coord); gl_FragColor = gl_Color * pixel; } diff --git a/shaders/scalers/tricubic.glsl b/shaders/scalers/tricubic.glsl index f2a5d05..60efa6b 100644 --- a/shaders/scalers/tricubic.glsl +++ b/shaders/scalers/tricubic.glsl @@ -65,7 +65,10 @@ vec4 bicubic(sampler2D sampler, vec2 texCoords) void main() { // Read texel from the current texture - vec2 coord = zoomed(gl_TexCoord[0].xy); + vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; + coord = zoomed(coord); + vec4 color1 = bicubic(curr, coord); // Check if a corresponding texel exists in the next texture diff --git a/shaders/scalers/trilinear.glsl b/shaders/scalers/trilinear.glsl index 427ae0a..16ecff6 100644 --- a/shaders/scalers/trilinear.glsl +++ b/shaders/scalers/trilinear.glsl @@ -38,7 +38,10 @@ vec4 bilinear(sampler2D sampler, vec2 coord) void main() { // Read texel from the current texture - vec2 coord = zoomed(gl_TexCoord[0].xy); + vec2 coord = gl_TexCoord[0].xy; + coord.y = 1.0 - coord.y; + coord = zoomed(coord); + vec4 color1 = bilinear(curr, coord); if (zoom > 1.0) { diff --git a/src/ddrill/Driller.cpp b/src/ddrill/Driller.cpp index 12abbda..0581243 100644 --- a/src/ddrill/Driller.cpp +++ b/src/ddrill/Driller.cpp @@ -429,14 +429,20 @@ Driller::drill(const Coord &point, std::vector &glitchPoints) while (++iteration < limit) { + // auto two_xn_plus_dn = ref.xn[iteration - 1].extended2 + dn; + // auto two_xn_plus_two_two_dn = two_xn_plus_dn + dn; + dercn *= ref.xn[iteration - 1].extended2 + (dn * 2.0); + // dercn *= two_xn_plus_two_two_dn; dercn += derc0; dercn.reduce(); derzn *= ref.xn[iteration - 1].extended2 + (dn * 2.0); + // derzn *= two_xn_plus_two_two_dn; derzn.reduce(); dn *= ref.xn[iteration - 1].extended2 + dn; + // dn *= two_xn_plus_dn; dn += d0; dn.reduce(); diff --git a/src/shared/DrillMap.cpp b/src/shared/DrillMap.cpp index a3e8c4e..2a0a1ed 100644 --- a/src/shared/DrillMap.cpp +++ b/src/shared/DrillMap.cpp @@ -726,8 +726,8 @@ DrillMap::loadChannel(Compressor &is) for (isize y = 0; y < height; y++) { for (isize x = 0; x < width; x++) { - normalReMap[y * width + x] = double(loadFloat()); - normalImMap[y * width + x] = double(loadFloat()); + normalReMap[y * width + x] = float(loadFloat()); + normalImMap[y * width + x] = float(loadFloat()); } } break; diff --git a/src/shared/Filter.h b/src/shared/Filter.h index a79ded3..a2ad954 100644 --- a/src/shared/Filter.h +++ b/src/shared/Filter.h @@ -42,7 +42,6 @@ class Filter { public: - // Filter(const Options &opt) : opt(opt) { }; void init(const string &shaderName, isize w, isize h); void init(const string &shaderName, sf::Vector2u resolution);