Native Cg shading language support in Irrlicht
Native Cg shading language support in Irrlicht
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,
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,
Last edited by Nadro on Tue Dec 27, 2011 10:12 pm, edited 1 time in total.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
From what I've seen, it looks a lot like(if not even worse than) HLSL. That was a really stupid decision to make
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Native CG support would be awesome. It would make it so we would only have to maintain one shader for both GL and D3D.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
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.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Re: Native Cg shading language support in Irrlicht
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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Native Cg shading language support in Irrlicht
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
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.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Native Cg shading language support in Irrlicht
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.
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
Great stuff Nadro, good to see you haven't abandoned Cg
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
Re: Native Cg shading language support in Irrlicht
Great work but it don't full with irrCg.
Re: Native Cg shading language support in Irrlicht
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
BTW. Thanks all for all comments about this patch
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes