bevyengine / bevyengine/bevy

Support inline shader declaration in Material

Open
#7,909 1 comment 4 reactions 0 assignees View on GitHub
A-Rendering C-Feature C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

When declaring a Material with a very simple shader, having to use a separate file that lives in the assets folder that is really far from the code isn't always ideal. Having the ability to declare the shader in a string directly in the material impl would make this easier.

## What solution would you like?

I believe this should be considered an advanced feature for experimentation and not used in most cases.

One potential implementation would be to add an `Inline(String)` variant to the `ShaderRef` enum.

## What alternative(s) have you considered?

Manually create a shader handle before creating the app and use the handle in the material. This works, but this is more verbose and requires more manipulation. The goal here would be to simplify this workflow.

## Additional context

n/a

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.