Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a tool that can convert a fragment shader from hlsl to glsl or glsl to hlsl? I do not want to use cg since it is not able to work on mobile platforms.

Is there a tool that can make it so I only write a shader once?


share|improve this question

I can't vouch for either one, but there is a utility available here for going from HLSL to GLSL:

and here for going the other direction:

The first one is explained more here:

share|improve this answer

Shiny is a new library that aims to make material management and portable shader writing easy. This is achieved mostly with a preprocessor meta language, that can output any of CG, HLSL or GLSL. It is currently geared towards usage with Ogre graphics engine, but that part is abstracted into a separate component, so it shouldn't be hard to plug in any other engine. The library has been / is being integrated into OpenMV and Stunt Rally (disclaimer: I'm a member of the latter).

There is a lengthy introduction here.

share|improve this answer

There's the tool MojoShader which accomplishes what you want:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.