Page 9 of 16

Posted: Thu Nov 20, 2008 6:26 pm
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

Posted: Fri Nov 21, 2008 2:52 pm
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.

Posted: Fri Nov 21, 2008 5:59 pm
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!

Posted: Fri Nov 21, 2008 7:21 pm
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.

Posted: Sat Nov 22, 2008 2:25 am
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.

Posted: Sun Dec 14, 2008 4:52 pm
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.

Posted: Sun Dec 14, 2008 10:06 pm
by Nadro
Yes, You can use this shaders via IrrCg as *.cg, but You have to remember remove preprocessor parameters in this shaders.

hmmm

Posted: Thu Jan 15, 2009 3:56 pm
by 3DModelerMan
Cold someone provide a win32 mingw build?

Posted: Thu Jan 15, 2009 5:17 pm
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.

Posted: Fri Jan 16, 2009 1:01 pm
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.

goood

Posted: Fri Jan 16, 2009 3:16 pm
by 3DModelerMan
Alright!!! I've got a code::blocks project that desperatly needs some shaders.

Posted: Fri Jan 23, 2009 12:39 pm
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)

Posted: Sat Feb 14, 2009 1:49 pm
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.

Posted: Mon Feb 16, 2009 4:51 pm
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"?

Posted: Mon Mar 16, 2009 7:16 pm
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!!!" ;-)