GLSL or CG?
I am looking for a good quick make shader in a way that can maybe perhapses make good low detailed bump mapping and or can create good cartoonist like figure on a object when rendering. My game engine I am kind of going for is a simple boat sim.
I don't know which one has more help and has good documentation on how too work with effects.
They are not that different in terms of functionality, so you can easily enough use examples from one in the other. Personally I don't bother with Cg, because using it creates extra dependencies in the project.
I would use GLSL, but the choice is yours. Get the "More OpenGL Game Programming" book it covers GLSL and most of the examples have GLSL code. Hell download RenderMonkey it has many built in examples for what you want and they are in GLSL.
For what its worth i use Cg. At the time - Cg was the only offering available. If I were to 'start afresh' I think at a pinch I would go with GLSL because:
(1) OpenGL standards now include a GLSL as a standard - thus integrates nicely with standard OpenGL commands etc...
(2) Less DLL dependencies. I.e. Don't need a Cg runtime DLL to be shipped with the application.
But ... either method is fine. Just depends upon what you want to do really.
(1) OpenGL standards now include a GLSL as a standard - thus integrates nicely with standard OpenGL commands etc...
(2) Less DLL dependencies. I.e. Don't need a Cg runtime DLL to be shipped with the application.
But ... either method is fine. Just depends upon what you want to do really.
the only main reason to use CG over GLSL at the time is if you want your shaders to be cross API supported, that is if you want to both add opengl and directx rendering to your engine.
also (im not sure about this) if you want specific nvidia cards features that you cant access by using GLSL, but again i dont know if CG offers new features specific for nvidia cards.
also (im not sure about this) if you want specific nvidia cards features that you cant access by using GLSL, but again i dont know if CG offers new features specific for nvidia cards.
Cg has a lot of little niceties which GLSL currently lacks. Like in the realm of file-loading, where you have to manually load shader files with GLSL. Whereas the Cg runtime has functions to load the shaders, with #include support. Or having compiled shaders, and an FX framework.
However, either one works, and hopefully both will be on par in the near future with the upcoming GL revisions. If you're just playing around with shaders, I'd recommend GLSL. If you plan to do something substantial, you might want to give Cg a whirl.
However, either one works, and hopefully both will be on par in the near future with the upcoming GL revisions. If you're just playing around with shaders, I'd recommend GLSL. If you plan to do something substantial, you might want to give Cg a whirl.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement