shaders: project grid textures to select parts of the terrain (Unity)

So I am trying to be smart and not use more than 500 prefabricated mosaics to make a grid, and so far the background part has worked perfectly. Initially I used a dedicated mesh to represent the grid, but since I am now opting for 3D terrain (and not mosaic mapping), I thought there were many unnecessary vertices, especially if I want the grid to fit the terrain.

My inexperience of shader, on the other hand, is making me stop and think too much about this.

Awakening faith

Using FE as inspiration, I am thinking of projecting the texture of a transparent grid on a base terrain layer.

  • If I wanted some parts of the terrain not to be covered by the grid (like the water area in the image), would I simply use the world coordinates to tell the shader to do nothing there?

However, the most confusing part for me is how to highlight the mosaics. I want the movement and attack tiles to be painted & # 39; painted & # 39; on the ground in specific colors, but obviously they only affect an even smaller portion than the terrain than the grid.

  • Would you simply be using the same shader to take world coordinates once more and more or less start / stop overlapping the texture of movement / attack on the grid / terrain? And if I'm really being efficient, do those textures belong to the same PNG and I only use UV to switch between them like a sprite sheet?

  • Is this a good practice for shaders in the first place? Redraw and add textures only to parts of a material? Should I redraw and update all the texture in its place?

I guess they discard me because I'm only familiar with a 1: 1 mesh design, so the idea of ​​a single mesh but multiple textures in discrete parts that can overlap or make no sense on the paper. but the implementation in Unity is just above my ATM.

Thank you!