Skip to content

Extract sprite_material functions, bindings, and types to separate shader modules#24629

Open
cookie1170 wants to merge 2 commits into
bevyengine:mainfrom
cookie1170:extract-sprite-material
Open

Extract sprite_material functions, bindings, and types to separate shader modules#24629
cookie1170 wants to merge 2 commits into
bevyengine:mainfrom
cookie1170:extract-sprite-material

Conversation

@cookie1170

Copy link
Copy Markdown
Contributor

Objective

Make it easier to make sprite shaders by extracting the functions, bindings, and types from the SpriteMesh's sprite_material.wgsl shader to exported modules

Solution

Move the SpriteMaterial type and flags from sprite_material.wgsl to the bevy_sprite::sprite_types module

Move the sprite material bindings to the bevy_sprite::sprite_bindings module

Move the uv flipping, tiling, transforming, and slicing logic along with some utility functions to the bevy_sprite::sprite_functions module

Testing

Ran the sprite_* examples using SpriteMesh and manually verified that the shaders compiled and the behaviour matched

@kfc35 kfc35 added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Shaders This code uses GPU shader languages labels Jun 15, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 15, 2026
@kfc35 kfc35 added C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Shaders This code uses GPU shader languages D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants