diff --git a/Sources/arm/node/MakeMesh.hx b/Sources/arm/node/MakeMesh.hx index 18655b5d..0386e18e 100644 --- a/Sources/arm/node/MakeMesh.hx +++ b/Sources/arm/node/MakeMesh.hx @@ -422,7 +422,8 @@ class MakeMesh { } else if (Context.viewportMode == ViewMaterialID) { frag.add_shared_sampler('sampler2D texpaint_nor' + Context.layer.id); - frag.write('float sample_matid = textureLodShared(texpaint_nor' + Context.layer.id + ', texCoord, 0.0).a + 1.0 / 255.0;'); + frag.add_uniform('vec2 texpaintSize', '_texpaintSize'); + frag.write('float sample_matid = texelFetch(texpaint_nor' + Context.layer.id + ', ivec2(texCoord * texpaintSize), 0).a + 1.0 / 255.0;'); frag.write('float matid_r = fract(sin(dot(vec2(sample_matid, sample_matid * 20.0), vec2(12.9898, 78.233))) * 43758.5453);'); frag.write('float matid_g = fract(sin(dot(vec2(sample_matid * 20.0, sample_matid), vec2(12.9898, 78.233))) * 43758.5453);'); frag.write('float matid_b = fract(sin(dot(vec2(sample_matid, sample_matid * 40.0), vec2(12.9898, 78.233))) * 43758.5453);');