Anyone able to convert this shader to C2?
https://github.com/uheartbeast/jitter-free-pixelart-scaling/blob/master/JitterFreePixelArt.shader
See what it does here:
This shader use standard derivatives not working for me in normal fx;
However i used shadertoy plugin ...
#extension GL_OES_standard_derivatives : enable
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord.xy / iResolution.xy;
vec2 size = vec2(iResolution.xy);
vec2 pixel = vec2(1.0) / size;
uv -= pixel * vec2(0.5);
vec2 uv_pixels = uv * size;
vec2 delta_pixel = fract(uv_pixels) - vec2(0.5);
vec2 ddxy = fwidth(uv_pixels )*3.5+sin(iTime)*9.0;
vec2 mip = log2(ddxy) - 0.5;
vec4 c1= texture2D(iChannel0, uv + (clamp(delta_pixel / ddxy, 0.0, 1.0) - delta_pixel) * pixel, min(mip.x, mip.y));
vec4 c2 = texture2D(iChannel0, uv); // debug
fragColor = vec4(c1);
}
you can copy past and try with this tool ...
http://gigatron3k.free.fr//html5/C2/plugin/st/