[SOLVED]jogl + nvidia cg demos / tutorials

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SOLVED]jogl + nvidia cg demos / tutorials

siddharth_univ
This post was updated on .
Hi all,

I have recently started using jogl 2 and so far everything seems to be going fine. I wanted to start using cg, but i noticed it wasnt part of jogl.all.jar and had to include jogl.cg and jogl_cg-natives-windows-amd64.jar. But to kick start, i was wondering if there are any tutorials, demos available? Could anyone point me in the right direction?

I tried to download the jogl demos from http://jogamp.org/deployment/jogamp-current/archive/, it seems this is for linux and im working on windows 7 64bit. So could someone also point me where to get the demo binaries for windows too?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: jogl + nvidia cg demos / tutorials

siddharth_univ
anyone?
Reply | Threaded
Open this post in threaded view
|

Re: jogl + nvidia cg demos / tutorials

Sven Gothel
Administrator
In reply to this post by siddharth_univ
On 02/21/2012 02:25 AM, siddharth_univ [via jogamp] wrote:

>
>
> Hi all,
>
> I have recently started using jogl 2 and so far everything seems to be going
> fine. I wanted to start using cg, but i noticed it wasnt part of
> jogl.all.jar and had to include jogl.cg and
> jogl_cg-natives-windows-amd64.jar. But to kick start, i was wondering if
> there are any tutorials, demos available? Could anyone point me in the right
> direction?
Sorry .. however, I guess we have a Cg demo within jogl-demos.

>
> I tried to download the jogl demos from
> http://jogamp.org/deployment/jogamp-current/archive/, it seems this is for
> linux and im working on windows 7 64bit. So could someone also point me
> where to get the demo binaries for windows too?

jogl-demos is platform neutral.

For development: Best to add jogl-demos to Eclipse having gluegen + jogl
referenced
as a user library -> wiki.

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: jogl + nvidia cg demos / tutorials

siddharth_univ
Hello Sven,

I am sorry to reply to this thread late. I was caught up with work.

I downloaded jogl-demos from http://jogamp.org/deployment/jogamp-current/archive/jogl-demos.7z. I might be wrong, but i could not find cg examples. There were cg shader files themselves but no java files using them. Further these were binaries and no source included in the zip file.

I cloned your git repository  to get the demo source(  git clone http://github.com/sgothel/jogl-demos.git jogl-demos ).. i navigated to its make directory to find build.xml and did an "ant".. but i got this error:

[javac] Compiling 172 source files to C:\jogl2-src\jogl-demos\build\classes
[javac] Since fork is false, ignoring memoryMaximumSize setting.
[javac] C:\jogl2-src\jogl-demos\src\demos\applets\GearsJOALApplet.java:11: package com.jogamp.openal.util does
[javac] import com.jogamp.openal.util.ALut;
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:40: package com.jogamp.openal does not
[javac] import com.jogamp.openal.*;
[javac] ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:41: package com.jogamp.openal.util does
[javac] import com.jogamp.openal.util.*;
[javac] ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:164: cannot find symbol
[javac] symbol  : class AL
[javac] location: class demos.joal.SingleStaticSource
[javac]   private AL al;
[javac]           ^
[javac] C:\jogl2-src\jogl-demos\src\demos\applets\GearsJOALApplet.java:47: cannot find symbol
[javac] symbol: variable ALut
[javac]             ALut.alutExit();
[javac]             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:195: cannot find symbol
[javac] symbol  : variable ALut
[javac] location: class demos.joal.SingleStaticSource
[javac]       ALut.alutInit();
[javac]       ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:196: cannot find symbol
[javac] symbol  : variable ALFactory
[javac] location: class demos.joal.SingleStaticSource
[javac]       al = ALFactory.getAL();
[javac]            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:198: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]     } catch (ALException e) {
[javac]              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:204: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]       if (loadALData() == AL.AL_FALSE)
[javac]                           ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:206: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]     } catch (ALException e) {
[javac]              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:229: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR) {
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:230: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error generating OpenAL buffers");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:239: cannot find symbol
[javac] symbol  : variable ALut
[javac] location: class demos.joal.SingleStaticSource
[javac]     ALut.alutLoadWAVFile(
[javac]     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:256: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR)
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:257: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error generating OpenAL source");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:259: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcei(source[0], AL.AL_BUFFER, buffer[0]);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:260: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcef(source[0], AL.AL_PITCH, 1.0f);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:261: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcef(source[0], AL.AL_GAIN, 1.0f);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:262: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcei(source[0], AL.AL_LOOPING, loop[0]);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:265: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR)
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:266: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error setting up OpenAL source");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:272: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcefv(source[0], AL.AL_POSITION, sourcePos, 0);
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:273: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcefv(source[0], AL.AL_VELOCITY, sourceVel, 0);
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:275: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     return AL.AL_TRUE;
[javac]            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:279: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_POSITION, listenerPos, 0);
[javac]                     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:280: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_VELOCITY, listenerVel, 0);
[javac]                     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:281: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_ORIENTATION, listenerOri, 0);

The other route i tried to take was just to see the source code for one of the examples for cg that i had cloned from your git repository. When i tried to do a CgGL.cgCreateProgram() or CgGL.cgCreateProgramFromStream(), i always get a null for the CgProgram. I presume that this is due to not setting up my jars properly in eclipse?

Currently i have a user library created called jogl-cg-2.0 that contains :
jogl.cg.jar
jogl_cg-natives-windows-amd64.jar

for both these jars, i have my native library located pointed to %NVIDIA_CG_LIB_PATH%.. is this correct? or should i point it to a directory containing jogl_cg.dll... Either way, i tried both these locations and i still get a null when i create a CgProgram..

Any help would be great..

sorry for the long post..

thanks

Reply | Threaded
Open this post in threaded view
|

[SOLVED] Re: jogl + nvidia cg demos / tutorials

siddharth_univ
In reply to this post by siddharth_univ
Hello Sven,

Before you reply, i was able to figure out what i must do to get the cg demos working with jogl demos. Firstly i had not built the demos with -Djogl.cg=1. I used that property for jogl source but not for the demo. That worked. Secondly i didnt know that i had to joal installed for jogl demos to compile. Once checked out from your git repository, everything compiled and ran smoothly.

the cg demo worked too, now i have to see the difference in the demo code and my code...

thanks