bevy/assets
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
..
android-res/mipmap-mdpi android example polish (#845) 2020-11-11 16:31:16 -08:00
animation_graphs Prevent AnimationGraph from serializing AssetIds. (#19615) 2025-06-30 22:26:05 +00:00
branding Initial raytraced lighting progress (bevy_solari) (#19058) 2025-06-12 21:26:10 +00:00
cursors/kenney_crosshairPack Support texture atlases in CustomCursor::Image (#17121) 2025-01-14 22:27:24 +00:00
data Added Support for Extension-less Assets (#10153) 2024-01-31 14:58:08 +00:00
docs Improve Mesh documentation (#9061) 2023-07-31 18:55:42 +00:00
environment_maps Implement percentage-closer soft shadows (PCSS). (#13497) 2024-09-18 18:07:17 +00:00
external Add external assets to .gitignore (#17388) 2025-01-17 01:20:14 +00:00
fonts Add the license for the FiraMono font (#3589) 2022-05-06 19:29:43 +00:00
irradiance_volumes Implement irradiance volumes. (#10268) 2024-02-06 23:23:20 +00:00
lightmaps Light Textures (#18031) 2025-06-30 21:56:17 +00:00
models Light Textures (#18031) 2025-06-30 21:56:17 +00:00
pixel Add example for pixel-perfect grid snapping in 2D (#8112) 2023-12-26 17:15:50 +00:00
scenes Make entity::index non max (#18704) 2025-05-07 18:20:30 +00:00
shaders Add comment to custom vertex attribute example to make it easier to convert to 2D (#18603) 2025-07-07 19:26:37 +00:00
sounds Programmed soundtrack example (#12774) 2024-03-29 20:32:30 +00:00
textures New cooldown example (#19234) 2025-05-26 19:44:17 +00:00
volumes Allow fog density texture to be scrolled over time with an offset (#14868) 2024-08-22 19:43:14 +00:00