Cg with Jogl

Anyone tried using Cg with Jogl? I’m interested in stretching the legs of my new GF 4 Ti, and if i stick with the Cg runtime I think i can get it to cover a larger range of cards with less hastle.

Annoyingly, everthing that covers the Cg runtime is in C++, and I’m not sure how to begin porting anything over…

I’ve tried to use Cg with jogl. I have a very simple fragment shader that works fine on my GF FX in the arbfp1 profile. But i can’t get anything to work in the fp20 profile, has anybody else had this problem? The program compiles and loads fine but crashes my VM when i try to bind it with cgGLBindProgram.

Does anybody know why Cg isn’t included in the nightly builds of jogl? Could it be that the support for Cg in jogl isn’t fully developed yet? I am using a somewhat older version of jogl (stable version?) where Cg is supported.

JOGL’s Cg support is currently considered experimental which is why it isn’t being built by default in the nightly builds yet. We could consider switching it on witihout too much difficulty. Currently the support only works on Windows and Linux.

Some people have reported strange crashes with some of the fragment profiles but I don’t think the root cause has been tracked down yet. It might have something to do with a different pixel format or visual being chosen than in the corresponding C++ code for a particular demo. There are a couple of simple Cg examples in the jogl-demos source tree; we’ll work on getting a more complex example (the HDR demo shown at JavaOne) up on the web soon.

After reading this page:

http://www.graphics3d.com/guides/cg_1_1/index.html

Is there any way to use Devc++ or the linux compiler to create shader files with the Nvidia Cg compiler ?

That page only refers the (yuuuuuuuuuk) visual c++ compiler and i dont know much about the linux compilers except for the ocasional C++ work at school.

Allways use Java to do my programs. ;D 8)