bevy/crates/bevy_pbr/src/render
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
..
clustered_forward.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
fog.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
fog.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
forward_io.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
gpu_preprocess.rs Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
light.rs Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
mesh_bindings.rs Implement lightmaps. (#10231) 2024-01-02 20:38:47 +00:00
mesh_bindings.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
mesh_functions.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
mesh_preprocess.wgsl Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
mesh_types.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
mesh_view_bindings.rs Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
mesh_view_bindings.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
mesh_view_types.wgsl Implement irradiance volumes. (#10268) 2024-02-06 23:23:20 +00:00
mesh.rs Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
mesh.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
mod.rs Generate MeshUniforms on the GPU via compute shader where available. (#12773) 2024-04-10 05:33:32 +00:00
morph.rs Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
morph.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
parallax_mapping.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
pbr_ambient.wgsl Use “specular occlusion” term to consistently extinguish fresnel on Ambient and Environment Map lights (#10182) 2023-10-23 03:26:20 +00:00
pbr_bindings.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
pbr_fragment.wgsl Implement alpha to coverage (A2C) support. (#12970) 2024-04-15 20:37:52 +00:00
pbr_functions.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
pbr_lighting.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
pbr_prepass_functions.wgsl Implement alpha to coverage (A2C) support. (#12970) 2024-04-15 20:37:52 +00:00
pbr_prepass.wgsl Meshlet rendering (initial feature) (#10164) 2024-03-25 19:08:27 +00:00
pbr_transmission.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
pbr_types.wgsl Implement alpha to coverage (A2C) support. (#12970) 2024-04-15 20:37:52 +00:00
pbr.wgsl Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
rgb9e5.wgsl Deferred Renderer (#9258) 2023-10-12 22:10:38 +00:00
shadow_sampling.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
shadows.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
skin.rs Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
skinning.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
utils.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
view_transformations.wgsl View Transformations (#9726) 2023-10-24 21:26:19 +00:00
wireframe.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00