Can OpenGL be more versatile ?
Hi all,
Currently I'm working on porting a game from DirectX to OGL. The game uses quite a lot of .fx files of DirectX. My question is that is there any way to implement the DirectX fx in OGL?
Will there be any equivalent to DirectX fx available in OGL (as a part of arb) in the near future?
Probably, if this can be introduced, OpenGL will be more easy to use.
Thanks,
KumGame
What you're looking for is the CgFX framework, which loads and helps you to manipulate FX files. Cg (the shading language) is functionally almost the same as HLSL; it uses the same semantics and has the same built-in functions, along with many other similarities. You'll have to apply some minor changes (changing "PixelShader" to "FragmentProgram", changing the ordering of any matrices to the column-major order OpenGL expects, that kind of thing), but other than that, your existing FX files should be pretty much completely compatible. Download and install the Cg Toolkit from NVIDIA, everything you need to get started is in there.
To answer your other question: as Cg/HLSL isn't the language of choice for OpenGL 2.0 (Cg and GLSL were proposed, GLSL was selected), there isn't any FX framework for OpenGL yet, and I'm not sure if the ARB would introduce extensions to support that kind of thing. There's a project going on to build a new software library for FX files which support GLSL; have a look at GLfx.
Out of interest, are you using SAS scripting in your FX files at all?
To answer your other question: as Cg/HLSL isn't the language of choice for OpenGL 2.0 (Cg and GLSL were proposed, GLSL was selected), there isn't any FX framework for OpenGL yet, and I'm not sure if the ARB would introduce extensions to support that kind of thing. There's a project going on to build a new software library for FX files which support GLSL; have a look at GLfx.
Out of interest, are you using SAS scripting in your FX files at all?
Thanks 'iNsAn1tY' for the reply.
I had a glance on GLFX prior to this posting. But I can't use GLSL. I got to support only assembly shaders.
About SAS scripting, I'm not aware of what it is !!! I don't think anything of that sort is getting used.
Thanks
I had a glance on GLFX prior to this posting. But I can't use GLSL. I got to support only assembly shaders.
About SAS scripting, I'm not aware of what it is !!! I don't think anything of that sort is getting used.
Thanks
I think there is a ATI utily to translate DirectX shaders to OpenGL shaders.
Look for this on the Net: HLSL2GLSL
Or similar tools if cannot use it.
Bye.
Look for this on the Net: HLSL2GLSL
Or similar tools if cannot use it.
Bye.
Quote:Original post by iNsAn1tY
To answer your other question: as Cg/HLSL isn't the language of choice for OpenGL 2.0 (Cg and GLSL were proposed, GLSL was selected), there isn't any FX framework for OpenGL yet, and I'm not sure if the ARB would introduce extensions to support that kind of thing.
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
Quote:Original post by KumGame07
Thanks 'iNsAn1tY' for the reply.
I had a glance on GLFX prior to this posting. But I can't use GLSL. I got to support only assembly shaders.
About SAS scripting, I'm not aware of what it is !!! I don't think anything of that sort is getting used.
Thanks
Only assembly shaders? I thought you were probably using HLSL, hence the comments regarding Cg. I guess you'll have to either convert your assembly programs to ARB_vertex_program / ARB_fragment_program assembly or Cg.
SAS scripting is something that's relatively new from Microsoft: it's a scripting component for FX files that gives you much more control over the rendering from within the FX files themselves. Just asked on the off-chance that your project was using it. My final year university project is based around that kind of thing...
Quote:Original post by phantomQuote:Original post by iNsAn1tY
To answer your other question: as Cg/HLSL isn't the language of choice for OpenGL 2.0 (Cg and GLSL were proposed, GLSL was selected), there isn't any FX framework for OpenGL yet, and I'm not sure if the ARB would introduce extensions to support that kind of thing.
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
Really? Fantastic. I quite like CgFX; to have something like that for GLSL would be great.
Thanks for all.
quote
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
/quote
Its really a good news.
One more query. Is there any tool to convert GLSL sahders to assembly equivalents. I think its possible using the Cg tool though I haven't used it. Anyone made use of it?
Thanks
KumGame
quote
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
/quote
Its really a good news.
One more query. Is there any tool to convert GLSL sahders to assembly equivalents. I think its possible using the Cg tool though I haven't used it. Anyone made use of it?
Thanks
KumGame
Thanks for all.
quote
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
/quote
Its really a good news.
One more query. Is there any tool to convert GLSL shaders to assembly equivalents. I think its possible using the Cg tool, though I haven't used it. Anyone made use of it?
Thanks
KumGame
quote
There is a working group which is tasked with developing a framework, I believe it's going to live on top of COLLADA for interchange.
/quote
Its really a good news.
One more query. Is there any tool to convert GLSL shaders to assembly equivalents. I think its possible using the Cg tool, though I haven't used it. Anyone made use of it?
Thanks
KumGame
You can use Cg in you app, write HLSL like Cg shaders with keeping the functionality of assembly shaders in mind (e.g. reduced instruction set, no dynamic branching etc.) and have Cg do the job at runtime.
I did it this way since my current development machine doesn't support GLSL and I don't want to write assembly shaders.
I did it this way since my current development machine doesn't support GLSL and I don't want to write assembly shaders.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement