bevy/examples/shader
Patrick Walton fcda67e894
Start a built-in postprocessing stack, and implement chromatic aberration in it. (#13695)
This commit creates a new built-in postprocessing shader that's designed
to hold miscellaneous postprocessing effects, and starts it off with
chromatic aberration. Possible future effects include vignette, film
grain, and lens distortion.

[Chromatic aberration] is a common postprocessing effect that simulates
lenses that fail to focus all colors of light to a single point. It's
often used for impact effects and/or horror games. This patch uses the
technique from *Inside* ([Gjøl & Svendsen 2016]), which allows the
developer to customize the particular color pattern to achieve different
effects. Unity HDRP uses the same technique, while Unreal has a
hard-wired fixed color pattern.

A new example, `post_processing`, has been added, in order to
demonstrate the technique. The existing `post_processing` shader has
been renamed to `custom_post_processing`, for clarity.

[Chromatic aberration]:
https://en.wikipedia.org/wiki/Chromatic_aberration

[Gjøl & Svendsen 2016]:
https://github.com/playdeadgames/publications/blob/master/INSIDE/rendering_inside_gdc2016.pdf

![Screenshot 2024-06-04
180304](https://github.com/bevyengine/bevy/assets/157897/3631c64f-a615-44fe-91ca-7f04df0a54b2)

![Screenshot 2024-06-04
180743](https://github.com/bevyengine/bevy/assets/157897/ee055cbf-4314-49c5-8bfa-8d8a17bd52bb)

## Changelog

### Added

* Chromatic aberration is now available as a built-in postprocessing
effect. To use it, add `ChromaticAberration` to your camera.
2024-07-15 13:59:02 +00:00
..
animate_shader.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
array_texture.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
compute_shader_game_of_life.rs Handle wgsl errors in the game of life example (#13624) 2024-06-03 13:31:56 +00:00
custom_phase_item.rs Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
custom_post_processing.rs Start a built-in postprocessing stack, and implement chromatic aberration in it. (#13695) 2024-07-15 13:59:02 +00:00
custom_vertex_attribute.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
extended_material.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
fallback_image.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
gpu_readback.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_defs.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_instancing.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_material.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_material_2d.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_material_glsl.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_material_screenspace_texture.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
shader_prepass.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00
texture_binding_array.rs Highlight dependency on shader files in examples (#13824) 2024-06-12 14:16:01 +00:00