GLSL
-
William Finlayson
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
-
A.L.
-
William Finlayson
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
For me it's more that GLSL is the actual OpenGL standard, it's the counterpart for DX HLSL, and not a proprietry solution. Cg can still be used, just by using the compiler to produce GLslang code. Plus, as GLSL is part of the OpenGL standard, it will be around for as long as OpenGL is, which can't be said for Cg, not for sure.
Supporting GLSL doesn't stop people using Cg to develop shaders, and afaik, Irrlicht is meant to have as few dependencies as possible, GLSL adds none, Cg means that users will be dependant the nVidia Cg libraries to build/use Irrlicht. If Irrlicht expands beyond Windows/Linux, then GLSL is the definite winner, GLSL works on any platform supporting OpenGL 1.5, while Cg is win/lin only.
If I'm wrong about any of this then please let me know.
Supporting GLSL doesn't stop people using Cg to develop shaders, and afaik, Irrlicht is meant to have as few dependencies as possible, GLSL adds none, Cg means that users will be dependant the nVidia Cg libraries to build/use Irrlicht. If Irrlicht expands beyond Windows/Linux, then GLSL is the definite winner, GLSL works on any platform supporting OpenGL 1.5, while Cg is win/lin only.
If I'm wrong about any of this then please let me know.
Cg works with ATI hardware too. It's really just another frontend for the same GPU programmability features that OpenGL and DirectX use.A.L. wrote:>GLSL can be applied for both NVIDIA and ATI. So GLSL is a more universal solution.
I would guess this won't be true for that long. nVidia has stated that they'd like it to be portable across other platforms, and there's really no reason at all why it shouldn't be exept maybe that they don't want to support it. Someone will eventually write a generic OpenGL backend for the compiler frontend that nVidia released. At this point, that could be rolled into Irrlicht and Irrlicht wouldn't have any outside dependencies for it. But I don't think this exists yet.William Finlayson wrote:If Irrlicht expands beyond Windows/Linux, then GLSL is the definite winner, GLSL works on any platform supporting OpenGL 1.5, while Cg is win/lin only.
So I agree with a lot of your points. Really, Cg has only one real win that I know of, which is that it could be used with DirectX or OpenGL. To me, this seems to have real value. I may just be lazy, though.
-
William Finlayson
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
It sounds like you have more experience with this then I do. Am I right in thinking that you can just comnpile to a target shader language from Cg? If so, then surely anone who wants to use Cg can write their shaders using Cg, and compile to HLSL and GLSL to use the shaders with Irrlicht, without requiring the Cg runtime?