Procedural Prototype Grid Shader

This did the trick:

shader.fragmentShader = shader.fragmentShader.replace(
      '#include <alphamap_fragment>',
      `
      #ifdef USE_ALPHAMAP
        diffuseColor.a *= texture2D( alphaMap, vGridUv ).g;
      #endif
      `
    );

You can see it implemented here.

3 Likes