SFML community forums

General => Feature requests => Topic started by: Mrowqa on July 27, 2013, 10:17:25 pm

Title: Applying shader effect to RenderTarget
Post by: Mrowqa on July 27, 2013, 10:17:25 pm
Hi!

Sometimes is needed to apply shader effect to the scene, but now it's required to render all the scene with sf::RenderTexture, get this texture and render it again to window with shader. What do you think about add applyShaderEffect method for sf::RenderTarget? Or maybe something like sf::PostFX in SFML 1.6 - you can simply pass it as sf::Drawable?

Regards,
Mrowqa
Title: Re: Applying shader effect to RenderTarget
Post by: Nexus on July 27, 2013, 10:34:18 pm
An applyShaderEffect() won't work directly with FBOs since everything has already been drawn to the default framebuffer (the window) at the time you invoke this method.

What's the issue with rendering to a render texture first? With a good design, you can even make the implementation transparent -- i.e. render directly when no shader is specified, and to an intermediate render texture if one (or multiple ones) is specified.