How do I apply a shader on render target texture

How can I apply a shader to a Render Target Texture? I’m working on a refraction effect, and I want the refraction image to be blurred with the shader before it’s rendered using PBR.

Can you share a playground of what you tried already ?

Also this could help Blurry refraction quality - #12 by Evgeni_Popov

I don’t have a playground, I want to write a shader for a texture to create a blur or multi-pass blur effect, for example like this: Unity - Manual: Custom Render Textures

You can use

scene.postProcessManager.directRender([yourPostProcess], rtt.renderTarget, true);

You will probably need 2 render target textures: one for input and one for output

Here is an example: https://playground.babylonjs.com/#22KZUW#576

4 Likes