I've created a cube with a color texture and normal map. I got it into XNA from ModTool using this guide: Integrating Your XNA Engine With XSI ModTool .
My idea was to make another cube. I want it to use the same effect file but a different technique. So I wrote a pixel shader returning nothing but the color white and a new technique using it called "render1". I duplicated my previous DirectX material and changed the technique on my newly created material. Now I got two materials; brick1 using technique "render0" and brick2 using technique "render1" both using the same xsiEffect.fx file.
I assigned brick1 to one of the cubes and brick2 to the other. Everything plays nicely in the viewport in ModTool. One shows the textures and the other one is white. I published the model and when I loaded it in XNA they look just the same. Both using the "render0" technique. Debugging the application confirms that the current technique for both effects is indeed "render0".
Doesn't the .xsi format save information about the technique? I guess it does since loading the model back into ModTool works fine. So I'm guessing the problem is either in the content processor or the Model class. Am I on to something here?
I guess I could do this by code but this really seems like a job for the 3d artist, not the coder. Apparently it knows which texture file to use correctly so I guess some kind of mapping have been done, so any idea why the technique mapping is missing? Or is this way of using shaders just fundamentally stupid? I'd really like to keep it to one effect file and use different techniques for different materials in the game.