The ZBuffer - Managed DirectX resources

\Managed DirectX and XNA Framework news


Search ZBuffer
Links


 
The ZBuffer
News, Information and resources for Managed DirectX and XNA Framework.
Archive of posts for June, 2006. For other months check out the archive

David Weller (note he has a new blog) has a few more bits of information on the XNA framework API and what will and will not be included. He's also asking for feedback on the information so go ahead and let your opinions be known. Right now there is still time to make a difference.

Updated 6/29/2006 8:00:00 PM by Zman

Not even close to being the first to announce this, but for completeness.....

Download June 2006 DirectX SDK

Biggest news is that DirectX 10 is now compatible with the latest vista preview release. Otherwise little in the way of changes especially in the managed space. The readme contains a horribly edited update on the status which hopefully I have corrected below.

It shouldn't be news to anyone that D3DX won't be supported on XNA framework - the technical reason being that DirectX on the 360 doesn't support it. However it does mean that any code that uses meshes, sprites or anything else from the DirectX.D3DX assembly may not be 100% portable to XNA framework. If you have an opinion on what should, or should not be there then xna@microsoft.com or post to Tom or Al's blog.

Managed DirectX 2.0 Beta Update

Microsoft is working on a new managed gaming framework which will target Windows and Xbox 360 known as the XNA Framework. The majority of what exists today as the Managed DirectX 2.0 beta will become a key component of the XNA Framework. The MDX 2.0 libraries will remain unchanged as of the April 2006 SDK release and will continue to ship as a beta in DirectX SDK releases until a beta of the XNA Framework is made available. While we are striving to deliver a smooth transition from code written to use the Managed DirectX 2.0 beta, Microsoft can make no guarantees about the API compatibility between the Managed DirectX 2.0 beta and the upcoming graphics API’s in the XNA Framework. Microsoft will be providing guidance about the API differences as well as migration assistance as more information becomes available regarding the XNA Framework.

The following is an initial list of known changes which will exist between the Managed DirectX 2.0 beta and what Microsoft will deliver with the XNA Framework. This list will be updated as more information is available, and is as always subject to change.

  • Managed XACT and managed XINPUT will replace managed DirectSound and managed DirectInput respectively. Managed DirectSound and managed DirectInput will no longer be available in the XNA Framework. However, DirectSound and DirectInput will still be available for developers who choose to use Managed DirectX 1.1.
  • Managed D3DX will not be available in the XNA Framework. D3DX support will still be available for developers using Managed DirectX 1.1.
  • Microsoft is actively investigating how to bring forward functionality from Direct 3DX 9.0 into the XNA Framework. D3DX9 will still be supported in MDX 1.1
  • Please note that Managed DirectX 1.1 is fully compatible with the .NET Framework 2.0. Other than the loader lock errors which have an easy workaround.
Updated 6/11/2006 2:00:00 PM by Zman

6/8/06: Added FromStream workaround.

To be able to convert from every possible format of bitmap, Managed DirectX uses Bitmap.GetPixel to read each pixel. This means height*width calls into GDI. Unfortunately due to a known issue (passport required) with the way that the managed debugging assistants (MDAs) work in Visual Studio there is a huge amount of overhead with each under-the-covers PInvoke. This overhead combined with the height*width calls means that textures can take minutes to convert into textures and you would probably think your application has crashed.

Note that this issue only occurs when running your application under the debugger. Outside of Visual Studio your application will run at a perfectly normal speed.

There are several workarounds noted in the bug:

  1. Instead of using Texture.FromBitmap save the bitmap to a memory stream and then read it back using Texture.FromStream. Nice workaround suggested by Wyzfen, implemented by Dave Hunt and documented in this gamedev thread.
  2. Don't use the debugger. Start your application with ctrl-f5 (start without debugging). Useless if you actually need to debug something.
  3. Write the conversion yourself using unsafe code. Note that this may get tricky to deal with the generic case where you have no clue what format the bitmap is in.
  4. Disabling MDAs in general (passport required). Note that this is not turning of the reporting of an MDA like we do for the LoaderLock issue. We have to totally stop MDA checking from occurring using a settings file. You may also have to turn off the Visual Studio Hosting process - or one workaround suggests that this step alone is sufficient.

The following links have more details:

Updated 6/8/2006 10:00:00 AM by Zman

Visual3D Architect .NET is a completely managed framework and integrated visual development environment built upon .NET 2.0 and Microsoft XNA for rapid prototyping and development of cross-platform games, simulations, modeling environments, and architectural visualizations. Visual3D.NET is the next-generation successor to RealmForge and is built upon the Microsoft-award-winning Suva3D engine which provides rendering, physics, massive-multiplayer networking while also including an alternative: the DotNet3D Engine open-source C# port of OGRE. The development toolset has a Windows Vista look & feel and is hosted within the application being developed for simplified runtime design with a WinFX Workflow-like visual scripting system, visual behavior design, object prototyping, and an event-based scripting model for use with any .NET language, including C#, C++.NET, Visual Basic, J# (Java), JScript.NET (JavaScript), Delphi, and IronPython

Updated 6/7/2006 8:00:00 AM by Zman

Suva3D is the winner of the connected systems competition we mentioned in April 2005 in the Best use of Managed DirectX, Visual Studio 2005 and SQL Server Express category.

Suva-3D is a real-time game engine for simulation, modeling, and interactive software titles. The Suva-3D engine is a turnkey solution for realtime rendering, scalable network architecture, physics modeling, and visual effects. Written entirely in C# and Managed DirectX, Suva-3D represents one the first managed game engines available for the .NET platform.

Other than the fact that is to be used in Visual3D Architect .NET there are currently no announced plans for Suva, though you will read about them 1st here on the ZBuffer

Updated 6/7/2006 7:59:00 AM by Zman

RealmForge is 'retired'

News From RealmForge:

The RealmForge 3D game engine for .NET is no longer under development. Its core team is now developing Visual3D Architect .NET

RealmForge is still available as an open source cross platform solution and will continue to be available from the sourceforge location. Questions can be asked in the RealmForge google group or on the Visual3D forums.

The RealmForge GDK is an open-source, cross-platform game development middleware for advanced 3D games and simulations. It is written entirely in C# for use with the .NET Framework and provides a flexible object-oriented and component-based architecture which is easy to use. It is a complete reusable development platform comprised of a framework, rendering engine, and an innovative run-time development environment. Since this project is licensed under the LGPL, it serves as an excellent solution for low-cost development of high-risk educational games and simulations and can even be used for free in commercial endeavors as well.

Updated 6/7/2006 7:58:00 AM by Zman

http://www.emeyex.com has a couple of Managed DirectX applications from a (former?) student at Digipen. Quite a nice portolio of stuff including a shader editor and water simulation written with C#.

Sadly there is no source and Max hasn't responded to my emails to make it available, I guess there is always reflector.

 

Thanks Phil

Updated 6/6/2006 8:00:00 AM by Zman

There are several FAQs that show up in the forums and newsgroups regarding floating point issues. This article should address most of them:

  1. Why does the accuracy of my calculations drop when I'm using DirectX?
    For speed DirectX switched the Floating Point Unit (FPU) on your processor into single precision mode when you create the device. .Net and other runtime libraries have no clue that this has happened, so even though you may have written all your code to use doubles everything will actually be using singles. Normally this is fine but if you have some high precision simulations or physics then you may notice a problem. The only supported solution is to use the correct CreateFlag when you create the device. There will be a performance hit though it is undocumented how much. If you entertain thoughts of modifying the FPU control bit yourselves then you should heed these warnings (See "Manipulating the Float-Point Control Word") for why its a bad idea.
  2. I'm trying to animate an object at position which is a large number and I notice that I am losing accuracy. I can only move the object in large steps.
    -or -I set a float to XXXXXX but when I read it back its value has changed to YYYYYY
    Generally this happens when people try to model which has a wide range of distances. e.g. trees on a planet are 0.01 apart and planets are 100,000 apart. At the 100,000 distances they notice that they only see animation if they move things by +/-10 whereas they can move the 0.01 things by +/-0.0001. See this thread for an example.
    This problem occurs because of a lack of understanding how floating point numbers are stored, especially if your FPU is in single precision mode. In general the larger the floating point number gets the less accurate the number it can store. For a bunch of interesting posts on floating point see Eric Lipperts 6 part series 1, 2, 3, 4, 5, 6. You may also find the floating point calculator useful for seeing which numbers can be accurately represented and which are approximated.
Updated 6/5/2006 8:00:00 AM by Zman

6/4/06 - project completion

Steven's blog is covering his University project which is using Managed Directx and C# to produce. Its something to do with modelling fractures in materials from what I can understand. (Steven has a layman's guide post specially for people like me) After some initial debate over API, he saw the light and chose what we all know to be the future! He's also British which of course gets The ZMan's seal of approval. He has a dissertation category set up if that's all you want to read.

May 2006: The project is complete and you can check out the final blog entry which contains a video, the full dissertation and a poster.

He also has some opinions on Managed DirectX, though 20% performance degradation for the rendering seems a lot more than any of us have seen. Without seeing the code or something to back up the data I remain cynical. The MeshFlags issue is a general DirectX topic rather than something specific to Managed DirectX.

Updated 6/4/2006 8:00:00 AM by Zman

6/3/06: Big update to the code

Jeremy has a great sample of how to use DirectX in a Windows Forms control. Not only that but his control provides a library of useful functions to simplify writing DirectX applications.

New features in the latest release:

  • Multi-Threaded (rendering never blocks the UI thread)
  • Synchronizes to monitor refresh for tear free drawing
  • Fixed hibernation/logout bug
  • Fixed (very rare) DirectX setup bug

Sample Code

Updated 6/3/2006 8:00:00 AM by Zman

For those of you who were wondering if they had missed the Meltdown conference this year don't worry - it didn't happen. Instead Microsoft has a later summer game conference in Seattle called Gamefest. The dates are August 14th and 15th. You can't sign up yet but you can give them an email address for announcements.

Brian Keller has previously said that the next XNA Framework announcements will be at Gamefest so lets hope everything is still on schedule for that.

Updated 6/1/2006 8:00:00 AM by Zman