Looking for the User Manual? Or Sample Code?

What is Effect Generator?

Effect Generator is a Custom Tool plug-in for Visual Studio which generates C# classes from Direct3D Effect (.fx) files for use with the Microsoft XNA Framework. The generated class is a type-safe wrapper around the effect file's parameters.

Why should I use it?

The XNA Content Pipeline is great. It greatly simplifies the process for importing and loading models, textures, and other content. Unfortunately, it is optimized for loading data, not code. Effect files are essentially code, so an alternative approach could provide additional benifits.

Like the XNA Content Pipeline, Effect Generator compiles your .fx files at build time, reducing game load times. Additionally, Effect Generator further simplifies run-time loading and effect parameterization. Effect Generator accomplishes this by creating a type-safe class that mimics the implementation of Microsoft.Xna.Framework.Graphics.BasicEffect.

Compare these functionally equivilant blocks of code:

XNA Content Pipeline
Effect myEffect;
EffectParameter worldViewProjectionParam;
EffectParameter ambientParam;
EffectParameter textureParam;

void LoadEffect(ContentManager contentManager)
{
    myEfect = contentManager.Load<Effect>("MyEffect");
    worldViewProjectionParam = myEffect.Parameters["WorldViewProjection"];
    ambientParam = myEffect.Parameters["Ambient"];
    textureParam = myEffect.Parameters["Texture"];
}

void ParameterizeEffect(Matrix worldViewProjection, Vector4 ambient, Texture2D texture)
{
    worldViewProjectionParam.SetValue(worldViewProjection);
    ambientParam.SetValue(ambient);
    textureParam.SetValue(texture);
}


Effect Generator
MyEffect myEffect;

void LoadEffect(GraphicsDevice device)
{
    myEfect = new MyEffect(device);
}

void ParameterizeEffect(Matrix worldViewProjection, Vector4 ambient, Texture2D texture)
{
    myEffect.WorldViewProjection = worldViewProjection;
    myEffect.Ambient = ambient;
    myEffect.Texture = texture;
}

How do I get started?

Download and run the Installer
And read the User Manual

Last edited Mar 7, 2007 at 8:42 AM by SnprBoB86, version 12