|
|
GLSL vs NV CG
Hi All,
What are the differences between GLSL & nVidia's cg shading
languages?. I'm currently using cg but I'm wondering whether I should
migrate to GLSL as I assume that this is the 'official' shading
language. Are there support issues on different graphics cards?. cg
seems to work fine for both nVidia & ATI cards. Also, is one more
'capable' than the other.
Thanks in advance,
Dave
|
|
0
|
|
|
|
Reply
|
Dave
|
9/26/2007 1:44:13 PM |
|
On 2007-09-26, Dave <dave_m_moore@post2me.freeserve.co.uk> wrote:
>
> Hi All,
> What are the differences between GLSL & nVidia's cg shading
> languages?. I'm currently using cg but I'm wondering whether I should
> migrate to GLSL as I assume that this is the 'official' shading
> language. Are there support issues on different graphics cards?. cg
> seems to work fine for both nVidia & ATI cards. Also, is one more
> 'capable' than the other.
I prefer GLSL for many reasons:
- Its integration with the rest of the OpenGL is better, for instance
you can access the OpenGL state in both shaders.
- You can pass data to be interpolated from the vertex shader to the
pixel shader, just by declaring the same global variable in both of them
as "varying".
- It's built-in to the driver and doesn't require a separate proprietary
library. Especially since I write free software, the proprietary library
of Cg was actually the reason I switched away from it.
--
John Tsiombikas (Nuclear / Mindlapse)
http://nuclear.sdf-eu.org/
|
|
0
|
|
|
|
Reply
|
John
|
9/27/2007 2:24:18 AM
|
|
> Hi All,
> What are the differences between GLSL & nVidia's cg shading
> languages?. I'm currently using cg but I'm wondering whether I should
> migrate to GLSL as I assume that this is the 'official' shading
> language. Are there support issues on different graphics cards?. cg
> seems to work fine for both nVidia & ATI cards. Also, is one more
> 'capable' than the other.
Like John said, GLSL is integrated with OpenGL. I like the fact that you can
set fog, lights and materials with the same fixed function calls and access
those parameters from within the shaders such as
gl_FrontMaterial.ambient
gl_FrontMaterial.diffuse
gl_Fog.start
gl_Fog.end
I started with cg and switched to GLSL, I think it's easier to program the
shaders.
Sorry, I can't tell you about support issues.
|
|
0
|
|
|
|
Reply
|
Randall
|
10/1/2007 8:05:06 PM
|
|
John Tsiombikas pisze:
> - You can pass data to be interpolated from the vertex shader to the
> pixel shader, just by declaring the same global variable in both of them
> as "varying".
Hi,
I have started read about GLSL "provoked" this topic. So far I was using
Cg language, and I have a question:
Do you know if there is any limitation for the numer of varying
variables that can be passed from vertex to fragment program ? In the Cg
language I could pass interpolated values only through TexCoords - so
there is a limitation to 8 vectors.
I couldn't find this information in the documentation.
Krzysiek
|
|
0
|
|
|
|
Reply
|
ISO
|
10/28/2007 3:47:16 PM
|
|
Krzysiek So�ek schrieb:
> Do you know if there is any limitation for the numer of varying
> variables that can be passed from vertex to fragment program ? In the Cg
> language I could pass interpolated values only through TexCoords - so
> there is a limitation to 8 vectors.
it's implementation dependant - see
http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_shader.txt
under MAX_VARYING_FLOATS_ARB.
Under http://www.delphi3d.net/hardware/listreports.php you can check the
value for the available cards.
regards Ralph
|
|
0
|
|
|
|
Reply
|
Ralph
|
10/29/2007 7:39:03 AM
|
|
Ralph Kern pisze:
>
> it's implementation dependant - see
> http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_shader.txt
> under MAX_VARYING_FLOATS_ARB.
>
> Under http://www.delphi3d.net/hardware/listreports.php you can check the
> value for the available cards.
>
> regards Ralph
Great !!
Thanks & regards
Krzysiek
|
|
0
|
|
|
|
Reply
|
ISO
|
10/29/2007 3:44:59 PM
|
|
|
5 Replies
144 Views
(page loaded in 0.091 seconds)
Similiar Articles: a new man :) 3
74  gakusei 7/11/2012 11:34:32 PM
|
|
|
|
|
|
|
|
|