Jump to content
  • Advertisement
Sign in to follow this  
Tigra7

OpenGL what language for shaders?

This topic is 4865 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

what is the best for working on next-gen effects like parallax mapping and the sort? i've heard of HLSL, CG, opengl shading language, and i can't find difference s in them. or rather, what is the best shading language for opengl? directx? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
If your using OpenGL then GLSL (Or opengl shader language) is the most common. For DirectX then its HLSL. CG isn't really good because it's not as supported as HLSL and GLSL.

Share this post


Link to post
Share on other sites
All of the languages you mentioned can be used to implement a parallax mapping shader, and the difficulty level among them is almost exactly equivalent.

HLSL is DirectX specific, GLSL (OpenGL Shading Language) is OpenGL specific and CG can be used in both. Which of these is suitable/best for you depends on the rest of the project specifications.

Share this post


Link to post
Share on other sites
But Cg could only be used on nVidia Hardware. Or is it possible to use Cg programs on ATI chips too?

mod42

Share this post


Link to post
Share on other sites
AFAIK Cg kan be used on both nVidia and Ati hardware. Although I haven't tested it yet, I have a strong feeling that Cg will run faster on nVidia hardware than the equivalent Ati hardware, since nVidia has developed Cg.

Share this post


Link to post
Share on other sites
Having working in GLSL, CG and attended a *few* sessions by M$ on HLSL I have to say there is very little in them in terms of learning time. If you can work in one, the time to convert between them is very low.

As said, GLSL for OpenGl, HLSL for DirectX is how I would go.

GOCP

Share this post


Link to post
Share on other sites
Quote:
Original post by nife
AFAIK Cg kan be used on both nVidia and Ati hardware. Although I haven't tested it yet, I have a strong feeling that Cg will run faster on nVidia hardware than the equivalent Ati hardware, since nVidia has developed Cg.


You can use it on ATI as long you target ARB_vp and ARB_fp, but these are outdated. I heard that Cg runs ok on ATI now but never used it much.

I'm using GLSL and I think it's the better choice for GL programming.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Quote:
Original post by nife
AFAIK Cg kan be used on both nVidia and Ati hardware. Although I haven't tested it yet, I have a strong feeling that Cg will run faster on nVidia hardware than the equivalent Ati hardware, since nVidia has developed Cg.


You can use it on ATI as long you target ARB_vp and ARB_fp, but these are outdated. I heard that Cg runs ok on ATI now but never used it much.

I'm using GLSL and I think it's the better choice for GL programming.


Yup. There's some good discussions on this topic here in this very thread, but I was able to use Cg on both my NVidia and ATI hardware. Though there's some (understandable) clunkyness with this interface on the ATI side, as it only communicates with the hardware using the "older" ARB_vp and ARB_fp extensions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!