Sign in to follow this  

Confused about shaders

This topic is 4862 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

I'm confused about pixel- and vertex-shaders. I've read about the neat things you can create but how does it all work? What's the diffrence between HLSL and CG? which is preffered? and how do I apply these shaders to my application in an easy way? Does ATI cards handle shaders the same way as nVidia(i.e. can I write a shader that works the same way on all cards that supports them)? A lot of questions. As I said, I'm confused. Is there a good website somewhere that might help? Thanks in advance!

Share this post


Link to post
Share on other sites
Shaders are small pieces of assembly-like code that are executed by the GPU (Graphics Programming Unit) - a piece of technology that is specifically designed for the task and hence can do it blisteringly fast.

Quote:
What's the diffrence between HLSL and CG? which is preffered?
Theoretically there is no difference - they are both high level languages that allow you to use a slightly more friendly syntax to describe/write the shaders. HLSL is only for DirectX whereas CG is opengl/directx. If you're sticking with windows/DX development then HLSL is probably best, otherwise CG. However there is no right/wrong answer as to which is best.

Quote:
how do I apply these shaders to my application in an easy way?
I dont know anything much about OpenGL, but in DX there are lots of SDK samples and a fairly easy set of function calls to load/compile/configure shaders (or effects). In the later revisions of DX it's got a lot lot easier..

Quote:
can I write a shader that works the same way on all cards that supports them?
Yes. However there are some cases where some cards support things slightly better than others / give better quality results... but if you're only just getting started, there's no need to worry about this..

Quote:
Is there a good website somewhere that might help?
There are lots and lots of resources around. As i said, I'm a DX programmer... but the SDK(Summer 2004) is a brilliant source, as well as google.. and you can pick up a mountain of information just by browsing the OpenGL/DirectX forums on this site. Alternatively, read through the ShaderX thread thats currently active for a short discussion of some of the books.

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 4862 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this