irrCg v0.8 (Initial) - CgFX (Texture States, MultiPass etc.)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
tinhtoitrangtay
Posts: 70
Joined: Tue Oct 28, 2008 12:59 pm

Post by tinhtoitrangtay »

Hi Nardo
i have a question. When i merge IrrCg to Irrlicht i can't finish complied
this is the error code - can you help me please?

Code: Select all

------ Build started: Project: 25.BasicLighting_vc9, Configuration: Release Win32 ------
Compiling...
main.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol "public: int __thiscall IrrCg::ICgProgrammingServices::addCgShaderMaterialFromFiles(enum CGenum,char const *,char const *,char const *,char const *,char const *,char const *,char const *,char const *,class IrrCg::ICgShaderConstantSetCallBack *,enum irr::video::E_MATERIAL_TYPE,char const * *)" (?addCgShaderMaterialFromFiles@ICgProgrammingServices@IrrCg@@QAEHW4CGenum@@PBD1111111PAVICgShaderConstantSetCallBack@2@W4E_MATERIAL_TYPE@video@irr@@PAPBD@Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall IrrCg::ICgProgrammingServices::ICgProgrammingServices(class irr::IrrlichtDevice *,bool,bool,enum CGenum)" (??0ICgProgrammingServices@IrrCg@@QAE@PAVIrrlichtDevice@irr@@_N1W4CGenum@@@Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall IrrCg::ICgProgrammingServices::~ICgProgrammingServices(void)" (??1ICgProgrammingServices@IrrCg@@QAE@XZ) referenced in function "public: void * __thiscall IrrCg::ICgProgrammingServices::`scalar deleting destructor'(unsigned int)" (??_GICgProgrammingServices@IrrCg@@QAEPAXI@Z)
..\..\bin\Win32-VisualStudio\25.BasicLighting.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://c:\HOCTAPLT\Irr\examples\25.BasicLighting\Release\BuildLog.htm"
25.BasicLighting_vc9 - 4 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You can make a project merge IrrCg to Irrlicht support IrrCg. Thanks
Terry
Posts: 55
Joined: Wed Jan 27, 2010 6:16 am
Location: Peking/China

Post by Terry »

Hello folks,

This is the first time that i use irrCg,i believe some of us couldn't build one "Hello world"project(I'm the one :( so),after several hours trying i know the problem.If you have build one project and import *.lib files,including head files,still your project doesn't work,and show you many strange problems like

Code: Select all

error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)	IrrCg.lib
You'd better regenerate IrrCg.lib and IrrCg.dll by yourselves,the project properties should keep instance with your irrlicht project.
Sorry for my poor English,i hope i've expressed myself clearly.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

You can try change "/MD" (Multi-threaded DLL Runtime Library) to "/MT" (Multi-threaded Runtime Library) in project option. It should help.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
telepuzik
Posts: 5
Joined: Sun Nov 29, 2009 9:08 am
Location: Russia

Post by telepuzik »

Great work Nadro! keep it up.

i'm not sure I totally understand this, but in function OnSetConstants you use absolute values
of lightPosition and eyePosition

Code: Select all

        lightPosition = cgGetNamedParameter(Vertex, "lightPosition");
        services->setParameter3f(lightPosition, 0.0f, 0.0f, 120.0f);

        eyePosition = cgGetNamedParameter(Vertex, "eyePosition");
        vector3df CameraPosition = Device->getSceneManager()->getActiveCamera()->getAbsolutePosition();
        services->setParameter3f(eyePosition, CameraPosition.X, CameraPosition.Y, CameraPosition.Z);
but in CG SDK they use "Transform world-space eye and light positions to object-space"

Code: Select all

  /* Transform world-space eye and light positions to .......'s object-space. */
  transform(objSpaceEyePosition, invModelMatrix, eyePosition);
  cgSetParameter3fv(myCgFragmentParam_eyePosition, objSpaceEyePosition);
  transform(objSpaceLightPosition, invModelMatrix, lightPosition);
  cgSetParameter3fv(myCgFragmentParam_lightPosition, objSpaceLightPosition);
What is correct? :roll:
Sorry for my awful english (c)
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

telepuzik wrote: What is correct? :roll:
Depends on what you are doing in your shader....
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
telepuzik
Posts: 5
Joined: Sun Nov 29, 2009 9:08 am
Location: Russia

Post by telepuzik »

I am take irrCg example "01.BasicLighting", make light moving by adding createFlyCircleAnimator

When objects are allocated near zero point - lighting looks correct,

but if I move all objects (elephant,cube,sphere,camera,light) in a far point (for example 10000,0,10000) - lighting looks strange - as though the light source remained in a zero point

When I have added transform eye and light positions to object-space, lighting has work fine
Sorry for my awful english (c)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

irrCg examples are some bugged, I will improve it, when I found more free time.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
full_newbie
Posts: 27
Joined: Mon Apr 05, 2010 7:33 am

Post by full_newbie »

Hello Nadro. Please help. If I am compile IrrCG, I am getting error:

IrrCg.cpp(239) : error C2039: TextureWrap: ­Ґ пў«пҐвбп з«Ґ­®¬ "irr::video::SMaterialLayer"
c:\irrlicht-1.7.1\include\SMaterialLayer.h(49): б¬. ®Ўкпў«Ґ­ЁҐ 'irr::video::SMaterialLayer'
IrrCg.cpp(534) : error C2039: TextureWrap: ­Ґ пў«пҐвбп з«Ґ­®¬ "irr::video::SMaterialLayer"
c:\irrlicht-1.7.1\include\SMaterialLayer.h(49): б¬. ®Ўкпў«Ґ­ЁҐ 'irr::video::SMaterialLayer'

What wrong?
Sorry, my english is very bad. | I use minGW+CodeBlocks+Irrlicht 1.7.1(1.6,1.5)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

You should use the latest version of irrCg from SVN.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
[DEF]
Posts: 17
Joined: Thu Jul 29, 2010 8:30 am

Post by [DEF] »

Hi guys,
I'm a complete noob when it comes to building sources :S
If someone could point me in the right direction,
on how to build IrrCg for openGL in DEV-C++, or code::blocks,
for mingGW :S
I'm completely stuck :(

edit: have got the latest Cg version from Nvidia, and the latest IrrCg from SVN, and the latest Irrlicht. Just for info :P
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Is IrrCg still being developed at all? The last check-in was almost half a year ago. Is there any continued development, or is it "done" at 0.8?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Hi,
In last time I was fully switched to OpenGL 3.x + GLSL (integrated with Irrlicht of course), so I have less time for develop irrCg, but project isn't dead, I will try add new features to it in winter holidays.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Nadro wrote:Hi,
In last time I was fully switched to OpenGL 3.x + GLSL (integrated with Irrlicht of course)
cool. please do show us if you have any demo made with that :D
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Sometime ago I worked on game which usage this version of OpenGL 3.x driver:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=39585

This is screenshot from an early development version of our (me - programming, Mateusz "Herszt" Bartkowiak - 3d + 2d graphic) game:
Image

Uploaded with ImageShack.us

We used here eg. hardware skinning (based on BlindSide idea) and texture arrays. I will release under Zlib license code (still in alpha version, so have some bugs) of small, pathfinding library which I prepared for this game (it use Navigation Meshes for solve paths).

Game will be not release and I can't say more about title of product, gameplay etc.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Kalango
Posts: 157
Joined: Thu Apr 26, 2007 12:46 am

Post by Kalango »

Thanks for this great binding Nadro! After a few adapting i got it working with Irrlicht 1.72 and GCC (latest MingW pack).
Thanks again!
Post Reply