Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Applying shader effect to RenderTarget  (Read 2666 times)

0 Members and 1 Guest are viewing this topic.

Mrowqa

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Applying shader effect to RenderTarget
« 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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Applying shader effect to RenderTarget
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything