GLSL

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
A.L.

GLSL

Post by A.L. »

How about GLSH support? I think it would be more useful than Cq.
A.L.

RE: GLSH -> GLSL

Post by A.L. »

Misprint: I mean GLSL of course.
William Finlayson
Posts: 61
Joined: Mon Oct 25, 2004 12:11 am

Post by William Finlayson »

Murphy
Posts: 290
Joined: Mon Dec 13, 2004 12:06 am
Location: United States
Contact:

Post by Murphy »

As I mentioned in the other thread, I'm interested in this too, but my old card didn't support it. Since my new one does, I've actually put a bit ot work into it (mostly research since I've never used GLSL before).

But I'm interested in why you think this would be more useful than Cg.
A.L.

Post by A.L. »

>But I'm interested in why you think this would be more useful than Cg.

GLSL can be applied for both NVIDIA and ATI. So GLSL is a more universal solution.
William Finlayson
Posts: 61
Joined: Mon Oct 25, 2004 12:11 am

Post by William Finlayson »

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.
Murphy
Posts: 290
Joined: Mon Dec 13, 2004 12:06 am
Location: United States
Contact:

Post by Murphy »

A.L. wrote:>GLSL can be applied for both NVIDIA and ATI. So GLSL is a more universal solution.
Cg works with ATI hardware too. It's really just another frontend for the same GPU programmability features that OpenGL and DirectX use.
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.
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.

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

Post by William Finlayson »

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?
Murphy
Posts: 290
Joined: Mon Dec 13, 2004 12:06 am
Location: United States
Contact:

Post by Murphy »

I'm not sure how easy this is with the current tools, but I think it should be possible. I believe the Cg compiler has backends for DX shader programs as well as ARB_vertex_program and ARB_fragment_program. So it's really just a matter of convenience.
Post Reply