Nvidias CGFX for Linux floating around

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Nvidias CGFX for Linux floating around

Post by Lee04 »

Hi

CGFX 1.3 will be available for Linux as well as PC.
Some people are already testing CGFX on Linux even....

Have anyone done this? Tried it I mean?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

I've found (and reported) bugs with both Cg 1.2 and Cg 1.3, unfortunately the Cg 1.3 one is pretty fatal (can't compile any vs_1_1 shaders with the '-profile-opts dcls' option in cg.dll, only on the the command line), but I've not received any updates from nVidia on it yet.

I can only assume it only happens when you use just cg.dll to generate assembler, rather than using the D3D/GL specific Cg runtime dlls to set the renderstate in D3D / GL for you (which we don't want to do).
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Sorry

Post by Lee04 »

Hi Sinbad

Sorry for not being clearer in my posts

What I mean is Ogre can use FX know because there is a Linux version
of CGFX Nvidias free SDK for loading and using FX files.

Hopes this awakens you from all resource programming you are doing...
that seams to make you wery.. :)
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

CGFX1.3 is a nice shader editor and having the capability to import its output into Ogre would be nice for a lot of people. But Ogre material files are much more flexible and do more than FX files so I don't seeing FX files being supported by the core library (my opinion). I see this being a community effort to develop a converter from FX to .material script.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Yeh

Post by Lee04 »

FX is here to stay I am afreid. And CGFX looks like a free lunch.

Must tools I know off DCC apc shader editors etc supports FX files.
So should Ogre I belive, how it does it is another matter.

I would like to see full support for FX.
Think of having crazy eddies GUI with sliders in Ogre for all parameters...
Would be nice.

Games and apps could have communities remaking new "skins" for games and apps made with Ogre.

Maybe a bit far fetched but FX is good and CGFX is almost a free lunch.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Nice idea, but the 1.0.0 schedule is already too full so this this will have to be a community conversion tool, like nfz said. Since CgFX is pretty much just D3D .fx, a converter would probably work for both if written correctly.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Post by Lee04 »

Just to be sure

I just want too say that CGFX works for OpenGL as well just as good.

CGFX makes HLSL and CG work both in DX and openGL.
And supplies APIs for both.

But it dosn't support GLslang (openGL shader language) right know.

However DX don't support openGL shader so.

I rather use HLSL or CG that works in both openGL and DirectX on both Linux PC and perhaps later Mac than waiting around for openGL shader languages to start working in DirectX....
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Yeah, my point was that you culd support both with one converter if you put your mind to it, since the syntax of CgFX is identical to .fx (since MS worked with nVidia on it), and it's just text after all. And that's a bonus because tools like RenderMonkey only support .fx,so with a converter like that you could support far more than just CgFX.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

OK

Post by Lee04 »

I just hope some one adds this to Ogre somehow.

I stuck with other stuff right know.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

So CgFX provides a way to parse and compile HLSL under GL?

If this can be done with a straightforward API I'll give it a try :) Too late to be in 1.0 though.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Pretty much, although really it's Cg which implements the HLSL (ie the shader), CgFX adds all the extra cruft like state setting etc - all the stuff .material lets you do.

There are a few more commands available in Cg than in HLSL to deal with some nVidia-specific profiles, and you have to transpose the matrices since HLSL uses the same stupid transposed matrices of D3D itself ie you have to do V * M1 * M2 instead of he more 'standard' (if you read most maths texts) M2 * M1 * V, but otherwise yes.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Tools , tools tools

Post by Lee04 »

Most of todays tools produce or/and loads FX files.

CGFX has one API for DirectX and one API for OpenGL.
And then a common API part.
Last edited by Lee04 on Mon Dec 13, 2004 8:49 am, edited 1 time in total.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: Tools , tools tools

Post by sinbad »

Lee04 wrote:CGFX has one API for DirectX and one API for OpenGL.
And then a common API part.
.. none of which we can use. The trouble with this API is that it wants to control the state pipeline, which is useless to us.

The only thing that's useful to us is the format. It needs to be converted to .material to be any use in Ogre.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

A FXToOGREMaterialConverter would be a cool thing to have; I don't vote for internal FX support. Just a design decision to keep the core "light" and independent, and make it easier to include ogre-specific stuff; we also only support one .mesh format internally.

Adding HLSL support to the CG plugin is on my todo list for post 1.0 now.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

:wumpus: wrote:Adding HLSL support to the CG plugin is on my todo list for post 1.0 now.
I'm confused - what I meant was that Cg essentially is HLSL, or at least a superset of it. The only thing you have to do is transpose your matrix operations to get around the D3D-ness of it. I've converted several HLSL shaders to Cg just by doing that, so I don't think you really have to do anything here, at least on the HLSL end.
Meddten
Halfling
Posts: 71
Joined: Mon Aug 09, 2004 8:28 pm
Location: Austria

Post by Meddten »

Just for info

Cg will not support Shader Model 3.0 in the near future for Direct3D (ps_3_0 and vs_3_0), there will be only Cg support for OGL (fp40 and vp40)

This information is directly from Nvidia. I have asked them when CgRuntime will support SM3.0, and that was the answer.

So Ogre should be HLSL compatible not only in same syntax.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

OGRE *does already* support HLSL for DirectX

Sinbad: I was confused on the Cg/HLSL thing, I thought HLSL was an entirely seperate language from Cg
migposada
Gnoblar
Posts: 1
Joined: Thu Dec 23, 2004 12:06 am

Post by migposada »

I've tried to use CgFX as my solution for all the materials in an engine i was developing, and i didn't like it because:

1) They haven't yet implemented all the functionality of Microsoft's FX.
2) They haven't done a full documentation (just a couple of readmes and introduction documents).
3) NVidia seems to be focusing more on Microsoft's FX (with tools such as FX Composer) than on improving their own.

Anyway, Ogre material system is more powerful, so I don't see much the point of using an FX format.

Even with the standarized semantics and annotations, we cannot use any effect everywhere, yet. Many effects created with external tools cannot be used as-is in an engine, we are far from being able to universalize shaders. A serious developer still has to write materials/effects/shaders with a specific rendering engine in mind.
mash
Gnoblar
Posts: 10
Joined: Thu Dec 23, 2004 5:58 pm

FX Composer for Linux

Post by mash »

-------------------------------------------------------------------------------------------
> Do you plan to release FX Composer 1.6 for Linux?

The current version of FX Composer helps developers create HLSL shaders
using the DirectX .FX file format.
We have no plans to port FX Composer to Linux.

William Ramey
NVIDIA Corporation
-------------------------------------------------------------------------------------------

Bye!
Mash
Meddten
Halfling
Posts: 71
Joined: Mon Aug 09, 2004 8:28 pm
Location: Austria

Post by Meddten »

An addition to my upper thread
Shader model 3.0 is supported by Cg under OpenGL through the fp40 profile.
We don't have any plan to add a ps_3_0 profile at this time.

Best regards,

Cyril Zeller
NVIDIA Developer Technology
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

They'd be crazy to add a ps_3_0 profile, I mean, MS has their own HLSL parser why not use that for directx?
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Post by Lee04 »

Shader model 3.0 is supported by Cg under OpenGL through the fp40 profile.
We don't have any plan to add a ps_3_0 profile at this time.

Best regards,

Cyril Zeller
NVIDIA Developer Technology
Well it dosn't say that CGFX won't support ps30 is simply says that it uses fp40 to implement iy.

So ps3.0 can still be used with cgfx right?

A tool such as fx composer dosn't neccerally have to run on all platforms.
Specials tools can run on very abscure systems and people will use the tool any way if they are the only tool. Windows are not so absqure so I think fx composer is OK for being a tool.


Have you seen RT/Shader:Ginza?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Lee04 wrote: So ps3.0 can still be used with cgfx right?
?
They say they do not have plans to add a fp3_0 profile. so, no.
Post Reply