PDA

View Full Version : dumb shaders question


chris21908
05-22-2009, 03:19 PM
i did some searching on google as well as this website aid i still dont quite understand what shaders are. this might be a dumb question to most people here but i would love to understand what they are and how to use them. i am only a beginner in 3ds max and i joined this community to learn as much as i possibly can from the large number of forums here. any help would greatly be appreciated!!!

soulburn3d
05-23-2009, 04:03 AM
A shader can mean slightly different things to different people (and in different software), but generally when someone says shader, they're usually refering to a "surface shader", which is a mathematical equation that controls how light bounces off a surface, and hence what you see rendered on your object.

In max, a material is the thing you assign to an object, and a material contains 2 main parts, a shader and then maps that control various aspects of the shader.

There are many different kinds of shaders, and they're useful for different things. Like the Oren Nayar Blinn shader in max is good for rough surfaces. Some renderers have more complex shaders, like a carpaint shader for the Brazil renderer that has parameters specific to making car paint.

Anyways, I hope that helps. That may be a bit of an over simplification, but it should get the general idea across.

- Neil

almightie
05-23-2009, 05:52 AM
I think as a beginner you should stick to default help files tutorials and references coming with your application package.....they are developed nicely and will clear your understanding of basic fundamentals......google is very handy and we all love to use that for exploring new details on specific topics.....but remember - your basic fundamentals should be very clear before reading any specific tutorial (specially advanced) so you can built your own logic on that....so basic theories are like grammar for the language....basic theories are most important.....

Mr. D
05-27-2009, 05:44 PM
Hello

As you asked what they are basically, perhaps this will help you out some.
Lets us say you make a Material, Phong - diffuse value R 20_G 30_B 50, with that blending with a texture of some rocks at 50% blend.
While you think of that as a Material it is really a Shader. The Phong part tells the computer how light reacts (spread, bounce, ....) when striking the meshes surface. The diffuse value blending with the texture sets the meshes surface color for diffuse color. To the program these are all just numeric calculations it use to produce it's results.

This is where designing Shaders comes into play. When you build your Material you set fixed values, for example the Phong lighting calculation is predetermined.
However when you write Shaders you setup the Phong lighting values as Variables in and equation. Meaning if you change Variable values the Shader changes. So a Shader does not have to rely on presets, and can be manipulated in a game at run time by changing values.
Or say your not happy with the color of your Rocks texture, well the texture is just RGB color values; so you'd write into your Shader perhaps a +20R values to be added into the texture.

At a basic level there are 2 components to a Shader, 1st the Vert(ex) which sets up how light reacts. And 2ndly the Frag(ment) portion in which you setup and manipulate through formular the surface color values. Depending on type of Shader, as there are multible, these can be put out seperately or combined in a single Shader.

So in the end what you are doing in using a Shader over a standard Material, is that you are taking greater control over the lighting and coloring of your mesh; by controling the calculations that determine such.

Hope that helps some

Mr. D

chris21908
06-04-2009, 02:25 PM
thanks a bunch for the info!! i really really appreciate it!

sundialsvc4
06-04-2009, 11:51 PM
This is computer graphics, so a shader is ... a mathematical function or algorithm.

The term, "shader," is by now an anachronism, derived from the fact that they were first used to define the "shading," or light-bouncing characteristics, of surfaces and so-forth. The term was particularly used when talking about specialized graphics hardware ... like the GPUs in video cards that are so common now, but which were so rare at the time.

"Shader" still refers especially to hardware ... to the command files that actually tell the graphics card how to do its real-time magic. But now it is a fairly general term that is used in many contexts.

Mathematical functions are used, in real-time or otherwise, to describe and to implement a great many things. Even the GPU is often used as a generalized array-processor.

CGTalk Moderation
06-04-2009, 11:51 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.