1
$\begingroup$

I am supposed to use bilateral filter to denoise my image rendered with Vulkan. I wonder how I should implement the method. Should I add the rendered image to another frag shader as a texture and denoise the image there before drawing it on the screen? or are there simpler methods? Should I do it through CPU after rendering instead of GPU?

$\endgroup$

1 Answer 1

1
$\begingroup$

Bilateral filter can be implemented as a fragment shader, once you have the full rendered image.

https://www.shadertoy.com/view/4dfGDH

The first option should be much faster than downloading the rendered frame to main memory and performing the calculations in CPU.

$\endgroup$
2
  • $\begingroup$ I wonder how I can add a cs after fs in my pipeline. I want to implement bilateral filtering in the compute shader. $\endgroup$ Commented Aug 18, 2022 at 7:43
  • $\begingroup$ The code for the compute shader is not too different from the fragment shader. However, Lilyliyren, you should open a different question about how you can add a compute shader after fragment shader in Vulkan. It goes beyond the original question you posted here. Please, vote the answer if you consider it useful inside the context of the original question. $\endgroup$
    – David
    Commented Aug 22, 2022 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.