i want to be able to loop through a hole bunch of textures, and render them on an object. I then want the rendered image to be placed onto a texture2D.
The point? well hopefully i will end up with an array of Texture2D's containing a model with multiple skins.
Here's my code:
for (byte i = 1; i < allBlockIso.Count(); i++)
{
DisplayBox.SetValue(i);
GraphicsDevice.SetRenderTarget(cubeTarget);
GraphicsDevice.Clear(Color.Transparent);
DrawIsoCube();
GraphicsDevice.SetRenderTarget(null);
allBlockIso[i] = (Texture2D)cubeTarget;
}
DisplayBox.SetValue is a function which goes through and sets the texture. This is working! DrawIsoCube() draws the cube (the test model) and this is working too. The problem is definitely something to do with the unreusability of the render target.
Pretty simple yet it's not working. It appears that whatever the last image being rendered is, is shown in every image of the allBlockIso array.
Anyone know a fix? Cheers.
P.S. sorry if this wan't explained well. I'm not very good at explaining :P