Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

Thanks

share|improve this question

3 Answers 3

I can't vouch for either one, but there is a utility available here for going from HLSL to GLSL: https://github.com/aras-p/hlsl2glslfork

and here for going the other direction: http://code.google.com/p/angleproject/

The first one is explained more here: http://aras-p.info/blog/2010/05/21/compiling-hlsl-into-glsl-in-2010/

share|improve this answer

There's the tool MojoShader which accomplishes what you want: http://icculus.org/mojoshader/

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

Your Answer

 
discard

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.