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

examples(shaders/glsl): Update GLSL Shader Example Camera View uniform #15865

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakeswenson
Copy link

Objective

The Custom Material GLSL shader example has old version of the camera view uniform structure.
This pr updates the example GLSL custom material shader to have the latest structure.

Solution

I was running into issues using the camera world position (it wasn't changing) and someone in discord pointed me to the source of truth.
crates/bevy_render/src/view/view.wgsl

After using this latest uniform structure in my project i'm not able to work with the camera position in my shader.

Testing

I tested this change by running the example with:

cargo run --features shader_format_glsl --example shader_material_glsl
image

The Custom Material GLSL shader example had what seemed to be an old
version of the camera view uniform.

I was running into issues using camera world position
and someone in discord pointed me to the source of truth.
  crates/bevy_render/src/view/view.wgsl

Since this was helpful to me I've updated the shader example
to have the latest view uniform structure converted to GLSL.

I tested it with:
```bash
cargo run --features shader_format_glsl --example shader_material_glsl
```
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Oct 12, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 12, 2024
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 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.

2 participants