Horde3D
http://horde3d.org/forums/

Cg shaders?
http://horde3d.org/forums/viewtopic.php?f=1&t=102
Page 1 of 1

Author:  SpOOky [ 18.05.2007, 16:51 ]
Post subject:  Cg shaders?

Do you plan to include support for Cg shaders in a future Horde release? Actually this is more of a feature request. :)

Author:  marciano [ 18.05.2007, 17:28 ]
Post subject: 

At the moment I don't have any plans for that.

GLSL is a really powerful and nice shading language. Some advantages of it over CG are:

- It is not vendor specific
- It is integrated directly into OpenGL without the need for additional libraries
- Development is pushed by the Khrons group (OpenGL 3.0 and 4.0 are coming this year)
- It doesn't have different profiles which cause additional trouble

Honestly I don't see any advantage in CG. Integrating a second shading language would probably require some hacks and parallel code paths since some features of GLSL are certainly not directly available in CG. One of the best features of Horde is that it is small and clean and I wouldn't want to destroy that :)

So my question is, why having a second language if you can do the same with the one that is available?

Author:  SpOOky [ 18.05.2007, 18:39 ]
Post subject: 

from what i know cg is compiled at runetime into hlsl or glsl (so all features of both languages should be supported), it has a c-like syntax that makes an easy cross over from c++, therefor easier to learn. cg is neither vendor specific or platform specific although it was developed by microsoft and nvidia. from my point of view a better language.

Hordes OO design should work in favor of adding this new feature, but it is your decision

Author:  marciano [ 19.05.2007, 12:43 ]
Post subject: 

GLSL also has a C-syntax. The difference between the languages is pretty small.

Here is a quick comparison.

http://appsrv.cse.cuhk.edu.hk/~wmpang/tutorials/glsl.html


Personally I prefer the syntax of GLSL but that's purely a matter of taste. If Horde should ever support DirectX, Cg could be an option as a unified language but currently we don't have plans concerning DX. I'm rather looking forward to the next OpenGL versions (3 and 4) which look really promising.

Author:  SpOOky [ 19.05.2007, 13:15 ]
Post subject: 

Actually one of the reasons i stated that it can be compiled into both the languages was to sustain GLSL. Even more, I am kinda against DX. One of the reasons I have chose Horde was that it is OpenGL only. I like its portability and hope that one day Horde will become cross-platform

Author:  DarkAngel [ 21.05.2007, 07:59 ]
Post subject: 

For now, if you want to develop your shaders as Cg, you could compile your cg files into glsl code (i think there is a command line tool for compiling cg files into different kinds of output) and then copy the glsl code into your horde shader files.

It's a bit more work, but it allows you to use Cg without editing the engine :)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/