2d Dynamically Changing Texture
by Rick Marino · in Torque X 2D · 03/15/2008 (8:59 pm) · 1 replies
Hi,
I'm new to Torque-X and XNA, but I'm familiar with DirectX.
I just have a few questions about some texture effects that I'm looking to achieve, and I hope someone could be of some help.
For a 2d game I'm wanted to make, I'm looking to create destructible terrain/material. When the player shoots a weapon, I'd like the explosion animation to cut a hole into the material (alpha), and allow the background layers to continue to show through. I imagine, that I could directly manipulate the material on a per pixel level, however, I'm not familiar with the inner workings of the Torque/XNA rendering engine.
Could someone point me in the right direction of where I should start looking for this, or does Torque-X provide some kind of support directly, or indirectly, for an effect like this?
I also would have a need for per pixel collision, to determine if the player collided with material. Since I have no idea if a hole has been cut into it or not, I'd have to use some sort of pixel perfect collision to determine if we collided with it. Does Torque-X have support for this as well? I know Torque-X could use polygonal collision, but this would be no use to me, as the collision would be constantly changing through out game play.
Thanks in advance,
-RM
I'm new to Torque-X and XNA, but I'm familiar with DirectX.
I just have a few questions about some texture effects that I'm looking to achieve, and I hope someone could be of some help.
For a 2d game I'm wanted to make, I'm looking to create destructible terrain/material. When the player shoots a weapon, I'd like the explosion animation to cut a hole into the material (alpha), and allow the background layers to continue to show through. I imagine, that I could directly manipulate the material on a per pixel level, however, I'm not familiar with the inner workings of the Torque/XNA rendering engine.
Could someone point me in the right direction of where I should start looking for this, or does Torque-X provide some kind of support directly, or indirectly, for an effect like this?
I also would have a need for per pixel collision, to determine if the player collided with material. Since I have no idea if a hole has been cut into it or not, I'd have to use some sort of pixel perfect collision to determine if we collided with it. Does Torque-X have support for this as well? I know Torque-X could use polygonal collision, but this would be no use to me, as the collision would be constantly changing through out game play.
Thanks in advance,
-RM
Torque Owner Rick Marino
Another idea is to render the explosions that are to erase some of the terrain to a T2DQuad with a 2d texture. I would have to make sure that it doesn't render normally, and then use a pixel shader thats bound to both the buffer texture and the actual terrain texture. The pixel shader could determine whether to draw or make it part of the alpha.
Anyone else have any ideas or have setup something like terrain deformation (or Texture erasing) before?
I'm not quite sure, but I see that the GenericMaterial could have an fx shader applied to it, however, I can't find any documentation on how to use it properly.
Any help would be appreciated!
Thanks
-RM