Add screen background shader for 2D rendering
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## How can Bevy's documentation be improved?
Hi! I'm trying to find a way to add a background shader for a 2D project I'm working on.
I'm no shader expert (yet), but the idea is to take in a black and white texture (image file), have it automatically repeat, and then use x, y uniforms to offset the background as the camera pans (top view).
After that the next step would be to tint the texture with colors form uniform data, from a pre-rendered biome 2D ndarray of enums (or converted to int or similar).
The first step is however to render a repeated texture with x y offsets that fills the 2D camera (OrthographicCameraBundle/OrthographicProjection) view.
I feel that I can understand the ECS parts of Bevy fine, those parts are both documented and great work has been put in to keep those APIs intuitive and with low complexity, trying to do custom shaders however, especially when I want them to fill the entire screen it feels like I'm hitting a wall that is to large for me to climb.
Does anyone have any hint on how to do this? I can try to write a guide afterwards for the documentation in return once I can get it working. It is fine with either using the released Bevy 0.5 API, or with the newer development version as I'm at an early stage in the project anyway.
Thankful for any hints on how to do this.
Contributor guide
Research direction
The issue names OrthographicCameraBundle and OrthographicProjection as the relevant entry points. Start by investigating Bevy's 2D rendering and custom-shader guidance for the requested repeated, camera-offset background, then define documentation that explains the approach and verify it against either the Bevy 0.5 or development API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, game-dev
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100