Ben Vanik

I'm using the effect compiler (specifically the Effect.CompileEffectFromSource method) to compile effects on the fly, and was wondering if anyone knew a trick to getting more than just the first error back. It's kind of annoying to not get them all back at once, but I'm not seeing a way (via CompilerOptions) to have it continue. I'm worried I'll have to build my own yaccer :(

And as a sneak peek, here is a screenshot of an early build of the tool I'm writing - it's a minimally invasive drop in shader editor (requires about 4 lines of code in the host project to set up - maybe less if I create a GameComponent wrapper). It will probably go up on CodePlex in a week or two. http://www.hiranipra.com/data/help_attach/ShaderDesigner1.png



Re: XNA Framework Getting multiple errors back from the effect compiler?

Jon Watte

You could have your tool re-compile the source in the background as soon as the user changes it (or at least within a second after it's been changed). Then always display the error you find. It doesn't give you multiple errors, but it means the user can more easily and quickly navigate to found errors.

Another thing you could do is just use something like ATI RenderMonkey, or NVIDIA FX Composer, both of which are free :-)






Re: XNA Framework Getting multiple errors back from the effect compiler?

Ben Vanik

Yeah I was also thinking about just invoking the compiler applications instead of using the API, but I like how fast things are right now (hit F5 and the shader changes show up right away).

RenderMonkey is a pain to use, and FX Composer is buggy as hell. I tried using FX Composer but things that worked in it did not work in my XNA app and vica versa. And for shader design, I like seeing my changes live in the application as that is where the controller code lives - for example, designing a shader that does propulsion trails would be annoying in an external application (or at least require a lot of engineering work or plugin design). Plus this is a fun project :)





Re: XNA Framework Getting multiple errors back from the effect compiler?

Leaf.

Are you saying that you are seeing less errors reported by using XNA to compile the shader than fxc.exe reports They should be the same as fxc.exe is essentially a command line tool wrapper around the same API.

Cheers,
Leaf.






Re: XNA Framework Getting multiple errors back from the effect compiler?

Ben Vanik

Nope, fxc gives just one error as well. I guess that means it is impossible :(