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.


Messages - mrfreeze

Pages: [1]
1
Graphics / Re: Clear part of RenderTexture
« on: May 06, 2016, 09:46:27 am »
Thanks! Works like a charm!
I totally forgot about blending  :-[

2
Graphics / Clear part of RenderTexture
« on: May 06, 2016, 12:18:49 am »
I'm making a simcity-style game. I use one big RenderTexture for the terrain and one big RenderTexture for all the roads, so I don't have to iterate through all the tiles every frame. So for the terrain and the roads I only have two sprites and two draw-calls. If the player builds a road, the corresponding sprite (I use an atlas with all possible roadtypes, e.g. horizontal, vertical, corners, crossing, etc.) is drawn on the roads-rendertexture. This works fine.
The problem is when I remove a road, I want to clear that part of the rendertexture with transparant pixels. But since the rendertexture is never 'cleared', how can I do this? I tried drawing a transparant rectangleshape on the rendertexture, but (of course) this draws on top of the current pixels, so nothing happens. How can I 'replace' the pixels on the rendertexture with transparant ones?


Pages: [1]