jgayfer / bevy_light_2d

General purpose 2D lighting for the Bevy game engine.
MIT License
128 stars 5 forks source link

Enabling HDR crashes on launch #10

Closed senpaaii closed 2 months ago

senpaaii commented 2 months ago

Plugin crashes when HDR is enabled on a camera. I wanted to use a combination of HDR and this lighting to do some interesting effects, however seems I can't use HDR at the same time

2024-06-14T02:58:52.023829Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default    
thread '<unnamed>' panicked at /src/index.crates.io-6f17d22bba15001f/wgpu-0.19.4/src/backend/wgpu_core.rs:3006:5:
wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Metal)>`
    In a set_pipeline command
      note: render pipeline = `lighting_pipeline`
    Render pipeline targets are incompatible with render pass
    Incompatible color attachments at indices [0]: the RenderPass uses textures with formats [Some(Rgba16Float)] but the RenderPipeline uses attachments with formats [Some(Rgba8UnormSrgb)]
jgayfer commented 2 months ago

Thanks for the report!

I will take a peek next time I'm able.

jgayfer commented 2 months ago

Looks like to support HDR we need to have a conditional texture format based on the camera. Should be doable; lots of Bevy's internal pipelines do it. Will have a PR hopefully soon.