Running Cg and GLSL in parallel

I’m not too aware of how the underlying architecture works when it comes to compiled shader code.

How dirty (or possible) is it to have Cg and GLSL shaders loaded at once (obviously not running at once, but say drawing one item in a scene while using a Cg shader, then switching over to a GLSL shader)

That’s perfectly possible and should work fine. You can also use assembly shaders (i.e. ARB_vertex/fragment_program shaders) for some objects, but GLSL shaders for others. In the end, all types of shaders will get compiled to a hardware-specific shader program by the driver. So in the end it doesn’t make much difference if the shader is originally written in Cg or GLSL, apart from the fact that you might run into different compiler bugs :wink:

I use Cg and GLSL in the Ogre rendering engine at the same with no problems. ie a rendering operation that binds an arbfp and then another rendering operation that binds GLSL.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.