Update pixelZoomShader.frag

This commit is contained in:
YoshiCrafter29
2022-12-16 14:02:34 +01:00
committed by GitHub
parent cd73a0a123
commit bf273e74a7
+5 -2
View File
@@ -1,11 +1,14 @@
#pragma header
uniform float pixelZoom;
// zooms the game 6 times
// how it works
// - takes the camera
// - unzooms it to make it pixel perfect and align every pixel
// - zooms in the result using this shader
void main() {
vec2 camPos = getCamPos(openfl_TextureCoordv);
camPos = vec2(0.5, 0.5) + ((camPos - vec2(0.5, 0.5)) * pixelZoom);
gl_FragColor = textureCam(bitmap, camPos);
}
}