bevy/assets/shaders
Nicky Fahey 831073105f
Add comment to custom vertex attribute example to make it easier to convert to 2D (#18603)
# Objective

- It's not clear what changes are needed to the shader to convert the
example to 2D.
- If you leave the shader unchanged you get a very confusing error (see
linked issue).
- Fixes #14077

## Solution

A separate example probably isn't needed as there is little difference
between 3D and 2D, but a note saying what changes are needed to the
shader would make it a lot easier.

Let me know if you think it is also worth adding some notes to the rust
file, but it is mostly trivial changes such as changing `Mesh3d` to
`Mesh2d`. I have left the original code in comments next to the changes
in the gist linked at the bottom if you wish to compare.

## Testing

- I just spent a long time working it out the hard way. This would have
made it a lot quicker.
- I have tested the 2D version of the shader with the changes explained
in the suggested comment and it works as expected.
- For testing purposes [here is a complete working 2D
example](https://gist.github.com/nickyfahey/647e2a2c45e695f24e288432b811dfc2).
(note that as per the original example the shader file needs to go in
'assets/shaders/')
2025-07-07 19:26:37 +00:00
..
animate_shader.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
array_texture.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
automatic_instancing.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bindless_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
cubemap_unlit.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_clustered_decal.wgsl Implement basic clustered decal projectors. (#17315) 2025-01-26 20:13:39 +00:00
custom_gltf_2d.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
custom_material_2d.wgsl Fix binding group in custom_material_2d.wgsl (#10841) 2023-12-02 22:21:53 +00:00
custom_material_import.wgsl fix custom shader imports (#10030) 2023-10-06 01:34:57 +00:00
custom_material_screenspace_texture.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.frag Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.vert Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.wesl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
custom_phase_item.wgsl Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
custom_stencil.wgsl Add a custom render phase example (#16916) 2025-02-10 21:17:37 +00:00
custom_ui_material.wgsl ui_material example webgl2 fix (#17852) 2025-02-13 20:52:26 +00:00
custom_vertex_attribute.wgsl Add comment to custom vertex attribute example to make it easier to convert to 2D (#18603) 2025-07-07 19:26:37 +00:00
extended_material_bindless.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
extended_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
fallback_image_test.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
game_of_life.wgsl Fix game_of_life shader relying on Naga bug (#18951) 2025-04-26 21:38:08 +00:00
gpu_readback.wgsl Gpu readback (#15419) 2024-09-30 17:28:55 +00:00
instancing.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
irradiance_volume_voxel_visualization.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
line_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
manual_material.wgsl Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
post_processing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
shader_defs.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
show_prepass.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
specialized_mesh_pipeline.wgsl Fix non-crate typos (#18219) 2025-03-11 06:17:48 +00:00
storage_buffer.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
texture_binding_array.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
tonemapping_test_patterns.wgsl Fix non-crate typos (#18219) 2025-03-11 06:17:48 +00:00
util.wesl Fix wesl in wasm and webgl2 (#18591) 2025-03-28 21:45:02 +00:00
water_material.wgsl Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00