AndrewM

if I load an fx file from a sub-directory like so:

D3DXCreateEffectFromFile( device, L"subdirectory\\effect.fx" ...

and that fx file contains an include statement that includes another fx from the same subdirectory, then the included file will no longer be found in the December 2006 SDK.

To make it work, you must SetCurrentDirectory to the sub folder first.

Is this change a bug or feature

Andy



Re: Game Technologies: Graphics fx include not found - December SDK change

Greg Booker

I've noticed this as well, I'd be interested to hear from MS on whether it's a bug or feature, too.

In the meantime, an alternative to calling SetCurrentDirectory is to change the #include to use the relative path, e.g. #include "subdirectory/include.fxh"

Interestingly the D3D10 version of this function still seems to work in the old way.

For the moment, I'm using the flag to use the legacy D3DX DLL on D3D9 to avoid having to change code or shaders in existing projects.

Greg




Re: Game Technologies: Graphics fx include not found - December SDK change

AndrewM

I tried using the legacy flag with D3DXCreateEffectFromFile, but my [CLR/C++] program then crashes on releasing my effectPool with an Access Violation. So I don't know whats going on there!