What's New in XNA Game Studio 4.0
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
- Developing Windows Phone Games
- Describes how to develop games for Windows Phone.
- Migrating from Zune to Windows Phone
- Discusses how to migrate games written for Zune and Zune HD on XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0 Refresh.
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
- Retrieving Accelerometer Input (Windows Phone)
- Demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows Phone.
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
- Writing Data (Windows Phone)
- Describes how to save game data on Windows Phone.
- Adding Game Data Files to Title Storage
- Describes how to add game data files to the title storage location.
- Reading Game Data from Title Storage
- Describes how to load game data from the title storage location.
- XML Elements for XMLImporter
- Describes the elements of an XML file that can be processed by the XmlImporter Class.
- Adding an XML Content File to a Visual Studio Project
- Describes how to add custom game data as an XML file through the Content Pipeline.
- Loading XML Content at Runtime
- Describes how to load custom game data at game runtime through the Content Pipeline.
- Using an XML File to Specify Content
- Describes how to use XML files for custom game data through the Content Pipeline.
- Creating an XML File
- Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.
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
- GraphicsDeviceInformation.GraphicsProfile Property
- Gets the graphics profile, which determines the graphics feature set.
- GraphicsDeviceManager.GraphicsProfile Property
- Gets the graphics profile, which determines the graphics feature set.
- GraphicsAdapter.IsProfileSupported Method
- Tests to see if the adapter supports the requested profile.
- ContentWriter.TargetProfile Property
- Gets or sets the target graphics profile.
- ContentProcessorContext.TargetProfile Property
- Gets the current content build target profile.
- BuildContent.TargetProfile Property
- Gets or sets the target graphics profile.
- BuildXact.TargetProfile Property
- Gets or sets the target graphics profile.
- CleanContent.TargetProfile Property
- Gets or sets the target graphics profile.
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
- Creating a Custom Effect
- Demonstrates how to create a custom effect that transforms an object and applies a texture.
Reference
- BasicEffect Class
- Contains a basic rendering effect.
- SkinnedEffect Class
- Contains a configurable effect for rendering skinned character models.
- EnvironmentMapEffect Class
- Contains a configurable effect that supports environment mapping.
- DualTextureEffect Class
- Contains a configurable effect that supports two-layer multitexturing.
- AlphaTestEffect Class
- Contains a configurable effect that supports alpha testing.
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
- Creating a State Object
- Demonstrates how to create a state object using any of the state object classes: BlendState, DepthStencilState, RasterizerState, or SamplerState.
ConceptsReference
- 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.
- BlendState Class
- Contains blend state for the device.
- DepthStencilState Class
- Contains depth-stencil state for the device.
- GraphicsDevice.RasterizerState Property
- Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
- SamplerState Class
- Contains sampler state, which determines how to sample texture data.
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
- DisplayOrientation Enumeration
- Defines the display orientation.
- PresentationParameters.DisplayOrientation Property
- Gets or sets the orientation of the display. The default value is DisplayOrientation.Default, which means orientation is determined automatically from your BackBufferWidth and BackBufferHeight.
- GraphicsDeviceManager.SupportedOrientations Property
- Gets or sets the display orientations that are available if automatic rotation and scaling is enabled.
- GraphicsDeviceManager.DefaultBackBufferHeight Field
- Specifies the default minimum back-buffer height.
- GameWindow.CurrentOrientation Property
- Gets the current display orientation, which reflects the physical orientation of the phone in the user's hand.
- GameWindow.OrientationChanged Event
- Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.
- GameWindow.OnOrientationChanged Method
- Called when the GameWindow display orientation changes.
- GameWindow.SetSupportedOrientations Method
- Sets the supported display orientations.
- TouchPanel.DisplayOrientation Property
- Gets or sets the display orientation of the touch panel.
- TouchPanel.DisplayWidth Property
- Gets or sets the display width of the touch panel.
- TouchPanel.DisplayHeight Property
- Gets or sets the display height of the touch panel.
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
- Working with Touch Input (Windows Phone)
- Demonstrates how to detect and use multitouch input in an XNA game.
Reference
- Microsoft.Xna.Framework.Input.Touch
- Contains classes that enable access to touch-based input on devices that support it.
- TouchPanel
- Provides methods for retrieving touch panel device information.
- TouchPanelCapabilities
- Provides access to information about the capabilities of the touch input device.
- TouchLocation
- Provides methods and properties for interacting with a touch location on a touch screen device.
- TouchLocationState
- Defines the possible states of a touch location.
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
- Microphone Class
- Provides properties, methods, and fields and events for capturing audio data with microphones.
- DynamicSoundEffectInstance Class
- Provides properties, methods, and events for play back of the audio buffer.
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
- Playing a Song from a URI
- Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).
Reference
- Song.FromUri Method
- Constructs a new Song object based on the specified URI.
- MediaLibrary.SavePicture Method
- Saves the image to the media library.
New Classes and Methods
Microsoft.Xna.Framework
Color has moved from the Microsoft.Xna.Framework.Graphics namespace to Microsoft.Xna.Framework.
- Color Structure
- Represents a four-component color using red, green, blue, and alpha data.
- GraphicsDeviceInformation.GraphicsProfile Property
- Gets the graphics profile, which determines the graphics feature set.
- GraphicsDeviceManager.GraphicsProfile Property
- Gets the graphics profile, which determines the graphics feature set.
- TitleContainer Class
- Provides file stream access to the title's default storage location.
Microsoft.Xna.Framework.Audio
- DynamicSoundEffectInstance Class
- Provides properties, methods, and events for play back of the audio buffer.
- Microphone Class
- Provides properties, methods, and fields and events for capturing audio data with microphones.
- NoMicrophoneConnectedException Class
- The exception that is thrown when Microphone API calls are made on a disconnected microphone.
- AudioChannels Enumeration
- Defines the number of channels in the audio data.
- MicrophoneState Enumeration
- Current state of the Microphone audio capture (started or stopped).
- SoundEffect.FromStream Method
- Creates a SoundEffect object based on the specified data stream.
- SoundEffect.GetSampleDuration Method
- Returns the sample duration based on the specified sample size and sample rate.
- SoundEffect.GetSampleSizeInBytes Method
- Returns the size of the audio sample based on duration, sample rate, and audio channels.
Microsoft.Xna.Framework.Input.Touch
- Microsoft.Xna.Framework.Input.Touch Namespace
- Contains classes that enable access to touch-based input on devices that support it.
Microsoft.Xna.Framework.Media
- Album.GetAlbumArt Method
- Returns the stream that contains the album art image data.
- MediaLibrary.SavePicture Method
- Saves the image to the media library.
- Picture.GetImage Method
- Returns the stream that contains the image data.
- Picture.GetThumbnail Method
- Returns the stream that contains the picture's thumbnail image data.
- Song.FromUri Method
- Constructs a new Song object based on the specified URI.
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
- StorageDevice.BeginShowSelector Method
- Overloaded methods for showing the storage device selector asynchronously.
- StorageDevice.EndShowSelector Method
- Ends the display of the storage selector user interface.
Microsoft.Xna.Framework.Content.Pipeline
Effect compilation from the Framework to the Content Pipeline.
In This Section
- ContentWriter.TargetProfile Property
- Gets or sets the target graphics profile.
- AlphaTestMaterialContent Class
- Provides properties for modifying an effect that supports alpha testing.
- DualTextureMaterialContent Class
- Provides properties for modifying an effect that supports two-layer multitexturing.
- EffectMaterialContent.CompiledEffect Property
- Gets or sets the compiled Effect.
- EnvironmentMapMaterialContent Class
- Provides properties for modifying an effect that supports environment mapping.
- SkinnedMaterialContent Class
- Provides properties for modifying an effect for rendering skinned character models.
- ContentImporterContext Constructor
- Initializes a new instance of ContentImporterContext.
- ContentProcessorContext Constructor
- Initializes a new instance of ContentProcessorContext.
- ContentProcessorContext.TargetProfile Property
- Gets the current content build target profile.
- EffectImporter Class
- Provides methods for reading effect (.fx) files for use in the Content Pipeline.
- FbxImporter Class
- Provides methods for reading AutoDesk (.fbx) files for use in the Content Pipeline.
- Mp3Importer Class
- Provides methods for reading MP3 audio files for use in the Content Pipeline.
- TextureImporter Class
- Provides methods for reading texture files for use in the Content Pipeline.
- WavImporter Class
- Provides methods for reading .wav audio files for use in the Content Pipeline.
- WmaImporter Class
- Provides methods for reading Windows Media Audio (.wma) files for use in the Content Pipeline.
- WmvImporter Class
- Provides methods for reading Windows Media Video (.wmv) files for use in the Content Pipeline.
- XImporter Class
- Provides methods for reading DirectX Object (.x) files for use in the Content Pipeline.
- TargetPlatform Enumeration
- Identifiers for the target platform.
- CompiledEffectContent Class
- Represents a compiled Effect.
- EffectProcessor.DebugMode Property
- The debug mode for compiling effects.
- EffectProcessor.Defines Property
- Define assignments for the effect.
- FontTextureProcessor.PremultiplyAlpha Property
- Specifies whether alpha premultiply of font textures is enabled.
- MaterialProcessor.DefaultEffect Property
- The default effect type for this instance of MaterialProcessor.
- MaterialProcessor.PremultiplyTextureAlpha Property
- Specifies whether alpha premultiply of textures is enabled.
- ModelMeshPartContent.IndexBuffer Property
- Gets the index buffer associated with this mesh part.
- ModelMeshPartContent.VertexBuffer Property
- Gets the vertex buffer associated with this mesh part.
- ModelMeshPartContent.VertexOffset Property
- Gets the offset, in bytes, from the first index of the of vertex buffer for this mesh part.
- ModelProcessor.DefaultEffect Property
- The default effect type for this instance of ModelProcessor.
- ModelProcessor.PremultiplyTextureAlpha Property
- Specifies whether alpha premultiply of textures is enabled.
- TextureProcessor.PremultiplyAlpha Property
- Specifies whether alpha premultiply of textures is enabled.
- VertexBufferContent.VertexDeclaration Property
- Gets the associated VertexDeclarationContent object.
- BuildContent.TargetProfile Property
- Gets or sets the target graphics profile.
- BuildXact.TargetProfile Property
- Gets or sets the target graphics profile.
- CleanContent.TargetProfile Property
- Gets or sets the target graphics profile.
Microsoft.Xna.Framework.Graphics
- New overloads to SpriteBatch.Begin provide an explicit way to draw sprites with a custom pixel shader.
- VertexBuffers are now strongly typed. VertexDeclaration usage has changed in XNA Game Studio 4.0. Each VertexBuffer now has an associated VertexDeclaration, which becomes immutable after the buffer is created, allowing for the XNA Framework to automatically adjust the bit layout of vertex data as required for different platforms.
- BlendState Class
- Contains blend state for the device.
- DepthStencilState Class
- Contains depth-stencil state for the device.
- GraphicsDevice.RasterizerState Property
- Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
- SamplerState Class
- Contains sampler state, which determines how to sample texture data.
- AlphaTestEffect Class
- Contains a configurable effect that supports alpha testing.
- BasicEffect Class
- Contains a basic rendering effect.
- DirectionalLight Class
- Creates a DirectionalLight object.
- DualTextureEffect Class
- Contains a configurable effect that supports two-layer multitexturing.
- Effect.Clone Method
- Copies data from an existing object to this object.
- Effect.OnApply Method
- Applies the effect state just prior to rendering the effect.
- EffectMaterial Class
- Contains an effect subclass which is used to load data for an EffectMaterialContent type.
- EffectPass.Apply Method
- Begins this pass.
- EnvironmentMapEffect Class
- Contains a configurable effect that supports environment mapping.
- GraphicsAdapter.IsProfileSupported Method
- Tests to see if the adapter supports the requested profile.
- GraphicsAdapter.QueryBackBufferFormat Method
- Queries the adapter for support for the requested back buffer format.
- GraphicsAdapter.QueryRenderTargetFormat Method
- Queries the adapter for support for the requested render target format.
- GraphicsAdapter.UseNullDevice Property
- Gets or sets a NULL device.
- GraphicsAdapter.UseReferenceDevice Property
- Gets or sets a reference device.
- GraphicsDevice.Clear Method
- Clears resource buffers.
- GraphicsDevice.DrawInstancedPrimitives Method
- Draws a series of instanced models.
- GraphicsDevice.DrawUserIndexedPrimitives Method
- Renders geometric primitives.
- GraphicsDevice.DrawUserPrimitives Method
- Renders geometric primitives.
- GraphicsDevice.GetBackBufferData Method
- Gets the contents of the back buffer.
- GraphicsDevice.GetRenderTargets Method
- Gets a render target surface.
- GraphicsDevice.GetVertexBuffers Method
- Gets the vertex buffers.
- GraphicsDevice.SetRenderTargets Method
- Sets an array of render targets.
- GraphicsDevice.SetVertexBuffer Method
- Sets or binds a vertex buffer to a device.
- GraphicsDevice.SetVertexBuffers Method
- Sets the vertex buffers.
- GraphicsDevice.Adapter Property
- Gets the graphics adapter.
- GraphicsDevice.BlendFactor Property
- Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.
- GraphicsDevice.BlendState Property
- Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
- GraphicsDevice.DepthStencilState Property
- Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
- GraphicsDevice.GraphicsProfile Property
- Gets the graphics profile. The default value is GraphicsProfile.Reach.
- GraphicsDevice.MultiSampleMask Property
- Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
- GraphicsDevice.ReferenceStencil Property
- Gets or sets a reference value for stencil testing. The default value is zero.
- IEffectFog Interface
- Gets or sets fog parameters for the current effect.
- IEffectLights Interface
- Gets or sets lighting parameters for the current effect.
- IEffectMatrices Interface
- Gets or sets transformation matrix parameters for the current effect.
- IndexBuffer.IndexCount Property
- Gets the number of indices in this buffer.
- IVertexType Interface
- Vertex type interface which is implemented by a custom vertex type structure.
- Model.Draw Method
- Render a model after applying the matrix transformations.
- ModelMeshPart.IndexBuffer Property
- Gets the index buffer for this mesh part.
- ModelMeshPart.VertexBuffer Property
- Gets the vertex buffer for this mesh part.
- ModelMeshPart.VertexOffset Property
- Gets the offset (in vertices) from the top of vertex buffer.
- NoSuitableGraphicsDeviceException Class
- Thrown when no available graphics device fits the given device preferences.
- PresentationParameters.Bounds Property
- Gets the size of this resource.
- PresentationParameters.DepthStencilFormat Property
- Gets or sets the depth stencil data format.
- PresentationParameters.MultiSampleCount Property
- Gets or sets a value indicating the number of sample locations during multisampling.
- RasterizerState Class
- Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).
- RenderTarget2D Class
- Contains a 2D texture that can be used as a render target.
- RenderTargetBinding Structure
- Binds an array of render targets.
- RenderTargetCube Class
- Represents a cubic texture resource that will be written to at the end of a render pass.
- SkinnedEffect Class
- Contains a configurable effect for rendering skinned character models.
- SpriteBatch.Begin Method
- Begins a sprite batch operation.
- SpriteBatch.Dispose Method
- Releases unmanaged resources used by this object.
- SpriteBatch.DrawString Method
- Adds a string to a batch of sprites to be rendered.
- SpriteBatch.Draw Method
- Adds a sprite to a batch of sprites to be rendered.
- SpriteFont Class
- Represents a font texture.
- Texture.Format Property
- Gets the format of the texture data.
- Texture2D Constructor
- Creates an uninitialized Texture2D resource of the specified dimensions. To initialize a Texture2D from an existing file, see the static method ContentManager.Load.
- Texture2D.FromStream Method
- Methods for loading an image.
- Texture2D.SaveAsJpeg Method
- Saves texture data as a .jpg.
- Texture2D.SaveAsPng Method
- Saves texture data as a .png.
- Texture2D.SetData Method
- Sets data to the texture.
- Texture2D.Bounds Property
- Gets the size of this resource.
- Texture3D Constructor
- Creates a new instance of this object.
- Texture3D.SetData Method
- Sets data.
- VertexBuffer Constructor
- Creates an instance of this object.
- VertexBuffer.VertexCount Property
- Gets the number of vertices.
- VertexBuffer.VertexDeclaration Property
- Defines per-vertex data in a buffer.
- VertexBufferBinding Structure
- Binding structure that specifies a vertex buffer and other per-vertex parameters (such as offset and instancing) for a graphics device.
- VertexDeclaration Class
- A vertex declaration, which defines per-vertex data.
- VertexElement Constructor
- Initializes a new instance of the VertexElement class.
- VertexPositionColor Constructor
- Initializes a new instance of the VertexPositionColor class.
- VertexPositionColor.Color Field
- The vertex color.
- VertexPositionColor.Position Field
- XYZ position.
- VertexPositionColor.VertexDeclaration Field
- Vertex declaration, which defines per-vertex data.
- VertexPositionColorTexture Structure
- Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
- VertexPositionNormalTexture Structure
- Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
- VertexPositionTexture Structure
- Describes a custom vertex format structure that contains position and one set of texture coordinates.
- Viewport Constructor
- Creates an instance of this class.
- Viewport.Bounds Property
- Gets the size of this resource.
- GraphicsProfile Enumeration
- Identifies the set of supported devices for the game based on device capabilities.
New In the XNA Game Studio Preview Refresh
New Code Samples, Conceptual Content, and Tutorials
Media
- Playing a Song from a URI
- Demonstrates how to use the MediaPlayer to play a song from a Uniform Resource Identifier (URI).
Storage and Content Pipeline
- Writing Data (Windows Phone)
- Describes how to save game data on Windows Phone.
- Adding Game Data Files to Title Storage
- Describes how to add game data files to the title storage location.
- Reading Game Data from Title Storage
- Describes how to load game data from the title storage location.
- XML Elements for XMLImporter
- Describes the elements of an XML file that can be processed by the XmlImporter Class.
- Adding an XML Content File to a Visual Studio Project
- Describes how to add custom game data as an XML file through the Content Pipeline.
- Loading XML Content at Runtime
- Describes how to load custom game data at game runtime through the Content Pipeline.
- Using an XML File to Specify Content
- Describes how to use XML files for custom game data through the Content Pipeline.
- Creating an XML File
- Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.
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
- Drawing 3D Primitives using Lists or Strips
- Demonstrates how to draw 3D primitives using lines and triangles arranged as strips or lists.
- Using a Basic Effect with Texturing
- Demonstrates how to create and draw a simple quad—two triangles that form a rectangle or square—using DrawUserIndexedPrimitives.
- Creating a Custom Effect
- Demonstrates how to create a custom effect that transforms an object and applies a texture.
- Loading Content Within a Game Library
- Demonstrates how to load content within a Game Library.
- Animating a Sprite
- Demonstrates how to animate a sprite from a texture using a custom class.
- What Is a Sprite?
- Summarizes the basics of using sprites.
- Drawing a Masked Sprite over a Background
- Demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of the foreground sprite masks the background.
- Drawing Text with a Sprite
- Demonstrates how to import a SpriteFont into a project and to draw text using DrawString.
- Making a Scrolling Background
- Demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
- Rotating a Sprite
- Demonstrates how to rotate a sprite around its center.
- Rotating a Group of Sprites
- Demonstrates how to rotate a group of sprites around a single point.
- Scaling a Sprite
- Demonstrates how to scale a sprite using a uniform scale.
- Scaling Sprites Based On Screen Size
- Demonstrates how to scale sprites using a matrix that is created based on the viewport width.
- Tinting a Sprite
- Demonstrates how to tint a sprite using a Color value.
- Dynamically Updating Vertex Data
- Describes techniques for dynamically updating vertex data in an XNA Framework game.