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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - glider521al

Pages: [1]
1
Graphics / Clearing only Selected parts of a render texture.
« on: August 23, 2013, 03:38:22 pm »
The problem
I'm using the .net implementation of SFML, and I can't see any way of clearing only a selected region of the RenderTexture

I was hoping for renderTexture.Clear(intRect);


Some background on why I need this.
I plan to have a way of having multiple layers of (often) semi-transparent tiles, that frequently change,
render to the screen with much better performance on older computers:

  • The world could is divided into chunks each with a render texture comprising 256 tiles (16 w, 16 h)
  • As the player moves through the world, each chunk that is seen, is rendered once to a render texture
  • When the window renders the world, it only needs to render the render texture of the chunks that are visible
  • Each time tiles are terraformed (which in my case is frequent), only a small section of the render texture should be cleared and rerendered


The problem is that I can't clear selected parts of the texture to become transparent. I need to clear and redraw to the entire render texture :(


Maybe there's a better way around this. Any ideas?
Thanks in advance.

Pages: [1]
anything