I have a DirectX shader (.fx and .fxo) and am trying to implement it into my own DirectX9.0 project but when using
HRESULT hr = (D3DXCreateEffectFromFile(mD3DDevice, "Terrain.fx",
0, 0, D3DXSHADER_DEBUG, 0, &mFX, &errors));
where mD3DDevice is a pointer to my LPDIRECT3DEVICE9
I get the error
ID3DXEffectCompiler: There was an error initializing the compiler
I have tried compiling with a different shader and that compiles, so it must be a problem with compatabilty with the shader. I know the Shader works though as I have used it in a different engine (DirectX9.0c).
Is it something I need to change in the shader? or is it something else?
The beginnig of the Shader written for the DirectX 9.0c engine starts with using a constant buffer. Is that the issue? Can DirectX9 not handle the buffer? If So, how would I have to change the shader or engine to make it work?
Many thanks for any help.
cbuffer cbPerFrame
{
DirectionalLight gDirLights[3];
float3 gEyePosW;
float gFogStart;
float gFogRange;
float4 gFogColor;
float gMinDist;
float gMaxDist;
float gMinTess;
float gMaxTess;
float gTexelCellSpaceU;
float gTexelCellSpaceV;
float gWorldCellSpace;
float2 gTexScale = 50.0f;
float4 gWorldFrustumPlanes[6];
};