   render to texture problem
  hi everybodyI'm using C# & managed D3D, I want to perform render to texture, in fact I'm going to display a radar (i.e. a small 2d image of my 3d scene), I use the following code which is really slow:  Surface backbuffer = device.GetBackBuffer(0, 0, BackBufferType.Mono);  SurfaceLoader.Save("tmptexture.jpg", ImageFileFormat.Jpg, backbuffer);  tmpTexture = TextureLoader.FromFile(device, "tmptexture.jpg");  //  shot_file_name_counter++;  backbuffer.Dispose();  //device.SetTexture(0, final_radar_texture);//  //device.SetTexture(0, device.GetBackBuffer);//  device.SetTexture(0, tmpTexture);////then I render my quad (which is the radar)I think creation of texture (on the disk) is the main bottleneck, so I shouldn't use a texture at all, how can I directly use my backbuffer image as my texture? any better way?thanks a lot   
  The only way to get this fast is to let the GPU render your radar.There are two options. 1.Render the whole radar directly to your backbuffer at the right position.2.Render the radar to a texture (create with render target flags) and then render this texture at the right position.In any case you should stay away from disk operations in your render loop (you already noticed this). But the GetBackBuffer method is although very slow as it needs to copy data back from the GPU memory to the main memory. Btw: managed DirectX is deprecated. You should use another managed wrapper like SlimDX. ;  thanks for your replyhow can I find a sample code from the 2nd option? as it seems to better suit my needs, I'm looking for a good render to texture sample but I cannot find anything;  vcGamer, I think it might be easier to render the radar screen as separate textures. A radar display looks like a circular background with some blips repesenting nearby entities, right? Why not just have a background texture and various blip textures, and then render it in pieces. Would also make it easier to animate or add glow effects to the blips.   