Can OpenGL be more versatile ?

Started by
8 comments, last by KumGame07 17 years, 1 month ago
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
Best Regards,KumGame07
Advertisement
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?
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
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
Best Regards,KumGame07
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.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
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 phantom
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.

Really? Fantastic. I quite like CgFX; to have something like that for GLSL would be great.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
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
Best Regards,KumGame07
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
Best Regards,KumGame07
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.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Okay.

Thanks for the reply
Best Regards,KumGame07

This topic is closed to new replies.

Advertisement