3

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...

Joshua Rodgers
  • 5,317
  • 2
  • 31
  • 29
bat3a
  • 31
  • 4
  • no answer till now, is it that hard?? – bat3a Jun 27 '11 at 21:41
  • You say the current method is slow and gives "bad results". What are these bad results? In what way is the result not what you expected? If possible could you upload some images of expected and actual outcomes for us to see? – Nick Udell Aug 02 '11 at 13:14
  • bad results as in pixlated image, i can't high the resolution as it takes more time, anyway this is a very old question, i removed the 3dviewport and used a shader effect instead, which is very fast and the results is clean. – bat3a Jun 25 '12 at 16:27

0 Answers0