Fairly confused about different Shader Models

Started by
3 comments, last by data2 16 years, 8 months ago
Hi there, I know about shader programming using DirectX or Cg. The problem I have is that I have to write a report and need to describe the differences between shader models WITHOUT referring to a specific language or API. What I want is writing about the available instructions, input registers, texture registers, branching, ..., ... But I am confused: (1) The term "Pixel Shader", is it Microsoft specific? So when reading about Pixel Shader 1.4 or 2.0 or 3.0, do I read about the compiler profile of the Microsoft compiler or about a general "Shader Model 2.0"?? (2) Cg has a zillion different profiles (arbfp1, ps_2, fp2, fp4, ...). What do they correspond to? As far as i understood, arbfp1 is up to ps_2_0, fp4 corresponds to MS ps_3_0. (3) Where do I get "professional" literature about it, like papers. I can't cite websites. Does anyone knows something resource that gives a good overview WITHOUT being specific regarding the API? Thanks alot!!
Advertisement
Not sure on a resource. I know nothing much about Cg and DirectX shaders but I know GLSL a little.

Pixel shader isn't specific to Microsoft, it's just called fragment shader in GLSL.

Pixel / Fragment shaders are called once per pixel per polygon, and write pixel data.

Vertex shaders are called once per vertex per polygon and write transformed co-ordinate data and other arbitary data used by the Fragment shaders.

I know there are other shaders such as Geometry shaders which are something in between.

OpenGL's pipeline looks like this.
http://www.lighthouse3d.com/opengl/glsl/index.php?pipeline

Probably quite a late post tho, left this to cook tea.
Thanks for the reply. Actually, I know how shaders WORK (I'm using them since a couple of years). But I can't actually find anything that isn't specific for either Cg or DirectX or whatever.

When escribing the programmable graphics pipeline and shading units, I don't want to use terms or specifications that are related to a certain API.

Ah sorry yea didn't read your post well enough.

The GPU manufacturers can do anything with their internal structure as long as they meet the requirements, and it's up to them to compile the shaders for their architectures. So you can't really say anything generic about how GPUs are, what registers they have etc.

And I can also remember reading a while ago that linux driver programmers were unable to write open drivers for NVidia cards because NVidia wouldn't release their protocols - so data about registers etc may still be under wraps beyond the general summaries that they give out to the media.

Quote:
The Cuda [GPU/Nov 2006] software developers kit is currently available to developers and researchers through the Nvidia registered developer program, information on which can be found on the official Nvidia website.

The above doesn't look like it's public domain tho - I didn't spend too much time looking. I guess you've looked 3 times as hard as me tho.
Cheers again!
Quote:Original post by shukapi
The GPU manufacturers can do anything with their internal structure as long as they meet the requirements

Ok, but then there must be "requirements", right? I know that Microsoft specifies the minimal number instructions / registers for their shader models (vs_1_0, ps_1_4, ps_3_0, etc). I actually saw Cg vertex shader code compiled with arbvp1 that contained texture fetches (which is obviously at least ps_3_0 pendant). So the arbvp1/arbfp1 profiles seem to be quite flexible...

So the question would be if "Shader Model 2.0" or "Shader Model 3.0" or so is Microsoft terminology or general terms?!

Uh, and would you think that there is a different between Shader Model and compiler profile? How do e.g. Cg profiles relate to shader models or Direct3D/HLSL profiles??

... What just came in my mind: If you're writing assembly shaders you have to specify the profile/model. This shouldn't depend upon any API or language, because the asm instructions are standardized, aren't they? I don't know much about assembly shaders, because I was using high level languages ever since. But accoring to the "Introduction to shader programming" (http://www.gamedev.net/reference/articles/article1820.asp) the asm program starts with the "version instruction"...

This topic is closed to new replies.

Advertisement