Sign in to follow this  

HLSL to GLSL

This topic is 4197 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
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
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

This topic is 4197 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this