Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, kzhao), 642 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
-=-=-Help me with as many answers as posible-=-=- #125815
04/23/07 10:42
04/23/07 10:42
Joined: Apr 2007
Posts: 29
R
Raymaker Offline OP
Newbie
Raymaker  Offline OP
Newbie
R

Joined: Apr 2007
Posts: 29
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

Re: -=-=-Help me with as many answers as posible-= [Re: Raymaker] #125816
04/23/07 13:21
04/23/07 13:21
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
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)

Re: -=-=-Help me with as many answers as posible-= [Re: Scorpion] #125817
04/23/07 18:36
04/23/07 18:36
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
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.


Sphere Engine--the premier A6 graphics plugin.
Re: -=-=-Help me with as many answers as posible-= [Re: Matt_Aufderheide] #125818
04/23/07 18:39
04/23/07 18:39
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
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

Re: -=-=-Help me with as many answers as posible-= [Re: lostclimate] #125819
04/24/07 03:25
04/24/07 03:25
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I learned shaders the same way as Matt, but I'm still new with them, and nowhere near Matts level...


xXxGuitar511
- Programmer
Re: -=-=-Help me with as many answers as posible-= [Re: xXxGuitar511] #125820
04/24/07 11:22
04/24/07 11:22
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
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.

Re: -=-=-Help me with as many answers as posible-= [Re: RedPhoenix] #125821
04/24/07 11:44
04/24/07 11:44
Joined: Apr 2007
Posts: 29
R
Raymaker Offline OP
Newbie
Raymaker  Offline OP
Newbie
R

Joined: Apr 2007
Posts: 29
thanx all of you


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1