-=-=-Help me with as many answers as posible-=-=-

Posted By: Raymaker

-=-=-Help me with as many answers as posible-=-=- - 04/23/07 10:42

I was lookin' around inside the forum and i saw that there are some vary expirianced users. Whel I'd like to know how did you expirianced users learn all the knowlage about shaders. I'm only intrested in shaders because "d like to give my games a bit of fresh air THX

ps If you could tell me exactly how did YOU personaly learn this. Don't just post links to wikki or microsoft vertexshader reference. I'll be vary Thankful
Posted By: Scorpion

Re: -=-=-Help me with as many answers as posible-= - 04/23/07 13:21

The best way to learn is do do as much as possible with it. Start with a tutorial or a book about it and then just try everything out what comes in your mind, then u see, what is possible and what not and u learn to use the language.

How i personaly learned that: a friend wrote me a little tutorial about shaders( there were also some mistakes i had to correct) and so i learned it ( i know the alngauge and how it works..i dont say that i am a shader-guru like some other bods in that forum)
Posted By: Matt_Aufderheide

Re: -=-=-Help me with as many answers as posible-= - 04/23/07 18:36

Quote:

If you could tell me exactly how did YOU personaly learn this




What i did was to simply get some sample shaders and modify them a lot, first changing little things, like colors, or multipliers, then gradually learning the various optical and rendering theories behind them. Shaders are quite complex becasue they depend a wide variety of considerations.

You must learn the basic tools of shader development, like how to set up an HLSL shader body, declaration structs, etc. Learn about the fx format, the required inputs and outputs, render states, and masking or swizzling. "Swizzling" is a funny word for a very important concept, and is really quite simple. I will explain this later...

Remember that in a shader you are mostly dealing with 'vectors' which are really arrays of several floating point numbers. This vectors can contain colors, positions, angles, etc. A pixel shader ONLY deals with one pixel at a time, so(except for partial derivatives) you have no access to otehr pixels within a pixel sahder unless you multisample some textures. So just rememeber that you dealig with ojnly one final color and alpha value. This confused me for a long time.

For instance, a texture is normally a float4, meaning that its a vector composed of four floating point values: red,green.blue,alpha. Say I have a texture I define as "tex1". I can access any or all of the channels (or componenets of the vector) by using this method:

tex1.r = 1.0f (makes the red channel 100% red)
tex1.rgb = 1.0f (makes the color pure white)
tex.a=0.5f (makes the alpha channel 50%)
tex1.rgba = 1 (makes the color white and the alpha white or 100% opaque)

This is called "swizzling", masking, etc. Basically this is how you access the individual parsts of a vector, and is very useful. You should already be used to concpet if you use C-Script, like "my.x", "my.pan", etc.. as C-SCripts vars can also be vectors.


------------------------------------------------------------------------------

In short, shader programming takes quite a while to learn, especially if you not really familiar with rendering terms and techniques or the C language, which HLSL is based on.

Start small; i learn best by hacking other people's code. i think you will too.
Posted By: lostclimate

Re: -=-=-Help me with as many answers as posible-= - 04/23/07 18:39

also, i learned how to apply this through a tutorial called the facewound tutorial, go on google and type in facewound hlsl tutorials, and you should be able to find it
Posted By: xXxGuitar511

Re: -=-=-Help me with as many answers as posible-= - 04/24/07 03:25

I learned shaders the same way as Matt, but I'm still new with them, and nowhere near Matts level...
Posted By: RedPhoenix

Re: -=-=-Help me with as many answers as posible-= - 04/24/07 11:22

I'm also very new with shaders, I only changed some a bit and tht's definitly the way I would recommend you learning it. Look for a shader that doesw something near to that what you want to do, and then modify it. Use the reference lists on the microsoft page to get an overview on what possible and whats not. I also earched a lot in web and wikipedia to get to know with all the special words (bumpmapping normalmap, blurring, RTT, etc.) This was also a help to understand the shadercodes, to know as much about the processes itself as possible. This makes you understand better why there are this are that inputs and outputs in the shader.
Posted By: Raymaker

Re: -=-=-Help me with as many answers as posible-= - 04/24/07 11:44

thanx all of you
© 2024 lite-C Forums