What's New in XNA Game Studio 4.0

Describes new features and changes in XNA Game Studio 4.0.

  • Overview of New Features
  • New Classes and Methods
  • New In the XNA Game Studio Preview Refresh

Overview of New Features

  • Develop Games for Windows Phone
  • Leverage Windows Phone-specific Features Through Silverlight
  • Simplified Graphics Interfaces
  • Configurable Effects
  • Built-in State Objects
  • System Support for Scalars and Orientation
  • Cross-Platform Input API
  • Enhanced Audio Support
  • Music and Picture Enumeration and Video Playback

Develop Games for Windows Phone

XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support for Windows Phone, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the same code base. It also allows developers to focus game design for each platform on real device differences such as capabilities and experience, as opposed to writing with different frameworks for each targeted device.

Tasks

Leverage Windows Phone-specific Features Through Silverlight

When you develop games for Windows Phone, you can leverage platform-specific features such as location, accelerometer, and vibration interfaces that are provided through Silverlight 4.0. Similarly, most of the XNA Framework can be accessed from Silverlight applications.

Tasks

On Windows Phone, writable user storage is handled by Silverlight, not by XNA Game Studio. You can use the XNA Game Studio content pipeline to preprocess read-only game assets that are accessed by the content manager at run time.

Concepts

  • What Is Storage?
    Storage refers to memory locations used for reading and writing data.

Tasks

Simplified Graphics Interfaces

XNA Game Studio 4.0 introduces the concept of XNA Framework profiles. These profiles (Reach and HiDef) allow you to create a clear development environment while targeting broadly or for specific platform releases. The Reach profile is designed for compatibility across the largest possible range of devices, including Windows Phone, Windows-based PCs, and Xbox 360 consoles. Choosing the HiDef platform in your development environment allows you to use platform showcase features.

Both the Reach and HiDef profiles are hardware accelerated.

Concepts

  • What Is a Profile?
    A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.

Reference

Configurable Effects

Game Studio 4.0 introduces new and updated configurable effects that will add more variety to your rendering options. These configurable effects are available for both Reach and HiDef profiles and for all platforms, including Windows Phone, Windows-based PCs, and Xbox 360 consoles.

  • Basic Effects—A basic effect includes transforms and basic lighting for Blinn-Phong shading. You have the option of adding up to three more directional lights, fog, and a texture. Use one light for the fastest performance, and use three lights for more interesting 3D lighting.
  • Dual-Texture Effects—A dual-texture effect uses two textures with two independent sets of texture coordinates. When you blend the two textures, you generate a lot more visual complexity if the first texture contains the basic color or detail, and the second texture contains complex lighting.
  • Alpha-Test Effects—An alpha-test effect uses a reference alpha and an alpha function to implement alpha testing. This can greatly improve rendering performance by only updating pixels where objects are being drawn in a scene. Alpha testing is common when depth/stencil buffers are not used.
  • Skinned Effects—A skinned effect uses bones and weights to influence vertex positions, that is, to move or deform an object. This works very well for character animation and instancing. The effect supports up to 72 bones, with up to 4 weights per bone.
  • Environment-Map Effects—An environment-map effect uses a diffuse texture to color or detail an object, and a cube map texture containing an environment map to shade the object as a result of the environment. Because the object reflects the scene, this makes the object look more like it is in a real scene. Also, you can use the fresnel parameter to tune the amount of light reflected (shininess) based on the geometry of the surface.

Concepts

  • What Is a Configurable Effect?
    A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.
  • What Is an Effect?
    An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.

Tasks

Reference

Built-in State Objects

Many of the individual state properties have been replaced with a more organized set of immutable state objects. There are fewer states to manage.

Tasks

ConceptsReference

System Support for Scalars and Orientation

With new system support for scalars and orientation, you can write your game without worrying about native resolution or orientation. Scalars can significantly improve game performance. This support comes automatically when you use the XNA Framework.

Reference

Cross-Platform Input API

While the design of an input strategy for your game is likely to be highly specific to a particular game or device experience, the XNA Framework provides a cross-platform input interface where an input capability is likely to be available across multiple platforms. In this release, multitouch support has been added for Windows and Windows Phone-based applications that use the XNA Framework. The XNA Framework input classes are orientation-aware and resolution-aware, allowing for greater portability of code and fewer #ifdefs in your game design.

Tasks

Reference

Enhanced Audio Support

The XNA Framework Audio namespace now allows for audio capture and playback through the Microphone and DynamicSoundEffect classes. You now have the ability to play back synthesized or buffered audio, to capture audio through a microphone or Bluetooth headset, and to play it through a headset or speakers.

Reference

Music and Picture Enumeration and Video Playback

You can now do the following:

  • Use a uniform resource location to play songs.

  • Select, edit, and publish photos.

  • Play back video by using an interface that allows you to show or hide the video controls.

Tasks

Reference

New Classes and Methods

Microsoft.Xna.Framework

Color has moved from the Microsoft.Xna.Framework.Graphics namespace to Microsoft.Xna.Framework.

Microsoft.Xna.Framework.Audio

Microsoft.Xna.Framework.Input.Touch

Microsoft.Xna.Framework.Media

Microsoft.Xna.Framework.Graphics.PackedVector

  • Bgra4444 Structure
    Packed vector type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w.

Microsoft.Xna.Framework.Storage

Storage device selection has moved from the GamerServices namespace to the Storage namespace.

Microsoft.Xna.Framework.Content.Pipeline

Effect compilation from the Framework to the Content Pipeline.

In This Section

Microsoft.Xna.Framework.Graphics

New In the XNA Game Studio Preview Refresh

  • New Code Samples, Conceptual Content, and Tutorials
  • New Samples Upgraded to XNA Game Studio 4.0

New Code Samples, Conceptual Content, and Tutorials

Media

Storage and Content Pipeline

Graphics

  • What Is Blend State?
    Blend state controls how color and alpha values are blended when combining rendered data with existing render target data.
  • What Is Depth Stencil State?
    Depth stencil state controls how the depth buffer and the stencil buffer are used.
  • What Is a Back Buffer?
    A back buffer is a render target whose contents will be sent to the device when GraphicsDevice.Present is called.
  • What Is a Configurable Effect?
    A configurable effect is an optimized rendering effect designed for Windows, Xbox 360, and Windows Phone. A configurable effect is created using a built-in object with options for user configuration.
  • What Is an Effect?
    An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.
  • What Is a Profile?
    A profile is a feature set that is implemented in hardware. The Reach profile implements high-level shader language (HLSL) Shader Model 2.0 and the HiDef profile implements HLSL Shader Model 3.0.
  • What Is Rasterizer State?
    Rasterizer state determines how to render 3D data such as position, color, and texture onto a 2D surface.
  • What Is a Render Target?
    A render target is a memory buffer for rendering pixels. One common use for a render target is offscreen rendering.
  • What Is Sampler State?
    Sampler state determines how texture data is sampled using texture addressing modes, filtering, and level of detail.
  • What Is a View Frustum?
    A view frustum is a 3D volume that defines how models are projected from camera space to projection space. Objects must be positioned within the 3D volume to be visible.
  • What Is a Viewport?
    A viewport is a 2D rectangle that defines the size of the rendering surface onto which a 3D scene is projected.

New Samples Upgraded to XNA Game Studio 4.0