I've recently been building a scene in 3DS Max that uses the HLSL shaders that I've written. I apply the shaders with Max's DX9 Shader material. (I've written a tutorial on using HLSL shaders in Max here
.) After working on the scene for a few weeks the viewport performance became very slow and I was no longer able to work in shaded mode. I was discouraged thinking that I would no longer be able to use Max for my HLSL shader platform because it was just too slow.
Instead of giving up I decided to do some performacne experiments. After testing a few different theories I discovered that the frame rate in the viewport was related directly to the number of DX9 materials I was using in a multi-subobject material. If my model only had one multi-subobject material, my frame rate was more than 100 fps. If I had two subobject materials the frame rate dropped to 50 fps. At 4 subobject materials the frame rate went down to 25, and at 8 the frame rate was around 12. See the pattern?
I decided that this must be a bug in the way max handles DX9 shader materials as subobject materials so I chopped up my scene so each object only had one material assigned. Now the frame rate is great and I can work again. This is kind of annoying since multi-subobject materials are part of my work flow, but I can live with this work around for now.
If anyone else has had this problem or knows more about it, I'd love to hear from you.