Monday, November 7, 2011

DirectX Port

This image is from the port I started making from XNA to DirectX. Actually, I guess it might be more accurate to say this is a different animal altogether, since I built it from the ground up.

So you might ask, what's the point? Well, it turns out that since XNA is a wrapper library for DirectX, coding this in DirectX gives a significant performance boost.

For an idea of just how much that is, consider the following: in the screenshot of the XNA version everything is being drawn with a lower level of detail, meaning that less vertices are being used to approximate the shape dictated by the heightmap, which translates to less processing power used. If that were drawn in a wireframe mode, it would be easy to see through it. In this image (as I haven't yet gotten around to putting this feature in) not only are all original vertices drawn, but additional ones are created through the hardware tessellation feature in DirectX 11. This means that new vertices are interpolated in, creating smoother curves and more detailed terrain. If I'd taken this screenshot with a wireframe setting, it would look the same due to how many vertices are present.

What's incredible is that this DirectX version actually runs more smoothly than the XNA version. With the XNA version I get around 30-40 FPS, while with this I'm consistently hitting the cap I set at 60.

No comments:

Post a Comment