XNA 4 EffectProcessor

Started by
0 comments, last by Starnick 12 years, 4 months ago
I'm trying to port some code I had written to compile shaders (using XNA 3) to use XNA 4. The whole pipeline was extensively reworked so I'm having some issues.

Specifically the bit I'm stuck on right now is CompilerIncludeHandler. Basically I have some #includes in my HLSL shader that aren't actual files, but programmatically constructed files (this is for a unit testing framework, for the curious. I isolate each test and run it in isolation in its own compiled shader). I was using the CompilerIncludeHandler to catch attempts to #include these programmatically constructed files and swap in the source code instead of going to disk (since the files don't actually exist). But I don't see a way to do that in XNA 4 using the Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor. It just takes an EffectContent, which takes a string EffectCode.

I'm guessing there's something dealing with the ContentProcessorContext that I can tweak? But I don't see what.
[size=2]Darwinbots - [size=2]Artificial life simulation
Advertisement
Hmm interesting, quick google search yields:

http://forums.create.msdn.com/forums/p/71970/439471.aspx

With shawn hargreaves saying the effect processor handles include files relative to the effect content, so I don't think you can actually change this behavior (where they certainly expect it to be a file). You may very well have to bite the bullet and save the programmatically generated shader code to a file whereever your effect file is located.

This topic is closed to new replies.

Advertisement