optimize spellcard_walloftext.frag.glsl a bit

This commit is contained in:
Andrei Alexeyev 2019-08-15 16:07:53 +03:00
parent 42b0c64851
commit 7aec3fd56d
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4

View file

@ -28,11 +28,11 @@ void main(void) {
// The complicated example I dont understand either:
pos.x *= h/w;
pos.x += t * 0.5 * float(2 * int(mod(pos.y, 2)) - 1);
pos.x += t * (floor(mod(pos.y, 2.0)) - 0.5);
pos = mod(pos, vec2(1 + 0.01 / w, 1));
pos = flip_topleft_to_native(pos);
pos *= vec2(w,h);
pos *= vec2(w, h);
vec4 texel = texture(tex, pos);
fragColor = vec4(texel.r) * float(pos.x < w && pos.y < h)*t*(2-t);
fragColor = vec4(texel.r) * t * (2 - t);
}