I'm currently working on a 2D clone of “worms” in XNA, and one of the features is a “deformable” terrain (for example, when a rocket hits a terrain, an explosion occurs and a fragment of the terrain disappears).
As I do now, using a texture that, as it approaches the center, has a higher red value. I look at every pixel of this Warp texture, and if the current pixel overlaps the terrain pixel and has a fairly high red value, I change the color array representing the terrain to be transparent. If the current pixel does NOT have a sufficiently high red value, I will blacken the color of the landscape (it gets darker the closer the red value to the threshold). At the end of this operation, I use SetData to update the terrain texture.
I understand that this is not a very good way to do this, not only because I read about conveyor kiosks, etc., but also because it can become quite weak if many craters are added at the same time. I want to remake my generation of craters on the GPU, instead using Render Targets "ping-ponging" between being the target and the texture to change. This is not a problem, I know how to do it. the problem is that I don’t know how to preserve the burn effect using this method.
Here's what the burn effect looks like right now:
Burn Effect http://i52.tinypic.com/2h6f2nt.png
- , ( )? , , , - , . - , .