andyhebear1
06-03-2010 07:15:01
how to save a image with the select SceneNode only?
andybody can help me!
thanks
andybody can help me!
thanks
andyhebear1
06-03-2010 07:15:01
hedphelym
06-03-2010 09:38:14
andyhebear1
26-04-2010 07:48:12
smiley80
26-04-2010 19:41:17
public void CreateRenderTexture(Size size, Camera camera)
{
uint width = size.Width;
uint height = size.Height;
TexturePtr tex = TextureManager.Singleton.CreateManual(
"rtt",
ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME,
TextureType.TEX_TYPE_2D,
width,
height,
0,
PixelFormat.PF_A8R8G8B8,
(int)TextureUsage.TU_RENDERTARGET);
using (HardwarePixelBufferSharedPtr buf = tex.GetBuffer())
{
using (RenderTexture renderTexture = buf.GetRenderTarget())
{
renderTexture.IsAutoUpdated = false;
renderTexture.AddViewport(camera).SetVisibilityMask(2);
renderTexture.GetViewport(0).BackgroundColour = ColourValue.Black;
}
}
tex.Dispose();
}
RenderTarget rtt = ((TexturePtr)TextureManager.Singleton.GetByName("rtt")).GetBuffer().GetRenderTarget();
rtt.Update();
rtt.WriteContentsToFile("rtt.png");
andyhebear1
28-04-2010 10:51:07
andyhebear1
30-04-2010 08:10:16