bevy/assets/shaders
arcashka 6027890a11
move wgsl color operations from bevy_pbr to bevy_render (#13209)
# Objective

`bevy_pbr/utils.wgsl` shader file contains mathematical constants and
color conversion functions. Both of those should be accessible without
enabling `bevy_pbr` feature. For example, tonemapping can be done in non
pbr scenario, and it uses color conversion functions.

Fixes #13207

## Solution

* Move mathematical constants (such as PI, E) from
`bevy_pbr/src/render/utils.wgsl` into `bevy_render/src/maths.wgsl`
* Move color conversion functions from `bevy_pbr/src/render/utils.wgsl`
into new file `bevy_render/src/color_operations.wgsl`

## Testing
Ran multiple examples, checked they are working:
* tonemapping
* color_grading
* 3d_scene
* animated_material
* deferred_rendering
* 3d_shapes
* fog
* irradiance_volumes
* meshlet
* parallax_mapping
* pbr
* reflection_probes
* shadow_biases
* 2d_gizmos
* light_gizmos
---

## Changelog
* Moved mathematical constants (such as PI, E) from
`bevy_pbr/src/render/utils.wgsl` into `bevy_render/src/maths.wgsl`
* Moved color conversion functions from `bevy_pbr/src/render/utils.wgsl`
into new file `bevy_render/src/color_operations.wgsl`

## Migration Guide
In user's shader code replace usage of mathematical constants from
`bevy_pbr::utils` to the usage of the same constants from
`bevy_render::maths`.
2024-05-04 10:30:23 +00:00
..
animate_shader.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
array_texture.wgsl Gate diffuse and specular transmission behind shader defs (#11627) 2024-02-02 15:01:56 +00:00
circle_shader.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
cubemap_unlit.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
custom_gltf_2d.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
custom_material.frag Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
custom_material.vert Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
custom_material.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +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 Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
custom_vertex_attribute.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
extended_material.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
fallback_image_test.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
game_of_life.wgsl Fix example game of life (#12897) 2024-04-08 17:19:07 +00:00
gpu_readback.wgsl Add gpu readback example (#12877) 2024-04-08 17:08:20 +00:00
instancing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
irradiance_volume_voxel_visualization.wgsl Implement irradiance volumes. (#10268) 2024-02-06 23:23:20 +00:00
line_material.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
post_processing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
shader_defs.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
show_prepass.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
texture_binding_array.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
tonemapping_test_patterns.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00