Open TokisanGames opened 1 year ago
The region_grid is still a debug shader, but the setting is now exposed in the main inspector under Regions. I've updated the Op with remaining steps.
since we are tracking the mouse pos (only compatibility for now), it would be reasonable to render the currently hovered region even when BG mode is none, but just checking if the region the mouse is in == current region for this vertex.
Todo
Using the editor gizmos for regions is a bit ugly and doesn't occlude. This would look so much better if drawn directly on the terrain, which will traverse the heights and occlude when close. We could even inject that code into custom shaders when inside the editor.
A preview of shader based region grid is in the grid debug view shader. It nicely occludes and stays the same size regardless of distance. Just needs mouse position and highlight color and the region gizmo can be dispensed with.
However, we can't draw on the terrain where no terrain exists. So I'm not sure what to do about the grid for empty regions. Perhaps we do a hybrid and use gizmos for empty slots.