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

Add an example for stochastic texture sampling #17527

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

cBournhonesque
Copy link
Contributor

Objective

This PR adds an example that showcases how a custom material can be used to repeat a texture stochastically while avoiding repetition artifacts.
It is related to #13682.

It doesn't provide a seamless solution for users but at least it can provide an example.

I don't think it's the best implementation out there (it's my first time writing a shader and I mostly glued external code) but it seems to be working!

StochasticSampling.mov

@cBournhonesque cBournhonesque added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Jan 24, 2025
Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@BenjaminBrienen BenjaminBrienen added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jan 25, 2025
@IceSentry
Copy link
Contributor

I personally don't like that kind of example because it doesn't really show any bevy api that isn't already documented in another example. I think for an example like that to be included it would need to show something that requires a lot of complexe use of bevy apis, but this just shows a simple use of the mesh and material api. Most of the complexity is in the shader. If people want it despite that I won't push back more, but I just wanted to voice this.

@cBournhonesque
Copy link
Contributor Author

I personally don't like that kind of example because it doesn't really show any bevy api that isn't already documented in another example. I think for an example like that to be included it would need to show something that requires a lot of complexe use of bevy apis, but this just shows a simple use of the mesh and material api. Most of the complexity is in the shader. If people want it despite that I won't push back more, but I just wanted to voice this.

I think I agree. Would we want to support this kind of behaviour in-tree or let external crates provide this kind of stuff?

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-Examples An addition or correction to our examples D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants