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
xsinick
Posts: 18
Joined: Fri Aug 10, 2007 12:05 am

Post by xsinick »

I replaced the mesh object with .obj file and it compiles but when I run the exe it crashes with a runtime error box.

Seems like you can only use ms3d files?

Let me Know Nadro
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

IrrWHAT?!:
I think, You don't compile DirectX support in it. Probably You have got comment this parameter "IrrCgD3D9", for D3D9 support in IrrCg You have to uncomment it (In orginal archive all is configured for both driver support: OpenGL and Direct3D9)

xsinick:
This is linker error, so You don't add IrrCg library for link libraries. IrrCg is of course, mesh format independent, if Your mesh don't work, You have to error in this mesh or wrong path for it.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
xsinick
Posts: 18
Joined: Fri Aug 10, 2007 12:05 am

Post by xsinick »

No, No Nadro,
I tried a .md2 from blender and it worked but tried .obj and It crashes . I get you more details But you should try the Normal example with your .obj elephant instead of the imp.ms3d and you'll see even crashes with .x too.

I you have a problem with this too I'll be happy to help sending different mesh artwork for you to test and put your shaders through there paces.

Thanks for your reply!
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

If You try NormalMapping example You should see, than I use in it convertMeshToTangents function from ISkinnedMesh class, but *.obj isn't create as ISkinnedMesh, so example crash. With *.x file (SkinnedMesh) all should work properly.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
IrrWHAT?!
Posts: 33
Joined: Tue May 20, 2008 9:18 am
Location: Australia

Post by IrrWHAT?! »

Thx for response Nadro

Ok, when I try and compile with dev-cpp, it complains about there being no int main (). So to counter it, I put the source inside a dll-template project. It generated an IrrCG.a

The original IrrCG library is .lib so .a is probably the wrong format,
but I don't know how to get dev-cpp to compile .lib files.

Thx.
Aleyer
Posts: 17
Joined: Thu Dec 14, 2006 9:03 pm

Post by Aleyer »

Hi!
A lot of time has passed since the last time I programmed Irrlicht apps, but here I am once again.
I just want to ask one question now, can I use IrrCG for applying some nice-looking materials onto meshes and simultaneously use XEffects - Reloaded (http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=30631) for lighting and shading?
I just don't really conceive the whole shader pipeline, unfortunately.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Yes, You can use this shaders via IrrCg as *.cg, but You have to remember remove preprocessor parameters in this shaders.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

hmmm

Post by 3DModelerMan »

Cold someone provide a win32 mingw build?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

I'm on the same page with 3DModelerMan because I really want to try out per-pixel lighting in my project but I haven't been able to build and use IrrCg correctly using DevCpp. I hope someone can help.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Hi, I can prepare project for MingW and DevCpp in next "update" version, 0.7.1. It should be avaiable on Sunday or Monday.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

goood

Post by 3DModelerMan »

Alright!!! I've got a code::blocks project that desperatly needs some shaders.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
fmx

Post by fmx »

Thankyou Nadro for for making this! :D

I just got it working (with Irrlicht 1.5) and thought maybe I'd say something here for anyone else trying to get irrCG working:

If the lib gives you problems, just take the irrCG.cpp source and irrCG.h include and add them into your project, also giving them the location of where to find the Irrlicht source files (don't need to include the irrlicht source in the project, or recompile them or anything)

Remove all traces of the irrCG Lib from your project, and then everything should work
(as long as CG libs are setup correctly in the first place that is)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Project is avaiable on:
http://code.google.com/p/irrcg/
Version 0.7.1 should be avaiable soon, because in last time I have got many work, so I can't release it.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
nickle
Posts: 17
Joined: Sun Feb 15, 2009 5:29 pm

Post by nickle »

I tried to get it work with Irrlicht 1.5.
It gives me this linking error

error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: class IrrCg::ICgMaterialParameter * & __thiscall std::vector<class IrrCg::ICgMaterialParameter *,class std::allocator<class IrrCg::ICgMaterialParameter *> >::operator[](unsigned int)" (??A?$vector@PAVICgMaterialParameter@IrrCg@@V?$allocator@PAVICgMaterialParameter@IrrCg@@@std@@@std@@QAEAAPAVICgMaterialParameter@IrrCg@@I@Z)

So do I need to revise some of the internal code to get it work besides "IDirect3DTexture9"->"IDirect3DBaseTexture9"?
h.a.n.d
Posts: 15
Joined: Fri Feb 13, 2009 1:38 pm

Post by h.a.n.d »

I had some difficulties myself getting IrrCg running with Irrlicht-1.5 -
So I'll post a little checklist of things you will need:

Prework
1. Download IrrCg 0.7
2. Download Nvidia Cg 2.1 -> install it
3. Download DirectX SDK -> install it

IDE Settings
1. Open an already running irrlicht-1.5 project in your IDE
(So you are sure irrlicht is running properly!)
2. Copy IrrCg.cpp + IrrCg.h, from the IrrCg_v0_7 include+source folders, into your project source folder
3. Add the irrlicht-1.5\source\Irrlicht folder into your project include
4. Add the <your dir>\NVIDIA Corporation\Cg\include to your project include
5. Add the <your dir>\Microsoft DirectX SDK (November 2008)\Include to your project include

6. Add all Nvidia Cg libs (dlls) to your linker:
-L"<your dir>\NVIDIA Corporation\Cg\bin"

(If you are using Eclipse don't forget to add: cg, cgD3D9, cgGL in the C++ Linker\Libraries\Libraries (-I) tab)

7. In the IrrCg.cpp replace:

Code: Select all

// Get Direct3D Texture Name. Like standard Irrlicht getDX9Texture().
#ifdef IrrCgD3D9
IDirect3DTexture9* CD3D9Texture::getDX9Texture() const
{
	return Texture;
}
with:

Code: Select all

// Get Direct3D Texture Name. Like standard Irrlicht getDX9Texture().
#ifdef IrrCgD3D9
IDirect3DBaseTexture9* CD3D9Texture::getDX9Texture() const
{
	return Texture;
}
and:

Code: Select all

    // Textures Functions.
    void ICgD3DServices::EnableTexture( CGparameter param,ITexture* Tex2D )
    {
        IDirect3DTexture9* Texture = reinterpret_cast<CD3D9Texture*>(Tex2D)->getDX9Texture();
        cgD3D9SetTexture( param,Texture );
    }
with:

Code: Select all

    // Textures Functions.
    void ICgD3DServices::EnableTexture( CGparameter param,ITexture* Tex2D )
    {
        IDirect3DBaseTexture9* Texture = reinterpret_cast<CD3D9Texture*>(Tex2D)->getDX9Texture();
        cgD3D9SetTexture( param,Texture );
    }
So thats all you need. Use IrrCg like in the examples and have fun with it!

And here is the important part:
Thank Nadro for his fine work!

"Thank you Nadro!!!" ;-)
Post Reply