<p>Bilateral filter can be implemented as a fragment shader, once you have the full rendered image.</p>
<p><a href="https://www.shadertoy.com/view/4dfGDH" rel="nofollow noreferrer">https://www.shadertoy.com/view/4dfGDH</a></p>
<p>The first option should be much faster than downloading the rendered frame to main memory and performing the calculations in CPU.</p>

CC BY-SA 4.0
2022-08-18T07:43:01.303Z
I wonder how I can add a cs after fs in my pipeline. I want to implement bilateral filtering in the compute shader.
Lilylilyren
CC BY-SA 4.0
2022-08-22T19:53:40.110Z
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.
David
CC BY-SA 4.0
2022-08-16T15:57:45.453Z
2022-08-16T15:57:45.453Z
David
<p>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?</p>

<vulkan>
bilateral filter in vulkan
Lilylilyren
# bilateral filter in vulkan

(Asked by: username_0 on 2022-08-10)

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?

**Tags:** vulkan


---

## 1 answers

### Answer by username_1 on 2022-08-16. Score: 1

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.

> **Comments:**
> **username_0**: I wonder how I can add a cs after fs in my pipeline. I want to implement bilateral filtering in the compute shader.  
> **username_1**: 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.  

---

