I want to render a viewport3d visual to an image using hardware rendering. How could I do that using SlimDX? I'm using WPF & VB.NET 4.0 and SlimDX. Any tips will help, thanks in advance. :)
Here is the code I use to render a viewport3d, it is very slow and gives bad results:
//rendering viewport3D to image
Dim viewportPlate As New RenderTargetBitmap(600, 600, 96 , 96 , PixelFormats.Pbgra32)
viewportPlate.Render(viewport3d)
//path to save
Dim path As String = imgSave
Dim fs As FileStream = New FileStream(path, FileMode.Create)
//encoding to PNG and saving
Dim encoder As BitmapEncoder = New PngBitmapEncoder()
encoder.Frames.Add(BitmapFrame.Create(viewportPlate))
encoder.Save(fs)
PS: If anyone has a better idea on how to do this using something other than SlimDX I will welcome those too...