Table of Contents

Class ModelProcessor

Namespace
Microsoft.Xna.Framework.Content.Pipeline.Processors
Assembly
MonoGame.Framework.Content.Pipeline.dll

Processes a game asset mesh to a model content that is optimal for runtime.

[ContentProcessor(DisplayName = "Model - MonoGame")]
public class ModelProcessor : ContentProcessor<NodeContent, ModelContent>, IContentProcessor
Inheritance
ModelProcessor
Implements
Inherited Members

Constructors

ModelProcessor()

Initializes a new instance of ModelProcessor.

public ModelProcessor()

Properties

ColorKeyColor

Gets or Sets the background color used for transparency

public virtual Color ColorKeyColor { get; set; }

Property Value

Color

ColorKeyEnabled

Gets or Sets a value that indicates whether colors identified by the ColorKeyColor will be marked as transparent (Alpha 0). The default value is false.

public virtual bool ColorKeyEnabled { get; set; }

Property Value

bool

DefaultEffect

Gets or Sets the default effect class to apply to this model. The default value is BasicEffect

public virtual MaterialProcessorDefaultEffect DefaultEffect { get; set; }

Property Value

MaterialProcessorDefaultEffect

GenerateMipmaps

Gets or Sets a value that indicates whether this will generate MipMpas for the selected texture. The default value is false.

public virtual bool GenerateMipmaps { get; set; }

Property Value

bool

GenerateTangentFrames

Gets or Sets a value that indicates whether model tangents should be generated for use in Normal Mapping. The default value is false.

public virtual bool GenerateTangentFrames { get; set; }

Property Value

bool

PremultiplyTextureAlpha

Gets or Sets a value that indicates whether the selected texture will be treated as an Alpha Mask. The default value is true.

public virtual bool PremultiplyTextureAlpha { get; set; }

Property Value

bool

PremultiplyVertexColors

Gets or Sets a value that indicates whether the selected texture will be treated as an Vertex Color Mask. The default value is true.

public virtual bool PremultiplyVertexColors { get; set; }

Property Value

bool

ResizeTexturesToPowerOfTwo

Gets or Sets a value that indicates if the model texture(s) dimensions should be resized to the next largest power of 2 size. (e.g. 128x128 or 512x512). The default value is false.

public virtual bool ResizeTexturesToPowerOfTwo { get; set; }

Property Value

bool

RotationX

Gets or Sets the default model x-axis rotation number, in degrees of rotation. The default value is 0.0f.

public virtual float RotationX { get; set; }

Property Value

float

RotationY

Gets or Sets the default model y-axis rotation number, in degrees of rotation. The default value is 0.0f.

public virtual float RotationY { get; set; }

Property Value

float

RotationZ

Gets or Sets the default model z-axis rotation number, in degrees of rotation. The default value is 0.0f.

public virtual float RotationZ { get; set; }

Property Value

float

Scale

Gets or Sets the default model scale. The default value is 1.0f.

public virtual float Scale { get; set; }

Property Value

float

SwapWindingOrder

Gets or Sets a value indicating whether the winding order is swapped. This is useful for models that appear to be drawn inside out. The default value is false.

public virtual bool SwapWindingOrder { get; set; }

Property Value

bool

TextureFormat

Gets or Sets the format of the texture to process (e.g. raw color, DXT). The default value is compressed.

public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

TextureProcessorOutputFormat

Methods

ConvertMaterial(MaterialContent, ContentProcessorContext)

protected virtual MaterialContent ConvertMaterial(MaterialContent material, ContentProcessorContext context)

Parameters

material MaterialContent
context ContentProcessorContext

Returns

MaterialContent

Process(NodeContent, ContentProcessorContext)

Converts mesh content to model content.

The root node content. Context for the specified processor.
public override ModelContent Process(NodeContent input, ContentProcessorContext context)

Parameters

input NodeContent
context ContentProcessorContext

Returns

ModelContent

The model content.

ProcessGeometryUsingMaterial(MaterialContent, IEnumerable<GeometryContent>, ContentProcessorContext)

protected virtual void ProcessGeometryUsingMaterial(MaterialContent material, IEnumerable<GeometryContent> geometryCollection, ContentProcessorContext context)

Parameters

material MaterialContent
geometryCollection IEnumerable<GeometryContent>
context ContentProcessorContext

ProcessVertexChannel(GeometryContent, int, ContentProcessorContext)

protected virtual void ProcessVertexChannel(GeometryContent geometry, int vertexChannelIndex, ContentProcessorContext context)

Parameters

geometry GeometryContent
vertexChannelIndex int
context ContentProcessorContext