shader_material manual example#5925
Closed
ThierryBerger wants to merge 5 commits intobevyengine:mainfrom
Closed
Conversation
ThierryBerger
commented
Sep 9, 2022
| @@ -0,0 +1,187 @@ | |||
| //! A shader and a material that uses it using Bevy's Material API via manual implementation | |||
| //! See shader_material example for a higher level implementation. | |||
| //! See shader_material_low_level example for a lower level implementation. | |||
Member
Author
There was a problem hiding this comment.
Not yet implemented, should be removed from this PR
Comment on lines
+19
to
+22
| use bevy_internal::render::render_resource::{ | ||
| BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingType, BufferBindingType, | ||
| SamplerBindingType, ShaderStages, ShaderType, TextureSampleType, TextureViewDimension, | ||
| }; |
Member
Author
There was a problem hiding this comment.
probably from cargo-expand, they are probably exposed in render ?
Comment on lines
+90
to
+100
| // Step 1: retrieve information from our extracted type. | ||
| let color_texture = { | ||
| let color_texture_handle: Option<&Handle<Image>> = (&self.color_texture).into(); | ||
| if let Some(handle) = color_texture_handle { | ||
| images | ||
| .get(handle) | ||
| .ok_or(AsBindGroupError::RetryNextUpdate)? | ||
| } else { | ||
| fallback_image | ||
| } | ||
| }; |
Member
Author
There was a problem hiding this comment.
to note: this logic was duplicated with cargo-expand, to get :
- the sampler
- the texture
I refactored a bit to make only one call to retrieve the image and have 1 failure path.
IceSentry
reviewed
Sep 9, 2022
IceSentry
reviewed
Sep 9, 2022
IceSentry
reviewed
Sep 9, 2022
Contributor
|
I added a couple of suggestions, mostly to provide a bit more details. Feel free to use them as is or change them. |
Co-authored-by: Charles <IceSentry@users.noreply.github.com>
ThierryBerger
commented
Sep 16, 2022
Member
Author
|
I'm closing this because the example was completely reworked with #8376 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Part of #5843.
Solution
I'll try to do a follow up PR with a different example using lower level API: