Cg for OpenGL

A forum to store posts deemed exceptionally wise and useful
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Gorgon Zola wrote: If You want to take a look at the changes and tell me what you think about it, it would be really great.
http://thomas.webtracker.ch/jahia/album ... /cg002.zip
I can't find ICGProgram.h and ICGProgram.cpp in your archive. It's not working without them. Could you please add them into?
And would be great if someone post here example with sources. I still couldn't realize what means third parameter in

Code: Select all

virtual ICGProgram* createCGProgram(const c8* name, const c8* program, const c8* entry, u32 flag)=0;
zola
Posts: 52
Joined: Thu Jul 15, 2004 2:31 pm
Location: switzerland
Contact:

Post by zola »

sorry, didn't realize it was not included in the zip.

If You redownload You'll find a test app included in the new zip file
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

zola could you please add also SMaterial.h as I've got following error:
F:\Information for me\Roman\Download\Irrlicht\irrlicht-0.6\source\CVideoOpenGL.cpp(1302) : error C2039: 'VertexShader' : is not a member of 'irr::video::SMaterial'
zola
Posts: 52
Joined: Thu Jul 15, 2004 2:31 pm
Location: switzerland
Contact:

Post by zola »

:oops: updated
this is getting embarrassingi seem to forget every thing :)
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

I've got 19 errors like

Code: Select all

CVideoOpenGL.obj : error LNK2019: unresolved external symbol __imp__cgGetErrorString referenced in function "public: static void __cdecl irr::video::CVideoOpenGL::cgErrorCallback(void)" (?cgErrorCallback@CVideoOpenGL@video@irr@@SAXXZ)
using Microsoft Visual C++ Toolkit 2003 + RELO IDE and Cg Toolkit v. 1.2.1.
Why compiler don't want to use this functions from [DRIVE]\Program Files\NVIDIA Corporation\Cg\include\Cg\cg.h?
Seems to me it's better wait for a next Irrlicht release with hope that Niko will add shaders.
zola -

Post by zola - »

:) cheers to that.

If I'm not completely mistaken I used the 1.1 version of the cg toolkit.

I think there are several cg libs against which you have to link irrlicht.
(not only the one for CG.DLL) They should be in [DRIVE]\Program Files\NVIDIA Corporation\Cg\lib or something like that.

I'm not at my computer so I can't tell you what libs these are exacly
If I remember right there was CG.lib, CGGL.lib, and some other ??

Anyway, if You d'like to use CG and not only test it I recommend waiting, shader support eventually will be integrated in irrlicht in a more easy and complete way :wink:
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

8) Roger that.
I'll try with VC++ v.6 at home.
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

OK, finally I did it!
I forget to add cg.lib and cgGL.lib into "Extra libraries" :oops:
Excellent effect, by the way :!:
zola
Posts: 52
Joined: Thu Jul 15, 2004 2:31 pm
Location: switzerland
Contact:

Post by zola »

8) hehe, would be somewhat expensive to have this effect without cg.

Your using nv cg toolkit v.1.2.1, and it works? :D
are you going to include more parameter types to ICGProgram?
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Yes, compiled and works ok with 1.2.1
are you going to include more parameter types to ICGProgram?
Oh, i'm not such advanced programmer for that, but who knows? Time to get some additional info about Cg - I'm out to Google :lol:
Guest

Post by Guest »

hi!
i tried to get irrlicht 0.7.1 to compile with CG and modified a few files, but i still keep getting one error that i cannot get rid of:

Code: Select all

CVideoOpenGL.cpp: In member function `virtual irr::video::ICGProgram* 
   irr::video::CVideoOpenGL::createCGProgram(const c8*, const c8*, const c8*, 
   unsigned int)':
CVideoOpenGL.cpp:59: error: no matching function for call to `
   irr::video::CCGGLProgram::CCGGLProgram(irr::core::stringc&, 
   irr::core::stringc, irr::core::stringc, u32&)'

CCGGLProgram.h:26: error: candidates are: 
   irr::video::CCGGLProgram::CCGGLProgram(const irr::video::CCGGLProgram&)
CCGGLProgram.h:48: error:                 
   irr::video::CCGGLProgram::CCGGLProgram(irr::core::stringc&, 
   irr::core::stringc&, irr::core::stringc&, unsigned int)
here is the source folder with the modified files, maybe someone of you could have a look at it? that would be great because then we would have CG support in irrlicht 0.7.1 !!! 8)

http://gfxstyler.dyndns.org/ftp/irrlicht071CGsource.rar


edit: please forgive me this slow download speed, its a temporary setup homeserver (if the file is offline, try again later)
POi

Post by POi »

Looking at it now but get a lot of linker errors ... have you included the files in the project ?
POi

Post by POi »

I actually succeeded in compiling the .dll

I added the all the CG libs as additional dependencies (cg.lib cgGL.lib cgD3D9.lib CgFXParser.lib) and then i added CCGGLProgram.h/.cpp into the project.

Compiled it with VC .NET 2003 ... and it worked like a charm.
Guest

Post by Guest »

ok i added the libs and included the 2 files, but i still get the same error :? does that mean that you cannot compile it with Dev-C++ ?
POi

Post by POi »

Sorry don't know. Have never used Dev-C++. I used CG v.1.2 .. maybe that is the problem. But if you get the same errors maybe your code doesn't compile right... search for other files that aren't included in the project.??
Post Reply