You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tonemapping doesn't work if you don't use bevy_pbr feature
❯ cargo run
Compiling bevy_render v0.14.0-dev (/home/arcashka/Documents/projects/other/bevy/crates/bevy_render)
Compiling bevy_core_pipeline v0.14.0-dev (/home/arcashka/Documents/projects/other/bevy/crates/bevy_core_pipeline)
Compiling bevy_internal v0.14.0-dev (/home/arcashka/Documents/projects/other/bevy/crates/bevy_internal)
Compiling bevy v0.14.0-dev (/home/arcashka/Documents/projects/other/bevy)
Compiling issue2 v0.1.0 (/home/arcashka/Documents/projects/other/issue2)
Finished dev [unoptimized + debuginfo] target(s) in 7.50s
Running `target/debug/issue2`
2024-05-03T11:22:14.962803Z INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-05-03T11:22:14.963476Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2024-05-03T11:22:15.023778Z INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) Graphics (ADL GT2)", vendor: 32902, device: 17958, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 23.2.1-1ubuntu3.1", backend: Vulkan }
2024-05-03T11:22:15.230009Z ERROR bevy_render::render_resource::pipeline_cache: failed to process shader:
error: required import 'bevy_pbr::utils' not found
┌─ /home/arcashka/Documents/projects/other/bevy/crates/bevy_core_pipeline/src/tonemapping/tonemapping_shared.wgsl:355:15
│
355 │ var hsv = rgb_to_hsv(color);
│ ^
│
= missing import 'bevy_pbr::utils'
2024-05-03T11:22:20.791119Z INFO bevy_window::system: No windows are open, exiting
Minimal example
[package]
name = "issue2"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { path = "../bevy", default-features = false, features = [
"bevy_core_pipeline",
"tonemapping_luts",
"x11",
] }
# 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`.
Bevy version
main branch, regression after #13121
Issue
Tonemapping doesn't work if you don't use bevy_pbr feature
Minimal example
What you did
I was investigating #13118 and found 2 other issues, so right now there are 3 issues related to the same scenario
They all are reproducible with the same minimal example and cover each over. (I mean application fails on one of them and can not get to the point where other issues occurs)
The text was updated successfully, but these errors were encountered: