Hey, I recently switched my rendering from a swap chain to an offscreen framebuffer to display it in the UI. I get unexpected transparency behavior now which did not happen before the switch. For debugging I simplified the shaders a lot, which is why the colors might look weird right now. Currently the UI is rendered via the swapchain and the offscreen-rendered texture is loaded by ImGUI (via descriptor set) to be displayed in the UI (every frame). I might have messed up something stupid but I cannot figure it out. I have been on this for a couple of days now.
I added a screenshot: On the left is the application (which shows the incorrect behavior) and on the right is the framebuffer captured via NVidia Nsight (which shows the correct behavior). The scene shows a slightly curved surface and rays being reflected of it. The xz-plane is also highlighted by a shader in the render (left: dark green, right: light green)
Incorrect results for some alpha values (left side of the screenshot):
- 0.0 gives black (should be green as the clear color is green)
- 0.5 gives light green (Looks correct, but could be off a by a bit. I did not exactly check the color value)
- 1.0 gives white (correct)
Here is a Pastebin with all the relevant code (I hope): https://pastebin.com/ZirqVpA0
Please let me know if anything is unclear or if I missed any relevant code parts or details.
This is the project if anyone wants to directly look at the code: https://github.com/hz-b/rayx/tree/feature/rayx-ui-docking (the code is a bit of a mess rn)
I would really appreaciate if anyone could give me a hint what might be going wrong.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.