Horde3D

Next-Generation Graphics Engine
It is currently 21.12.2024, 19:55

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Cg shaders?
PostPosted: 18.05.2007, 16:51 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
Do you plan to include support for Cg shaders in a future Horde release? Actually this is more of a feature request. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 18.05.2007, 17:28 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 18.05.2007, 18:39 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 12:43 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 19.05.2007, 13:15 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 21.05.2007, 07:59 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
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 :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group