Unable to compile Cg program

Mars

09-11-2007 04:19:28

Hi,
Pro edition, when try to follow tutorial "Normal Mapping with GPU shaders", the fp occured an error, and the ogre log said some thing like force type convert float4 to float3. Then I try to compile the shader file "Example_BumpMapping.cg", and change

float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w));

to

float3 lightDir = normalize(lightPosition.xyz - (position.xyz * lightPosition.w));

The cgc reported no error or warning.
But when I return to the oFusiong pass, and assaign the fp, another error occured, and the ogre log said

Error #: 9
Function: CgProgram::loadFromSource
Description: Unable to compile Cg program Examples/BumpMapFPSpecular: CG ERROR : The compile returned an error.
(106) : fatal error C9999: *** exception during compilation ***

So I suppose there might be some problem with cg compiler within oFusion.
Would anyone give me some advices?

Evak

09-11-2007 20:41:36

I believe that the CG compiler is in the CG.dll in the 3dsmax root dir. Ofusion uses an older one than 3dsmax 9 and 2008 for better compatibility with older hardware.

I use the newer versions of CG.dll because plugins like ShaderFX need them.

I believe that Ofusion renamed the original CG.dll that ships with 3dsmax to CG.Bak. You can test your CG shader with a newer compiler by backing up the ofusion CG.dll and renaming the backed up version. That should give you the latest compiler to play with.

I havent had any problems with the latest CG.dll but all my vid cards have been geforce 6 and up latest drivers.

Mars

10-11-2007 01:04:36

Hi,
There is a cg.dll and a cg.bak under max root dir. The edition of cg.dll is 1.5.0.12 and the cg runtime on my machine is 1.5.0.23, so I changed the former one, and the problem solved. I think that might be some runtime conflict on my machine. The cg.bak seems have no effect though.
Thanks for your reply.