Sign in to follow this  
Bekos

OpenGL OpenGL 3.1 and Cg/Cg FX

Recommended Posts

Hello everyone! I am building a 3D engine for a commercial title. We are targeting Win, Linux and Apple platforms. The engine will be shader-only and for now, it supports(well.. kinda :P) D3D10 and OpenGL 3.1. Because of this I was thinking to "play" with Cg Fx. [which is the only way(apart from creating your own fx system) for OpenGL to support MS-fx-like shaders]. My question is... does Cg/Cg fx supports OGL3.1? For example.. do the Ogl3.1 semantics (eg InstanceID) work with Cg? Is there something that is not supported? I never touched Cg before and I have no idea. What do you suggest for a Cross-platform(win,linux,mac) ogl3.1/d3d10 commercial 3d engine? Maybe Cg/Cg FX is not a good idea? (Problems with ATI cards maybe?) Thanks for your time.

Share this post


Link to post
Share on other sites
If you create a backwards compatible context in GL 3.1, then there is no reason why CgFX would not work but perhaps I'm wrong since I never used CgFX and Cg.
I only used GLSL.

For ATI cards, you have to compile your Cg shaders into GLSL.
For nVidia, you can do the same and you can also compile towards some low level assembly formats liek GL_NV_vertex_program and GL_NV_fragment_program.

some general Cg info
http://www.opengl.org/wiki/Shading_languages:_Cg

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