Shading language

  1. What is the relationship between OGL shading language and NVIDIA’s cg?
    Do they use same extensions?
  2. What language use NVidia FX composer?
  3. When I first see a shading program, is there any way to know that is in cg or OGL shading language?

1/ The HLSL (High Level Shading Language from Microsoft) and nVidia C for Graphics (Cg) were developped together. You can read the FAQ on nVidia Cg’s official website, but I don’t know between GLSL and Cg :slight_smile:

2/ The nVidia FX Composer use HLSL Microsoft langage

FX Composer is a fully functional shader development environment for DirectX 9.0 HLSL FX files

Does FX Composer work with Cg or GLSL?

We are always evaluating opportunites to provide powerful tools for developers, but have no plans to add support for other languages to FX Composer. FX Composer was built to support the large number of developers using HLSL in their applications.

read the FX Composer's FAQ

3/ I don’t know, but maybe you can check the extensions
nVidia developpers website


Ok, I understand. One more question however:
There are any other shading languages in use, or this two are the only ones?

_High Level Shading Language from Microsoft
_GLSL :wink:
_nVidia ‘C for Graphics’ language

I don’t know if there only 3 language ( be careful Nvidia Cg != HLSL :smiley: ) But there are the most used IMHO :slight_smile:

I am interested about GLSL, so i downloaded GLSLangSpec.Full.1.10.59.pdf from this site. The documentaion is ok, but there are no examples. Do you know a web adress with examples, source code?
(I want a example with normal mapping)
Is there any connection with shading programs written in assembler(here is a example of what I mean):

TEMP temp;
ATTRIB tex0 = fragment.texcoord[0];
ATTRIB col0 = fragment.color;

PARAM pink = { 1.0, 0.4, 0.4, 1.0};

OUTPUT out = result.color;

TEX temp, tex0, texture[0], 2D;

MOV out, temp;

MUL out, col0,temp;
MUL out, temp, pink;

It will be usefull a link that will show me how to use shaders from c++(how to load , compile?, set parameters)

Hmm if you want to see GLSL sample, maybe you can download the ATI SDK, there is some examples
There is an article about that on, but not about normal mapping =/

Get ShaderDesigner from