Jump to content
  • Advertisement
Sign in to follow this  
digital_wolf

Aspirations of a Technical Artist

This topic is 4592 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've posted in the beginner forum with no real help... so I'm going to try here....aside from what's written in the FAQ. I'm looking for professional recomendations. I am a tech-artist currently working on “next-generation” consoles. It is becoming more and more apparent to me the necessity of being able to write your own DirectX Shaders. In my quest to attain this knowledge I’ve become somewhat overwhelmed with all the different types of books and websites out there and am unsure of exactly where to begin. I’m looking for some advice on where to start and some recommendations on materials. This is what I know so far in regards to what I need to learn. Math: Any good books that will explain and teach the principles required to learn, understand and write your own Shaders and Effects (Algebra, Vectors, Matrices etc.) I am approaching from a High-school math level with knowledge of Algebra, Geometry and Physics… although most of that knowledge has disappeared in the past 6 years. Programming Structures: I believe I understand the basic logic (Variables, if, else, loops, arrays etc) however I’m looking for materials that will explain to me the syntax and structure of HLSL that is comprehendible to a non-programmer. I currently own the “SHADERS: For Programmers and ARTIST” book by Sebastian St-Laurent. It’s good however I find it doesn’t explain to me certain things such as What does these actually mean/do: struct VS_INPUT float4 Position : POSITION0; struct VS_OUTPUT VS_OUTPUT vs_main( VS_INPUT Input ) All input and direction is greatly appreciated. I don’t want to become a Hack-Job … I’m looking to really understand and comprehend all of this. I’m hoping someone here is able to point me in the right direction. Thanks in Advance

Share this post


Link to post
Share on other sites
Advertisement
To get a quick start on HLSL, which is what I think you're trying to learn, you would at least need to know a little bit about what the keywords HLSL uses are in C. This would make things much easier. If you feel up to it, maybe reading up a little bit about C could get you some of the very basics (You only need the most basic stuff, variable types, structs, functions).

Then, I think using online tutorials is a great way to get started. While it can't teach you everything you need to know, it's a very effective way to get started. Look for basic HLSL tutorials, like the one's available at MDX info.

Once you think you pretty much understand what HLSL is all about, you could read the DirectX Documentation (available in the free DX SDK). This contains EVERYTHING you could possibly need to know about HLSL, and if you read and understand it all, you should be more than good to go.

Almost forgot, NVidia's excellent FX Composer is what I recommend for actually writing HLSL shaders. It lets you see what they look like, as you write them. It also contains quite a few sample shaders (which are not really for beginners). Also, Nvidia's SDK contains literally zounds of cool shader you can use to learn from. Both are completely free.

Hope this helps :).

Share this post


Link to post
Share on other sites
These can be kind of confusing for those who don't know shaders, so I will explain each.

Quote:
Original post by digital_wolf
struct VS_INPUT


This is the declaration of your vertex input structure - what gets fed into your vertex shader. It can be named anything, like myVSInput, INPUT_STRUCT, but most commonly you see VS_INPUT.

Quote:

float4 Position : POSITION0;


This is a specific member of your structure. float4 indicates that it's type is a 4-component float (ie it is 4 floats packaged together). The POSITION0 part is the semantic of the structure. Semantics are used to tell D3D and your application generally what the object is going to be used for. In this case, it is going to hold a position. On the other hand, a NORMAL semantic would indicate that it holds normals.

The reason for using semantics is to de-couple the shader variable names from the application. This way, the coder can name the variables whatever he wants in the shader, as long as he uses semantics that the engine looks for.

Quote:

struct VS_OUTPUT

This is the vertex shader output structure. The vertex shader will take your input structure, do a bunch of processing, and then output this. This is then used as input for the pixel shader. So it's fair to say that it's a pixel input structure as much as it's a vertex shader output structure.

Quote:

VS_OUTPUT vs_main( VS_INPUT Input )

This is the function declaration of your vertex shader. It returns a VS_OUTPUT structure. It is named vs_main, and it takes a VS_INPUT structure as input.

I hope that helped a bit.

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!