5

Can I use Cg shader language with OpenGL ES 2.0?

I know that I can use GLSL with OpenGL ES 2.0 and Cg with OpenGL, but I wonder if there is Cg support for OpenGL ES.

Jiho Choi
  • 119
  • 1
  • 8
  • My Tegra 2 chip advertises the `GL_EXT_Cg_shader` extension, which would apparently allow Cg shaders. I imagine any OpenGL ES 2.0 implementation which advertises the extension supports Cg shaders. I haven't tried it yet, and this approach wouldn't work on all ES 2.0 implementations since it relies on an extension. Still, worth looking into. – Nicu Stiurca Dec 12 '12 at 21:56

1 Answers1

3

I'm sure you've figured out the answer by now, but OpenGL ES 2.0 supports GLSL only. Furthermore, it uses a modified version of GLSL (precision modifiers being the most noticeable change) so Cg to GLSL conversion tools, such as those Nvidia supply, are unlikely to produce code you can just use. It should be very close though.

Tommy
  • 99,986
  • 12
  • 185
  • 204