Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw region grid in shader instead of gizmos #100

Open
4 tasks
TokisanGames opened this issue Jul 2, 2023 · 2 comments
Open
4 tasks

Draw region grid in shader instead of gizmos #100

TokisanGames opened this issue Jul 2, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@TokisanGames
Copy link
Owner

TokisanGames commented Jul 2, 2023

Todo

  • Different color for defined regions, and no regions (white, grey or maybe white at .50% opacity)
  • Different color when the mouse is over it for add (green) and remove (red) when using the region tool (mouse tracking added in Compatibility renderer support #500)
  • Blue line for maximum bounds (though we may drop bounds in Implement Region Streaming #491)
  • Reduce the region gizmos to draw the add region square only when background mode = NONE and the mouse is in an empty space with no terrain mesh

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.

image

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.

image

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.

@TokisanGames TokisanGames added the enhancement New feature or request label Jul 2, 2023
@TokisanGames TokisanGames added this to the Polished Version milestone Jul 2, 2023
@TokisanGames TokisanGames added low priority Low Priority idea Just an idea, may or may not be implemented and removed low priority Low Priority labels Jul 2, 2023
@TokisanGames TokisanGames removed the idea Just an idea, may or may not be implemented label Jul 24, 2023
@TokisanGames TokisanGames modified the milestones: Polished Version, Beta Jul 24, 2023
@TokisanGames TokisanGames self-assigned this Aug 5, 2023
@TokisanGames TokisanGames modified the milestones: Beta, Stable Dec 16, 2023
@TokisanGames TokisanGames modified the milestones: Stable 1.0.x, Beta 0.9.x Feb 4, 2024
@TokisanGames TokisanGames removed their assignment Jun 1, 2024
@TokisanGames
Copy link
Owner Author

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.

@Xtarsia
Copy link
Contributor

Xtarsia commented Oct 2, 2024

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.

@TokisanGames TokisanGames modified the milestones: 0.9, 1.0 Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants