Jump to content
  • Advertisement
Sign in to follow this  
mrmrcoleman

Shaders...

This topic is 4769 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 have decided that the time has come for me to learn about shaders. Up until this point I have had no experience with shaders, I understand basically what they are in that they replace the normal functionality of the fixed function pipeline but other than that I don't have a clue. Could somebody please clear a few things up for me before I get started. 1. I hear of Cg, HLSL, etc etc but I don't really grasp what these are. 2. What hardware will I need to have in my development platform to be able to work with shaders? 3. Are there any good introductory texts on this subject that could be recomended? Also, if somebody just wants to give me any extra information that would be useful I would be greatly appreciative. Thanks in advance. Mark

Share this post


Link to post
Share on other sites
Advertisement
1. Cg (for DX & OGL),HLSL (for DX) and GLSL (for OGL) are C-like, high level languages used to code shaders.
2. I'm not really sure whats the minimum card that first supported shaders, but I think you could look at a GF6600 - its rather cheap, and I hear it supports shader model 3.0, which is the latest & greatest for now :)
3. I personally started with the Cg shader tut on nehe.gamedev.net, & after that I jumped into the Cg documentation availeable at nvidias site. Then just googling for the specifics on some effects, if I need :)

Share this post


Link to post
Share on other sites
1) Well shaders are for 'programming the GPU' much like when programming the CPU you don’t use assembly (most of the time). Instead you use a higher level programming language such as c++ java or what ever. That’s what GLSL, CG Rendermonky, etc are, they are just a higher level way of writing shaders.

2) A minimum of what you will need hardware wise is a geforce 3, But you are limited to just vertex shaders (I think), and regardless would recommend getting a geforce 5600 or radeon 9600 as a minimum. There are cheaper cards than those but while they are capable of shaders, they will crawl at a slow pace.

3) Well where I started is with the cg tool kid documentation, that worked well for me, and there is no better way to learn then trying examples. You can find that documentation at developers.nvidia.com . You can also get a book on it at your local book store, but I’ve not looked at the introductory ones myself.

Share this post


Link to post
Share on other sites
Thanks for the info guys, I'm heading down to developers.nvidia.com and also to the local computer store to spend some cash on a new GFX card!

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by mrmrcoleman
I have decided that the time has come for me to learn about shaders. Up until this point I have had no experience with shaders, I understand basically what they are in that they replace the normal functionality of the fixed function pipeline but other than that I don't have a clue. Could somebody please clear a few things up for me before I get started.

Hehe, I did the exact same thing two months or so ago. It's great fun to learn. :D

Quote:

1. I hear of Cg, HLSL, etc etc but I don't really grasp what these are.

Different languages. :)
I believe (correct me if I'm wrong) that HLSL is DirectX only, and GLSL is OpenGL only. Cg works with both.

Quote:

2. What hardware will I need to have in my development platform to be able to work with shaders?

Depends. You can develop using software shaders, but performance goes down the drain (then again, you have to do it this way when debugging shaders).
But to actually see it run at a decent framerate, you need a graphics card that supports shaders. :)
I'd suggest a Geforce 6xxx card, as that's currently the only ones to support Shader Model 3.0. If you're going to work with shaders, you might as well get proper support for it. (Would suck to be stuck with SM2.0 or even older, if you end up wanting to write complex shaders that require 3.0)
But keep in mind, it *can* be software emulated if neccesary. (In those cases, all you need is a damn good CPU)

Quote:

3. Are there any good introductory texts on this subject that could be recomended?

I had some trouble with this part. I decided to learn HLSL, but since it's a relatively new language, there isn't a lot of detailed documentation on it. The MSDN content about it is rather mixed, skipping over some topics, or assumes you're already familiar with writing shaders in ASM.
In the end, I [google]'d for 3 or 4 different tutorials + the MSDN HLSL Workshop articles, and between them, I managed to figure out most of the language. Then I looked at some shaders made by other people to see how it all fitted together.
I believe Cg has better documentation, but since I didn't start with that language, it's hard to say for surre. NVidia has pumped an impressive amount of resources into documentation and tutorials for the language though.

Quote:

Also, if somebody just wants to give me any extra information that would be useful I would be greatly appreciative.

Yeah, make sure you already know how 3d graphics and the fixed function pipeline works. Other than that, just jump into it, and try to find as many tutorials and resources as possible. A lot of them are still very sketchy, and tends to forget to explain some parts properly. So it takes a bit of determination.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!