Downloads
EffectCompilingTool.rar [41.5kb] – XNA GSE 1.0 Refresh Project w/ Binaries
Description
I love the content pipeline in XNA, but for effects, like the author of the XNA Effect Generator understood and mentioned already, it’s just not practical.
I liked the XNA Effect Generator too, but I wanted to implement my own effect framework so the generated classes were not what I was looking for either. Besides I had some problems with it (localization issues, dreaded french accents…). So I made a little tool that gets the Xbox 360 and Windows byte-code out of a shader in a convenient format and presentation.
Here’s a screenshot to begin with…
Basically, you browse for your file, and click on “Compile”. Then the byte-code appears. Simple as that!
It supports #include
directives in the shader (which I adore and encourage to use) and should play well with just any shader.
The byte-code can then be used in an inheritor of the Effect
class like so :
public MyEffect(GraphicsDevice device, EffectPool pool) : base(device, Code, CompilerOptions.PreferFlowControl, pool)
{
// Initialize effect parameters, etc.
}
static byte[] Code
{
get
{
return new byte[] {
#if XBOX360
// Paste Xbox 360 byte-code
#else
// Paste Windows byte-code
#endif
};
}
}
And besides, it has the advantage of rendering reverse-engineering impossible. :)
Thanks a lot for this tool. it is very usefull.