Jump to content
  • Advertisement
Sign in to follow this  
Numsgil

XNA 4 EffectProcessor

This topic is 2546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!