FX-like in JOGL ?

Hello,

I am a beginner in CG and I recently saw that with the .fx format and Direct3D you can change the values of some constants used inside of the shaders (don’t get confused, they are not the parameter variables, they are really some constants, so DirectX might do some write-in-the-program or shader recompilation on the flight between 2 calls of a rendering command). Is there a way to obtain such effect from Java using JOGL ?

Vincent

The JSR-231 branch of the JOGL source tree has a binding for Cg 1.4 which includes most of the CgFX routines. We don’t yet have binaries of this branch available but they will be up within a couple of weeks as soon as JSR-231 goes to Early Draft Review. In the meantime you can check out and build the JSR-231 branch yourself:


cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -r JSR-231 -P jogl jogl-demos

Cool, really cool. 8)

I also have another question, but it may be a little off topic:
Do those CgFX functions only work for NVidia cards or not ?

From reading the Cg 1.4 documentation it sounded like a goal of that release ws to make Cg work on non-NVidia cards.

Cg have had support for non-nvidia cards since the initial release. It just depends upon which profile you which to compile for.
If you want to be failsafe pick ARBVP1 and ARBFP1.

// Tomas

Perhaps I should have said “work better”. The cgc compiler definitely used to produce arbfp and arbvp programs that relied on aliasing semantics of certain parameters which were legal under the spec but specific to NVidia cards. I haven’t tested the current release in detail. The release notes for Cg 1.4 indicate that CgFX now works on non-NVidia cards, so I was probably misremembering that regardless.

[quote]Perhaps I should have said “work better”. The cgc compiler definitely used to produce arbfp and arbvp programs that relied on aliasing semantics of certain parameters which were legal under the spec but specific to NVidia cards.
[/quote]
True :slight_smile: