I am making an RTS game and so I made a dynamic material for my landscape to draw grid below my cursor using SphereMask and some mathematics. It looks like this:
Every Tick event I do line trace for my mouse to landscape and record that value in HoverPosition vector2 parameter on all my material instances on landscape. But the problem is it works like a charm only on material without any height. When I tried to create Virtual Heightfield Mesh, my grid was just below everything that VHM generated and it looks like this:
There you can see that emission that used for grid lines is below the height mesh. And fade effect that achieved by SphereMask lerping base color is at position 0,0,0 because it is the default value of HoverPosition. So my question is can I make VHM work with dynamic material and update it’s apperance dynamically?