From 6d3fc5b8cbbe2fd1c7c72b3183e5ec4e4a1cdbc2 Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Wed, 13 Oct 2021 08:40:36 +0200 Subject: [PATCH] Improve texels drawing --- Sources/arm/node/MakeMesh.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/arm/node/MakeMesh.hx b/Sources/arm/node/MakeMesh.hx index 548a6129..92b6c8c8 100644 --- a/Sources/arm/node/MakeMesh.hx +++ b/Sources/arm/node/MakeMesh.hx @@ -292,8 +292,12 @@ class MakeMesh { if (lastPass && Context.drawTexels) { frag.add_uniform('vec2 texpaintSize', '_texpaintSize'); - frag.write('vec2 texel = texCoord * texpaintSize;'); - frag.write('basecol *= max(float(mod(int(texel.x), 2.0) == mod(int(texel.y), 2.0)), 0.9);'); + frag.write('vec2 texel0 = texCoord * texpaintSize * 0.01;'); + frag.write('vec2 texel1 = texCoord * texpaintSize * 0.1;'); + frag.write('vec2 texel2 = texCoord * texpaintSize;'); + frag.write('basecol *= max(float(mod(int(texel0.x), 2.0) == mod(int(texel0.y), 2.0)), 0.9);'); + frag.write('basecol *= max(float(mod(int(texel1.x), 2.0) == mod(int(texel1.y), 2.0)), 0.9);'); + frag.write('basecol *= max(float(mod(int(texel2.x), 2.0) == mod(int(texel2.y), 2.0)), 0.9);'); } if (lastPass && Context.drawWireframe) {