mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
6027890a11
# 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`. |
||
---|---|---|
.. | ||
animate_shader.wgsl | ||
array_texture.wgsl | ||
circle_shader.wgsl | ||
cubemap_unlit.wgsl | ||
custom_gltf_2d.wgsl | ||
custom_material.frag | ||
custom_material.vert | ||
custom_material.wgsl | ||
custom_material_2d.wgsl | ||
custom_material_import.wgsl | ||
custom_material_screenspace_texture.wgsl | ||
custom_vertex_attribute.wgsl | ||
extended_material.wgsl | ||
fallback_image_test.wgsl | ||
game_of_life.wgsl | ||
gpu_readback.wgsl | ||
instancing.wgsl | ||
irradiance_volume_voxel_visualization.wgsl | ||
line_material.wgsl | ||
post_processing.wgsl | ||
shader_defs.wgsl | ||
show_prepass.wgsl | ||
texture_binding_array.wgsl | ||
tonemapping_test_patterns.wgsl |