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

Author Topic: Optimising drawing shaders.  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Sumzary

  • Guest
Optimising drawing shaders.
« on: February 08, 2014, 05:18:04 pm »
Currently, I'm drawing a sf::RenderTexture on the window every time when I draw an effect. For some effects this is fine, like blur and warp and such, but certan effects really only alter a part of the texture, like this one:


Looking at the docs, however, I don't see a way to give a sprite a texture that is a smaller part of a RenderTexture. So, question is, is there a way to optimise this or do I need to draw the RenderTexture every time?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6288
  • Thor Developer
    • View Profile
    • Bromeon
Re: Optimising drawing shaders.
« Reply #1 on: February 09, 2014, 10:57:55 am »
Looking at the docs, however, I don't see a way to give a sprite a texture that is a smaller part of a RenderTexture.
Give the sprite the whole texture, and specify a texture rect that only contains the required part.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything