Jump to content
  • Advertisement
Sign in to follow this  
zootroy

HLSL to GLSL

This topic is 4486 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know if there is a tool that will convert HLSL code to GLSL? I am looking through the ShaderX3 book and many of the examples are in HLSL. I could pick up a ref on HLSL, but if a tool exists... TIA Z

Share this post


Link to post
Share on other sites
Advertisement
I thought I read something about a Cg to GLSL converter/program on these forums but I couldn't find the thread.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike2343
I thought I read something about a Cg to GLSL converter/program on these forums but I couldn't find the thread.



NVIDIA Cg shader language will compile to HLSL or GLSL. It's nice because you write shaders in it and use them in either OpenGL or DirectX applications.

http://developer.nvidia.com/object/cg_toolkit.html

Share this post


Link to post
Share on other sites
How are you going to use Cg on ATI? It will compile to ARB_vp and ARB_fp which are deprecated now.

I remember someone from nVidia said that you can use the Cg compiler to translate between the languages but sorry, I didn't keep the link. It was on the shading language forum at opengl.org

Share this post


Link to post
Share on other sites
Umm... I thought Cg worked on ATI. I've run Cg scripts on my 9800Pro unless I smoked some really good drugs and just seen it working ;-)

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
How are you going to use Cg on ATI? It will compile to ARB_vp and ARB_fp which are deprecated now.

I remember someone from nVidia said that you can use the Cg compiler to translate between the languages but sorry, I didn't keep the link. It was on the shading language forum at opengl.org


The new beta version has a profile for GLSL. It can also take a GLSL code as input too and convert it to any of the profiles. And as nef stated, Cg is lot like HLSL, so carefully designing the code to be both, you can use Cg to convert the HLSL to GLSL.
GLSL to HLSL is little tougher.

Oh yeah, the link
ch.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!