Shawn Hargreaves' Blog

Game programming with the XNA Framework
0 comments
9 followers
101 entries
Advertisement
shawnhar
November 06, 2012
Beware of D3D feature level 11 in the Windows Phone emulator
Windows Phone 8 devices support Direct3D 11.1 feature level 9.3, but our emulator uses the WARP rasterizer, which can handle all the way up to feature level 11. This means that, if you aren't careful, it is possible to accidentally use more advanced D3D features while developing in the emulator, o…
1,196 views
shawnhar
November 01, 2012
Speed: in which MSDOS meets Windows Phone 8
Inspired by long standing XNA team tradition, the Windows Phone graphics team recently spent some time using our product and trying to build some apps. One of our goals in supporting native C++ was to make it easier to port existing software and frameworks to the platform, so I thought, what is th…
1,678 views
shawnhar
October 30, 2012
DirectX Tool Kit now supports Windows Phone 8
I suspect this will come as no surprise to anyone who's been paying attention to what I've been working on recently...
The latest version of DirectXTK adds support for Windows Phone 8. In fact, DirectXTK pretty much already worked on WP8, which uses the same D3D11 API as Windows 8. The only chan…
1,211 views
shawnhar
October 30, 2012
Apollo has landed
The developer SDK for Windows Phone 8 (codename Apollo) is now available for download from an internet near you. Which means I can finally talk about what I've been working on this past year! I am dev lead for graphics, so I'll probably have most to say about that area, but knowing me I'm sure I'…
1,024 views
shawnhar
October 13, 2012
DirectXTK PrimitiveBatch helper makes it easy to draw user primitives with D3D11
The latest version of DirectXTK adds a PrimitiveBatch helper, for easily and efficiently drawing dynamically generated geometry such as lines or triangles. This fills the same role as the legacy D3D9 APIs DrawPrimitiveUP and DrawIndexedPrimitiveUP. PrimitiveBatch manages the vertex and index buff…
1,566 views
shawnhar
October 02, 2012
DirectXTK October 2012 release
The DirectX Tool Kit has been updated with two new features:

  • Added a ScreenGrab module for easily saving rendertarget contents into .dds or other image formats
  • Extended GeometricPrimitive.h with a new CreateGeoSphere method (thanks to my colleague Adrian Tsai for contributing this code!)

    There ar…
1,020 views
shawnhar
July 07, 2012
DirectXTK samples?
Lots of people asking for samples for the DirectX Tool Kit - sorry I haven't had a chance to work on such a thing yet (I'm kinda busy right now getting Windows Phone 8 finished :-)
Would appreciate feedback on what platform you most want to see samples for (Win8 Metro? Classic Desktop?) and which…
1,666 views
shawnhar
June 18, 2012
DirectX Tool Kit is now on CodePlex
DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing Direct3D 11 code for Metro style apps, Windows 8 Desktop, and Windows 7 'classic' applications in C++.
Features:

  • SpriteBatch - simple & efficient 2D sprite rendering
  • SpriteFont - bitmap based text rendering
  • Effects -…
968 views
shawnhar
May 03, 2012
DirectXTK now includes SpriteFont
The DirectX Tool Kit (DirectXTK) has been updated with the addition of a SpriteFont implementation, similar to the one in XNA.
Get it here: DirectXTK.zip
Shamelessly plagiarizing the readme file:
This is a native D3D11 implementation of a bitmap font renderer, similar to the SpriteFont type from…
1,763 views
shawnhar
April 20, 2012
A reusable, reflection based command-line parser
I often find myself writing little throwaway utilities to help with other tasks, and many of these utilities need to parse command lines. There are myriad ways to do this in C#, ranging from the quick and dirty to the infinitely flexible and confusing. The middle ground approach shown here is not…
1,362 views
shawnhar
March 12, 2012
CreateThread for Windows 8 Metro
The WinRT programming environment, which is used to create Metro applications for Windows 8, replaces the old Win32 threading APIs such as CreateThread with a new ThreadPool::RunAsync API. This is generally a good thing (ThreadPool is better than CreateThread for several reasons) but it can be a p…
2,984 views
shawnhar
March 02, 2012
SpriteBatch and BasicEffect for C++ Direct3D 11
Over the Christmas break I spent some time porting the built-in XNA effects (BasicEffect, SkinnedEffect, etc.) to native C++ using Direct3D 11. Finding that strangely enjoyable, I went on to make a C++ version of SpriteBatch, and also ported the XNA Primitives 3D sample, built-in state objects, an…
2,383 views
shawnhar
January 20, 2012
Bloom on Windows Phone
Ok, silliness aside, is it possible to implement an efficient bloom effect on Windows Phone without custom shaders?
Bloom consists of three operations:
  • Identify which parts of the image should be bloomed
  • Blur those parts
  • Combine blurred bloomy bits with the original image

    There are many choices fo…
  • 1,615 views
    shawnhar
    January 19, 2012
    Voting results are in!
    Thanks for the comments about what I should write about next. Hopefully I managed to count these more accurately than the Iowa Republican party :-) C++ 16 How GPU's work 11 3D math 10 …
    904 views
    shawnhar
    December 29, 2011
    Is SpriteBatch Turing complete?
    Time for some end-of-year silliness...
    Inspired by this recent Twitter exchange:
    Scionwest - @shawnhargreaves @nickgravelyn How about post processing for WP7? I've seen people do Bloom effects and thought P.P. was not part of WP7?
    nickgravelyn - @Scionwest Shaders aren't available, but I've…
    1,783 views
    shawnhar
    December 29, 2011
    What should I write about next?
    I have a couple more articles planned about aliasing and motion blur, but am curious to hear where you would like me to take this blog next.
    Some topics I am considering:
    C++. Dirty secret: although I've mostly blogged about C# programming, much of XNA itself is written in C++, so I've actually …
    1,391 views
    shawnhar
    December 14, 2011
    From games to telephones
    After six years working on XNA, I decided it was time to take on a new challenge. I am moving to the Windows Phone team, where I will be working on things I'm not sure how much I can say about here (leaking future business plans on MSDN might not be the best way to endear myself to my new boss :-…
    711 views
    shawnhar
    November 19, 2011
    Temporal sampling frequency (aka 'framerate')

    Game player: "d00d, teh framerate totally sux0rz!"
    Game developer: "we are experiencing aliasing due to low sampling frequency along the temporal axis..."
    One of the many decisions that goes into making a game is whether it is better to run at a high framerate, which means drawing many fr…
    823 views
    shawnhar
    November 08, 2011
    Stand still and they won't see you
    So far I have written about aliasing in the context of rendering single images, but neglected to consider what happens when we string a series of images together, attempting to create the illusion of smooth motion. Animation introduces the temporal (time) axis, which we sample by rendering frames …
    681 views
    shawnhar
    November 01, 2011
    Shader aliasing
    Looking through my backlog of half written articles, I realized I have a couple more topics in my series about antialiasing, which I had entirely forgotten about! Oops...
    Actually, though, today is a good day to finish this article. Forget your ghosts, ghouls, and goblins, for I have something R…
    1,204 views
    shawnhar
    October 25, 2011
    RIP John McCarthy
    What a sad month for those of us who program computers.
    Take a moment to reflect on this paper, published in April 1960:
    No provision need be made for the user to program the return of registers to the free-storage list.
    This return takes place automatically, approximately as follows (it i…
    662 views
    shawnhar
    October 18, 2011
    Silverlight 3D and the composition thread

    A simple test
    Load the Silverlight 5 port of the XNA bloom sample (which you can find in c:/Program Files (x86)/Microsoft SDKs/Silverlight/v5.0/Toolkit/Sep11/Source/Sample source code.zip/Xna after installing the Silverlight toolkit). Run it, and observe the shiny tank.

    Now open up MainPage.xaml…
    966 views
    shawnhar
    October 17, 2011
    Game timing in Silverlight 5
    One thing missing from the new 3D functionality in Silverlight 5 is an equivalent of the XNA Game class. I previously wrote about how to provide XNA style Update and Draw methods in a WinForms environment. What is the Silverlight equivalent of that?

    After installing the Silverlight Toolkit, crea…
    903 views
    shawnhar
    October 07, 2011
    Silverlight 5 version of Ito's XNA AppWeek game
    Could this be the first ever 3D Silverlight game?

    My colleague Ito ported the rail shooter that he originally wrote for AppWeek 2010 to use the new 3D features in Silverlight 5. First get the SL5 RC plugin (if you don't have it already). Then play the game here.

    Once the intro animation finishe…
    765 views
    shawnhar
    October 06, 2011
    Silverlight 5 brings XNA 3D to the web
    I have been remiss in not mentioning this on my blog before, but if you are an XNA developer who hasn't been paying attention to Silverlight 5, now might be a good time to start!

    A quick history:

    1,202 views
    shawnhar
    July 07, 2011
    Content pipeline builds no longer need a D3D device starting in the XNA Game Studio 4.0 Refresh Beta 2
    (shamelessly stealing the title of a post by my colleague Aaron)

    In fact, why don't I let him provide the content as well as title:

    http://blogs.msdn.com/b/astebner/archive/2011/07/07/10184338.aspx



    Source
    715 views
    shawnhar
    July 07, 2011
    XNB file format documentation
    Recent silence notwithstanding, I'm still here, and will have more to say about aliasing as soon as I find myself less busy!

    In the meantime, check out this latest App Hub release: http://create.msdn.com/en-US/sample/xnb_format

    This article documents the format of the compiled data files (.xn…
    2,038 views
    shawnhar
    June 06, 2011
    Reza's blog
    My colleague Reza recently started a blog at http://blogs.msdn.com/b/rezanour. He already has some good posts about vector math, and is a smart guy so I'm betting will be writing many interesting things in the future :-)



    Source
    760 views
    shawnhar
    May 18, 2011
    Geometry aliasing
    Back when multisampling first showed up, GPU hardware was slow, so triangle counts were low. Complex curved shapes were approximated by a small number of faceted triangles, each of which was big enough to cover many screen pixels.

    This created an odd situation where early articles about multisamp…
    824 views
    shawnhar
    May 06, 2011
    Antialiasing alpha cutouts
    Alpha cutouts (where you use the alpha channel of a texture to determine the shape of a sprite or billboard) are the cause of many an aliasing problem. There are basically two ways to do alpha cutouts, both tragically flawed.




    Alpha blended cutouts
    As long as you start with high quality source …
    1,024 views
    Advertisement

    Popular Blogs

    shawnhar
    Generalist
    101 Entries
    9 Followers
    15 Entries
    10 Followers
    johnhattan
    Programmer
    1,277 Entries
    47 Followers
    ApochPiQ
    Generalist
    628 Entries
    44 Followers
    dgreen02
    Generalist
    338 Entries
    56 Followers
    Advertisement