Egy kis mozaik bugfix

This commit is contained in:
markojozsef
2026-09-26 15:34:55 +02:00
parent 7a62dc6ae0
commit fcc37089f0
3 changed files with 7 additions and 21 deletions

View File

@@ -1,16 +0,0 @@
#define RESOLUTION (1. / iResolution.xy)
#define MAX_MOSAIC 16.
#define SPEED 48.
#define FADEOUT_TIME 1.30
#define FADOUT_SPEED 3.
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord/iResolution.xy;
float mosaic = floor(((iTime * SPEED) < MAX_MOSAIC) ? iTime * SPEED : (iTime * SPEED) - MAX_MOSAIC) + 1.;
uv = floor(uv / RESOLUTION / mosaic) * RESOLUTION * mosaic;
// Output to screen
fragColor = texture(iChannel0,uv) * max(0., min(1., (FADEOUT_TIME * FADOUT_SPEED) - (iTime * FADOUT_SPEED)));
}

View File

@@ -12,9 +12,11 @@ m = []
def mos_1x(g):
g.mosaic = 1
g.mos_enabled = False
def mos_2x(g):
g.mosaic = 2
g.mosaic = 8
g.mos_enabled = True
def switch(game):
global m

View File

@@ -34,10 +34,10 @@ class TextureRenderer:
""",
fragment_shader="""
#version 330
#define INV_RESOLUTION_X (1. / screen_size.x)
#define INV_RESOLUTION_Y (1. / screen_size.y)
#define INV_RESOLUTION_X (1. / bounds.z)
#define INV_RESOLUTION_Y (1. / bounds.w)
uniform vec2 screen_size;
uniform vec4 bounds;
uniform sampler2D tex;
uniform float mosaic;
uniform bool mos_enabled;