Page 1 of 1

Native Cg shading language support in Irrlicht

Posted: Sun Jun 26, 2011 5:39 pm
by Nadro
Hi,

As I said in "Project proposal: IrrTech" topic, I tried add native Cg shading language support for Irrlicht and this is effect of my work:
https://sourceforge.net/tracker/index.p ... tid=540678
If You have some suggestions or You'll find some issues with this code I'll try help. If all will be ok I hope that this code will be merged with standard Irrlicht.
It support both D3D9 and OpenGL drivers.

I tested it with NVIDIA Cg 3.0 February 2011

Cheers,

Posted: Sun Jun 26, 2011 8:29 pm
by devsh
I might have to learn Cg :S

anyway buggy race is epic... I love you for the linux thing!

Posted: Sun Jun 26, 2011 8:44 pm
by ent1ty
From what I've seen, it looks a lot like(if not even worse than) HLSL. That was a really stupid decision to make :roll: :? :evil: :(

Posted: Sun Jun 26, 2011 9:35 pm
by 3DModelerMan
Native CG support would be awesome. It would make it so we would only have to maintain one shader for both GL and D3D.

Posted: Sun Jun 26, 2011 11:03 pm
by shadowslair
Taking a quick look- it looks even better than the old implementation. Will try it as soon as I get some free time for programming. Thanks for continuing working on it. I`ve used Cg with the old one, and yes, there are only minor differences in HLSL/Cg, which is really nice. Hope it will take its place in the engine. :wink:

Posted: Mon Jun 27, 2011 1:26 am
by Midnight
good or not somebody had to be the geek. nice work nadro keep it coming!

Posted: Mon Jun 27, 2011 2:31 am
by Kalango
Awesome, i intend to chekc it out pretty soon, thanks.

Re: Native Cg shading language support in Irrlicht

Posted: Sat Jul 02, 2011 12:14 am
by Nadro
I already opened a tracker for this patch. I hope, that it will speedup process of merge it with Irrlicht. I'm still waiting for potentially bug reports. In my internal tests I didn't find an issues, but maybe You will find something.

Re: Native Cg shading language support in Irrlicht

Posted: Sat Jul 02, 2011 12:35 pm
by hybrid
Actually it won't speed up the integration, as the only thing missing so far is some free time on my side. But it does not make things worse, and helps to not forget it if it takes much longer still.

Re: Native Cg shading language support in Irrlicht

Posted: Sat Jul 02, 2011 3:49 pm
by devsh
hybrid.. can't we have an IRR_EXPERIMENTAL compile flag for all the patches we submit that look OK, but have not been thoroughly tested to YOUR standards (which are high). So you ship irrlicht with the IRR_EXPERIMENTAL flag undefined but the user can change it and ofcourse there will be a massive print that the features enabled by that flag have not been thoroughly tested and could render the engine unstable however unlikely that is.

Re: Native Cg shading language support in Irrlicht

Posted: Sat Jul 02, 2011 9:10 pm
by hybrid
Simply said: No.
Most things can be compiled without altering the engine, so just put them into irrExt or some other place and put them into your app. Things which need to alter the engine have to be put onto your own builds of Irrlicht, or you wait for the next release. You can use SVN/trunk to get those changes which will be part of the next release. But that's it what is possible from our side. Sometimes we might also branch away (e.g. for the ogl-es changes), but this happens quite seldom because we don't have that many developers that there are conflicts from our development.

Re: Native Cg shading language support in Irrlicht

Posted: Tue Jul 05, 2011 9:01 am
by fmx
Great stuff Nadro, good to see you haven't abandoned Cg :wink:

Re: Native Cg shading language support in Irrlicht

Posted: Tue Jul 12, 2011 6:14 am
by tinhtoitrangtay
Great work but it don't full with irrCg.

Re: Native Cg shading language support in Irrlicht

Posted: Tue Jul 12, 2011 2:08 pm
by Nadro
Yes, it doesn't support XML materials (but it was enough only for simple shaders, so it isn't too important feature), CgFX and enableTexture in shader callback (but this was unoptimized force method for enable more textures, so it wasn't good for a final products). Other features like support for more uniforms type I will add soon. Of course if You switch from irrCg to native Cg use via Irrlicht interfaces You must rewrite shader callback, but this is very easy step.

BTW. Thanks all for all comments about this patch :)