About shaders

I want to start to use shader with OpenGL.
And i have several questions:

  1. Can i do the same effect with Cg and the future GLSlang?

  2. Does Cg work with ATI grphic cards (radeon 9700/9800)? will it work with all video card (ATI, NVIDIA, 3DLabs,…) and will it continue to be supported for long time?

  3. Will GLSlang works with todays video card like Cg (GeForce 4/FX, or radeon 9700/9800)?

  4. How can i compile GLSlang shaders? And will it works with MinGW? Where can i find the libraries?

  5. Where can i found some documentations about GLSlang? (for beginner)

Thanks.

  1. Yes, since both provides enough information to do what the current HW can handle.

  2. Yes, CG compiles to the ARB vertex and fragment program extensions.

  3. i guess it will work on Fx and 9700/9800 but not on gf4 since the minimial requirements are set to high for that. But we will see when drivers supporting glsl comes out.

  4. you compile it via openglfunctions… so you send the source to the opengldriver and then you let the driver compiles it. So it works will all languages/compilers that can use opengl, no extra libraries are needed.

  5. Look at some early examples on 3dlabs web… since no driver yet supports it, noone has done a tutorial yet.

Thanks.

Originally posted by greg2:
Does Cg work with ATI grphic cards (radeon 9700/9800)? will it work with all video card (ATI, NVIDIA, 3DLabs,…) and will it continue to be supported for long time?

Cg’s support is being dropped by nvidia already

?
Why?
Cg is new, and Nvidia has created it.

Because now there is a high level shading language available for both major 3D APIs (DX9’s HLSL and OpenGL’s glslang).
Cg is not needed anymore.

Originally posted by kehziah:
Because now there is a high level shading language available for both major 3D APIs (DX9’s HLSL and OpenGL’s glslang).
Cg is not needed anymore.

I disagree with that. Cg will soon be less useful than it is now but CgFX is still a step foward other shading languages and anyway, Cg has been already introduced in DCC programs. Unless the same happens to other shading languages, Cg will be useful.

The fact Cg can be ported over D3D or GL is another nice advantage. I personally don’t care for that but a lot of developers will want to develop for Xbox / Xbox2 and PC(GL) without changing their assets too much (shaders are not exaclty assets, but they are very close to them). Cg allows a faster transition and that’s a definite plus.

EDIT: repeated word.

[This message has been edited by Obli (edited 10-31-2003).]

  1. no. both languages are different, even if most of the features in one do exist in the other. Actually GLslang is a bit superior than Cg, but in the future Cg can evolve too.

  2. Yes it works for ATi cards, but with ARB profiles. There doesn’t exist an ATi profile.
    Of course Cg support will continue. Currently nVidia works more on DX’s HLSL but that doesn’t mean that Cg is being dropped, and won’t be for several reasons.