Export (0) Print
Expand All

Parameterized Processors

Describes how parameterized processors work in XNA Game Studio. Many of the standard Content Pipeline content processors shipped with XNA Game Studio support parameter usage. Parameterization makes any standard or custom processor more flexible and better able to meet the needs of your XNA Framework application. In addition to specifying values for standard parameters, you can easily implement parameter support for a new or existing custom processor. For more information, see Developing with Parameterized Processors.

When you select a game asset, the Properties window displays the parameters for the related asset processor. Use the Properties window at any time to modify these parameter values.

Bb975255.note(en-us,XNAGameStudio.31).gifNote
If you change the processor for a game asset to a different processor, all parameter values are reset to their default values. This means that if you modify the Generate Mipmaps parameter value for the TextureProcessor, then switch to a different processor (for example, FontTextureProcessor Class), the parameters would be switched to the default values for that processor. If you then swith back again, the modified values are reset to the default values of the original processor. The values do not revert to the modified values you set originally.

Standard Parameterized Processors

The following table describes only standard processors that accept parameters, the parameter types, and their default value. For more information on all standard processors, see Standard Importers and Processors.

Friendly NameType NameInput TypeOutput TypeDescription
Model - XNA Framework ModelProcessor NodeContent Class ModelContent Class

A parameterized processor that outputs models as a ModelContent Class object.

Available parameters:

  • Color Key Color—Any valid Color. Magenta is the default value.
  • Color Key Enabled—A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps—A Boolean value indicating if mipmaps are generated. The default value is false.
  • Generate Tangent Frames—A Boolean value indicating if tangent frames are generated. The default value is false.
  • Resize Textures to Power of Two—A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Scale—Any valid float value. The default value is 1.0.
  • Swap Winding Order—A Boolean value indicating if the winding order is swapped. This is useful for models that appear to be drawn inside out. The default value is false.
  • Texture Format—Any valid value from TextureProcessorOutputFormat. Textures are either unchanged, converted to the Color format, or DXT Compressed.
  • X Axis Rotation—Amount, in degrees of rotation. The default value is 0.
  • Y Axis Rotation—Amount, in degrees of rotation. The default value is 0.
  • Z Axis Rotation—Amount, in degrees of rotation. The default value is 0.
Sprite Font Texture - XNA Framework FontTextureProcessor TextureContent Class SpriteFontContent

A parameterized processor that outputs a sprite font texture as a SpriteFontContent object.

Available parameters:

  • First Character—Any valid character. The space character is the default value.
Texture - XNA Framework TextureProcessor TextureContent Class TextureContent Class

A parameterized processor that outputs textures as a TextureContent Class object.

Available parameters:

  • Color Key Color—Any valid Color. Magenta is the default value.
  • Color Key Enabled—A Boolean value indicating if color keying is enabled. The default value is true.
  • Generate Mipmaps—A Boolean value indicating if mipmaps are generated. The default value is false.
  • Resize to Power of Two—A Boolean value indicating if a texture is resized to the next largest power of 2. The default value is false.
  • Texture Format—Any valid value from TextureProcessorOutputFormat. Textures are either unchanged, converted to the Color format, or DXT Compressed.

Texture Processing with XNA Game Studio

In versions before XNA Game Studio 2.0, the following standard processors were used for texture processing.

  • TextureProcessor
  • ModelTextureProcessor
  • SpriteTextureProcessor

In XNA Game Studio, the Texture - XNA Framework processor replaces the functionality of this entire group. For new XNA Game Studio projects and projects converted by the Project Upgrade Wizard for XNA Game Studio 2.0, the correct processor is selected automatically. However, for existing custom processors that make calls to any processor from the list above, the code must be modified to use the new TextureProcessor with the proper parameters. The following table describes the parameter values required for emulating each previous texture processor.

Processor Type NameRequired Parameters and Values
TextureProcessor

Call the Texture—XNA Framework processor (TextureProcessor) with the following parameter values:

  • GenerateMipmaps: false
  • Destination format: NoChange
  • Colorkey Enabled: false
  • Colorkey Value: Magenta
  • Resize: false
ModelTextureProcessor

Call the Texture—XNA Framework processor (TextureProcessor) with the following parameter values:

  • GenerateMipmaps: true
  • Destination format: DXTCompressed
  • Colorkey Enabled: true
  • Colorkey Value: Magenta
  • Resize: false
SpriteTextureProcessor

Call the Texture—XNA Framework processor (TextureProcessor) with the following parameter values:

  • GenerateMipmaps: false
  • Destination format: Color
  • Colorkey Enabled: true
  • Colorkey Value: Magenta

For more information on modifying and declaring parameter values programmatically, see Developing with Parameterized Processors.

Community Additions

ADD
Show:
© 2014 Microsoft