HLSL to GLSL
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
I thought I read something about a Cg to GLSL converter/program on these forums but I couldn't find the thread.
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
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
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
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 ;-)
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement