SFML community forums

Help => Graphics => Topic started by: oomek on January 15, 2018, 03:35:14 am

Title: How to implement a multipass shader
Post by: oomek on January 15, 2018, 03:35:14 am
Is anyone willing to help explaining in detail how to implement a multipass fragment shader in SFML?
I need it for kawase blur so it should have an uniform integer accessible from within shader with the pass number.
Title: Re: How to implement a multipass shader
Post by: Mario on January 18, 2018, 09:08:46 am
Easiest solution for your multiple passes is to use two or more render textures:

Title: Re: How to implement a multipass shader
Post by: oomek on February 15, 2018, 04:10:17 am
It could work for fullscreen effects, but what should I do If I need multipass for sprites with transformations? Normally sprite is drawn on a fullscreen rendertarget, but for every pass before the final one I should draw it to the intermediate render target and reset the transformations? Should the imrt be the size of the source sprite texture, or the size after scaling?