"but no Cg support is enabled" at runtime

Hello all,

My work environment has recently been updated from panda 1.5 to 1.7, and i started getting the following error message (or rather, warning) at each and every frame rendered by panda:
“Tried to load Cg shader, but no Cg support is enabled.”
(and indeed, the per-pixel lighting is disabled)

A quick Google search pinpoints this error message to the file at panda3d.org/reference/cxx/sh … source.php (line 01653)
where it would seem that the library was compiled without the flag HAVE_CG set to 1 (although i’m pretty sure that our video cards support it, being mostly gtx260 and 470 and anyway, it worked on 1.5 before…)
However, i’m not the one who compiled/installed it, so i really have no idea why the flag was left out;
so my question is, is there any way to use Cg shaders anyway, or do we really have to recompile? also, is the HAVE_CG flag set by default in config.pp or it has to be a manual edit? Or maybe it’s a prolem with the card’s drivers?


oh sorry, i just figured i should add a few more details:
the shaders i’m trying to run are the ones generated by the auto-shader, not custom ones;
also, we’re running on fedora core 7/9 in the lab;
lastly, i have no idea how exactly Panda was installed, but my guess is that it was compiled from source of the 1.7 release on the website, not the svn build. It was however installed on a common “file server” and not locally on each machine, so that might have something to do with the problem (but i don’t know the specifics of it)

It means it has been compiled without Cg support. You’ll need to install a copy of Panda3D that is compiled against the Cg toolkit.

The builds you’ll find on the download page are compiled with Cg support.

Thanks, I haven’t yet had the time to try it, but I noticed that that flag #define HAVE_CG wasn’t even present in dtool/Config.pp for Panda1.7 (until referenced by #defer HAVE_CG anyway) so adding #define HAVE_CG 1 should fix my problem

Possible thread hijack, but for those trawling the forums looking for answers:

(Behaviour under Panda3D 1.7.2)
If you compile Panda3D with OpenGL but neglect to include Cg, then (funnily enough) GraphicsStateGuardian.getSupportsBasicShaders() will return false.

This is ‘wrong’

makepanda\makepanda.bat --nothing --use-gl ...otheroptions...

This is ‘right’

makepanda\makepanda.bat --nothing --use-gl --use-nvidiacg ...otheroptions...

Right, it’s for historical reasons, as we originally only supported Cg.