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

Implement grid shader #102

Merged
merged 9 commits into from
Feb 11, 2024
Merged

Implement grid shader #102

merged 9 commits into from
Feb 11, 2024

Conversation

white-axe
Copy link
Collaborator

Connections

Description
This pull request implements a shader for drawing grid lines on the map editor and the tilemap.

The lines have a light outline and a dark fill to offer enhanced contrast in a variety of environments. They also scale in thickness with the screen resolution which is important for people with very large screens.

Testing
The shader has been tested to work with Vulkan, WebGL and WebGPU by opening a map and observing that no crashes occur.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo build --release
  • If applicable, run trunk build --release

OpenGL and WebGL use the last vertex of each triangle as the provoking
vertex, the vertex whose output is used for `@interpolate(flat)` values
in the fragment shader's input. All other backends use the first vertex
instead.
If this value is less than 1, the grid lines will not render properly.
@white-axe white-axe added enhancement New feature or request core functionality a feature provided in rpg maker labels Feb 10, 2024
@white-axe white-axe requested a review from a team as a code owner February 10, 2024 20:25
crates/graphics/src/grid/instance.rs Show resolved Hide resolved
crates/graphics/src/grid/grid.wgsl Outdated Show resolved Hide resolved
@Speak2Erase Speak2Erase merged commit 22d7155 into Astrabit-ST:dev Feb 11, 2024
5 checks passed
@white-axe white-axe deleted the grid branch February 11, 2024 16:05
@Speak2Erase Speak2Erase mentioned this pull request Jun 15, 2024
5 tasks
@Speak2Erase Speak2Erase added this to the v1.0 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core functionality a feature provided in rpg maker enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilemap grid
2 participants