tags:

views:

396

answers:

2

Hello, I realise there are numerous questions on here asking about choosing between XNA and SlimDX, but these all relate to game programming.

A little background: I have an application that renders scenes from XML descriptions. Currently I am using WPF 3D and this mostly works, except that WPF has no way to render scenes offscreen (i.e. on a server, without displaying them in a window), and also rendering to a bitmap causes WPF to fallback to software rendering.

So I'm faced with having to write my own renderer. Here are the requirements:

  • Mix of 3D and 2D elements.
  • Relatively few elements per scene (tens of meshes, tens of 2D elements).
  • Large scenes (up to 3000px square for print).
  • Only a single frame will be rendered (i.e. FPS is not an issue).
  • Opacity masks.
  • Pixel shaders.
  • Software fallback (servers may or may not have a decent gfx card).
  • Possibility of being rendered offscreen.

As you can see it's pretty simple stuff and WPF can manage it quite nicely except for the not-being-able-to-export-the-scene problem.

In particular I don't need many of the things usually needed in game development. So bearing that in mind, would you choose XNA or SlimDX? The non-rendering portion of the code is already written in C#, so want to stick with that.

+1  A: 

I haven't used SlimDX, but based on my experience with XNA and reading about SlimDX's objective. I'd suggest SlimDX. XNA while it can be used for other things is primarily a Game Engine, not a Rendering Engine. It's got lots of specific optimizations & methodology geared towards Games.

Also, XNA likes to pre-build it's resources into DirectX Files (.x) if you're working with dynamic files, I think SlimDX is the best choice for you.

Aren
You were right, I was worried SlimDX would be too low level (it is low level, but no so much to be a problem), but I managed to get a working renderer written in just a couple of days, even having never done any Direct3D programming before.
Groky
Just a minor nitpicking: The XNA Framework, as the name implies, is a Game Framework, not Engine. However, it is a bit more higher level than SlimDX and focused on game creation.
Bjoern
A: 

XNA and SlimDX are very close in nature, but there are some differences:

  • XNA requires a GPU with a least pixel/vertex shaders 1.1 while I think SlimDX does not.

  • SlimDX supports DirectX10 and 11, while XNA only supports DirectX 9.

  • XNA is a cross platform between Windows, Xbox 360, Zune and Windows Phone 7, while SlimDX is not.

  • XNA has a strong community (creators.xna.com) with tons of tutorials and help materials.

I would go with XNA.

SiN