View Full Version : Shading language

09-27-2004, 10:59 PM
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?

09-28-2004, 02:00 AM
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 :)

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 (http://developer.nvidia.com/object/FX_Composer_FAQ.html)

3/ I don't know, but maybe you can check the extensions
nVidia developpers website (http://developer.nvidia.com/page/home)


09-28-2004, 02:17 AM
Ok, I understand. One more question however:
There are any other shading languages in use, or this two are the only ones?

09-28-2004, 08:26 AM
_High Level Shading Language from Microsoft
_GLSL ;)
_nVidia 'C for Graphics' language

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

09-29-2004, 02:10 AM
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)

09-29-2004, 02:33 AM
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 nehe.gamedev.net, but not about normal mapping =/

09-29-2004, 04:38 AM
Get ShaderDesigner from http://www.typhoonlabs.com