[XNA] Editing Shaders at Runtime

Started by
1 comment, last by MJP 15 years, 3 months ago
hello, is there a possibility that i make changes to my *.fx file and recompile it and see the changes live, while the game is running? this would speed up development a lot! :-) thanks!
Advertisement
You could try a shader IDE like FX Composer.
Like sebbit mentioned FX Composer is designed for this sort of thing, so it's probably a good choice.

If you wanted to do it in your own app, it's not terribly difficult. You can just load a new Effect instance by calling Effect.CompileEffectFromFile and then use that instance. Using the Content Pipeline would be trickier...you'd have to have your app or another app invoke the content importer and processor and then have the ContentManager load the new .xnb. If you overwrote your old .xnb file, you'd also have to have the ContentManager Unload everything since it caches resources.

This topic is closed to new replies.

Advertisement