Sign in to follow this  
ajm113

GLSL or CG?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Ok, you guys got me convinced on going with GLSL. It seems to be a good worth too try out and see what I get out of it.

Thanks, I have to go.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this