Monthly Archives: July 2004

It’s almost time for Meltdown!

Like Mitch mentions, I’ll be giving a talk at Meltdown this week (both Tuesday and Wednesday) on using Managed Code in gaming.  For those of you who won’t be attending the conference, the talk’s slides will most likely be posted on MSDN shortly after the conference is over.

It will be a good time.

The Summer 2004 SDK Update For DirectX has been released..

– Official announcement – DX Web site should be updated soon..
The DirectX(r) Team is pleased to announce the final release of DirectX 9.0 SDK Update (Summer 2004)!
The DirectX 9.0 SDK Update (Summer 2004) contains updated versions of the D3DX library, graphics samples, sample framework, tools and Managed DirectX documentation. Areas of concentration in the DirectX 9.0 SDK Update (Summer 2004) release are:
- HLSL support for Pixel Shader & Vertex Shader 3.0
– Effects Framework performance improvements
– Pre computed Radiance Transfer improvements
– New Sample framework
– New & Updated Samples
– Improved Documentation
– PIX tool for better debugging of Direct3D applications
– Introduction of the Preview Pipeline for easier content creation
For information on what is supported in shader model 3.0, refer to the updated reference documentation. You can install the final releases from the below locations.
Software Developer Kit (230Mb+)
Extras (40Mb+)

Symbols (20Mb+)

Release Notes
Please feel free to post any concerns and/or discuss any issues with this SDK release within this forum, the public newsgroups or mail us directly at

Moving Day!!!

Hard to believe that in a little less than 20 hours I’ll be moved into our new house.  While the wait between signing the papers to have the house constructed (November of last year) until now has seemed to take eons upon eons to get here, in reality, it hasn’t been that long at all..  And now that the day has finally arrived, and my current house is virtually completely packed (aside from my computer of course), it’s definitely a lot harder to believe than I imagined it would be.

Look at it now!

Amazing how quickly these things happen.  Now, the fun of moving and unpacking begins.  Somehow I think these things will be much less exciting once the move is complete.

Why are these textures taking up so much memory..

Someone on the newsgroups was recently asking why loading his simple 800×600 texture was taking up so much memory (more than 5 megs).  He was using code something like the following:

Texture myTexture = TextureLoader.FromFile(myDevice, somePath);

The quest seemed interesting enough for me to post my response here as well as in the newsgroup since this reinforces my belief that you should always know what the methods you’re calling ‘cost’.  It wouldn’t surprise me to find out that most people don’t realize all the things that go in with that simple line above.

So here was my response:

First, if you’re texture is really 800×600, using this overload (TextureLoader.FromFile) will ‘upscale’ the texture so that it is square and a power of two, in this case, 1024×1024..  Assuming 32bit color for each pixel, the default mip level would be:
1024x1024x4 = 4 megs of pixel data.
Now, this overload would also create a mipmap chain down to 1×1, so you would also have:
512x512x4 = 1 meg of pixel data
256x256x4 = 256k of pixel data
128x128x4 = 64k of pixel data
64x64x4 = 16k of pixel data
32x32x4 = 4k of pixel data
16x16x4 = 1k of pixel data
8x8x4 = 256 bytes of pixel data
4x4x4 = 64 bytes of pixel data
2x2x4 = 16 bytes of pixel data
1x1x4 = 4 bytes of pixel data
So, add it all up, and each texture you load would take (on average) 5.6 megs of pixel data..  So the numbers make sense to me..

Now that the Whidbey Beta is out, what about Managed DirectX?

With the release of the Whidbey (err, I mean Visual Studio.NET 2005) beta a few weeks ago, my thoughts have drifted towards how Managed DirectX may work in this new release.  For those of you who haven’t seen VS2005, or the new CLR, the changes there are magnificent.  Across the board, improvements have been made, and the thing is looking wonderful.

So my thoughts roll over to MDX, and I think to myself, “Self: wouldn’t it be awesome if we took advantage of some of those features?”  Who wouldn’t want to declare the vertex data they’re about to use like:

VertexBuffer<PositionNormal> vb = null;
IndexBuffer<short> ib = null;

Of course that just scratches the surface of the possibilities that would lie in a VS2005 specific version of Managed DirectX.  Which begs the question, what do you think?