bevyengine / bevyengine/bevy

Allow using Material2D with TextureAtlasSprite

Open
#7,131 4 comments 10 reactions 0 assignees View on GitHub
A-Rendering C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

An easy way to add a custom shader to the current 2d sprite pipeline.

## What solution would you like?

As of 0.9.x, as far as I know, there is no easy way to use Material2D with sprites. From the user's point of view, it would be great if you can add a Material2D component to a sprite and have a built-in function to sample sprite texture or textures (like diffuse, normals, displacement, etc) by id inside of a shader.

## What alternative(s) have you considered?

The current workaround is to split an atlas into multiple textures and bind them into Material2D components as textures rather than sprites.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the 2D sprite pipeline, Material2D, and TextureAtlasSprite integration described in the issue. Determine how atlas textures such as diffuse, normal, and displacement maps could be sampled by shader identifier, and define completion as allowing a sprite to use a custom Material2D without splitting its atlas into separate textures.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.