<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.polycount.com/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.polycount.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Haiddasalami</id>
		<title>polycount - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.polycount.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Haiddasalami"/>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Special:Contributions/Haiddasalami"/>
		<updated>2026-05-29T21:52:24Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.2</generator>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-08T20:27:24Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a [[normal map]] is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-08T20:27:02Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a normal map is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-07T20:32:58Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Pages in This Category */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Blending_functions|Blending Functions]]&lt;br /&gt;
* [[Vertex_skinning|Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]][[Category:Technical_Art]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:20:48Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Tech_Artists.Org Wiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion|Technical Art:Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical_Art]] [[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:20:33Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Tech_Artists.Org Wiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion|Technical Art:Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical_Art|Technical Art]] [[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:20:05Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Tech_Artists.Org Wiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion|Technical Art:Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical_art|Technical Art]] [[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:19:29Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion|Technical Art:Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:18:58Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion|Technical_Art : Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:18:25Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Technical_Art#Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Category:Technical_Art</id>
		<title>Category:Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Category:Technical_Art"/>
				<updated>2014-08-06T20:17:26Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Category:Technical_Art</id>
		<title>Category:Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Category:Technical_Art"/>
				<updated>2014-08-06T20:16:35Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: Created page with &amp;quot;Category:Technical Art&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Category:Technical Art&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:12:49Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Category:Technical_Art]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:12:11Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [Category:Technical_Art#Tech-Artists.Org_Wiki_Conversion].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders</id>
		<title>Shaders</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders"/>
				<updated>2014-08-06T20:10:31Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a Shader? ==&lt;br /&gt;
A shader is a bit of computer code that is commonly used to describe how a surface will be rendered. It takes some inputs (textures, vertices, view angles, etc.), does some changes to them, then tells the game renderer to render them. &lt;br /&gt;
&lt;br /&gt;
Shaders are typically used for interactive rendering, like in a 3d game, where the view is rendered in real-time at 30 fps (or better). This page is all about these &amp;quot;real-time&amp;quot; shaders, which are optimized to render efficiently, trading performance for less accuracy. &amp;quot;Offline&amp;quot; shaders are used with non-real-time renderers, like mental ray, and have more accurate effects like ray-tracing and sub-pixel filtering, but they are non-interactive (they can take several minutes to render each frame).&lt;br /&gt;
&lt;br /&gt;
== Example Shaders ==&lt;br /&gt;
=== 3ds Max Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
*[http://www.laurenscorijn.com/viewportshader 3ds Max viewport shader] by [http://www.laurenscorijn.com/ Laurens &amp;quot;Xoliul&amp;quot; Corijn].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=62006 Xoliul's 3DS Max Viewport Shader]''.&lt;br /&gt;
*[http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader] by [http://www.3pointstudios.com 3 Point Studios]&lt;br /&gt;
Shader with many options, including near-perfect results for 3ds Max generated normal maps. See the Polycount thread [http://boards.polycount.net/showthread.php?t=72861 3Point Shader Lite - Shader material editor and Quality Mode normalmaps for 3ds Max].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Agusturinn-Shader-Demo-100883093 Agusturinn Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;One UV texture, Two point lights, Diffuse map(include alpha which control transparency), AO(ambient occlusion) map or Lightmap share the same channel, Normal map,Specular map,Specular level map,Gloss map,Emissive map, Two type of Cubemap---One is diffuse cubemap for generating IBL(image based lighting), the other is enviroment cubemap for reflection.&amp;quot;''&lt;br /&gt;
* '''[http://www.bencloward.com/resources_shaders.shtml Ben Cloward Shaders]''' by [http://www.bencloward.com Ben Cloward].&lt;br /&gt;
 He has a bunch of HLSL shaders available for normal mapping, ambient occlusion, car paint, skin, etc.&lt;br /&gt;
*[http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf BRDF shader] (3ds Max version) ported by [http://crazybutcher.cottages.polycount.com/ Christoph &amp;quot;CrazyButcher&amp;quot; Kubisch].&lt;br /&gt;
Original [http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya] by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.aurelm.com/envo/ ENVO realtime environment shader]''' by [http://www.aurelm.com/ Aurel Manea]&lt;br /&gt;
From the Polycount thread [http://www.polycount.com/forum/showthread.php?t=100187 ENVO realtime environment shader for 3d studio max].&lt;br /&gt;
* '''[http://www.polycount.com/forum/showpost.php?p=1610563&amp;amp;postcount=2 MoP Texture Blender]''' by [http://www.greveson.co.uk Paul &amp;quot;MoP&amp;quot; Greveson]&lt;br /&gt;
This shader uses blendmodulate for vertex blending with per-pixel detail. From the Polycount thread [http://boards.polycount.net/showthread.php?p=1024948#post1024948 The Snow and Ice of Uncharted2?].&lt;br /&gt;
* '''[http://rtshaders.deviantart.com/art/Paragalis-Shader-Demo-110994545 Paragalis Shader Demo]''' by [http://rtshaders.deviantart.com Wang &amp;quot;RTshaders&amp;quot; Jing].&lt;br /&gt;
Shader features: ''&amp;quot;Post effect, 3dsmax2008/2009 viewport shadowmap, Subsurface scattering, Cubemap Image based lighting, Diffuse(alpha channel control opacity),Normal map,Ao map/Light map,Specular,Specular lever(mask),Gloss etc., Shadermodel 2.x compatible for AMD ATI card.&amp;quot;''&lt;br /&gt;
* '''[http://www.jistyles.com/main.php?id=doc&amp;amp;page=hlsl SSS Skin Shader]''' by [http://www.jistyles.com/ J.I. Styles].&lt;br /&gt;
''&amp;quot;The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.&amp;quot;''&lt;br /&gt;
* '''[http://blog.maginot.eu/index.php?seite=people&amp;amp;people=till&amp;amp;page=mhn2048106717 TF2 Shader for 3ds Max]''' and '''[http://blog.maginot.eu/index.php?p=till.1__scriptnstuff_shader_toon Toon/Comic Shader for 3ds Max]''' by [http://www.till.maginot.eu/ Till &amp;quot;Rollin&amp;quot; Maginot].&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=64453 TF2 and TOON realtime viewport shader (3ds max)]''.&lt;br /&gt;
&lt;br /&gt;
=== Maya Shaders ===&lt;br /&gt;
(in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
* '''[http://www.mentalwarp.com/~brice/brdf.php BRDF shader for Maya]''' by [http://www.mentalwarp.com/~brice Brice Vandemoortele] and [http://www.kjapi.com/ Cedric Caillaud]&lt;br /&gt;
More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=49920 Free Maya/max cgfx/fx Shader]''. '''Update:''' [http://boards.polycount.net/showthread.php?p=821862#post821862 New version here] with many updates, including object-space normal maps, relief mapping, self-shadowing, etc.&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=110022 DOTA2 Hero Shader - 3DS &amp;amp; Maya Shader Material]''' by [http://www.polycount.com/forum/member.php?u=43116 Luigi 'Ace-Angel' Kavijian] and [http://drewwatts.net/ Drew 'Drew++' Watts].&lt;br /&gt;
Half-Lambert diffuse term with controllable falloff, additive rimlighting, Phong specular, mask support (Dota2 style), all them fancy effects Valve uses!&lt;br /&gt;
* '''[http://www.kostas.se/?p=142 KoddeShader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis]&lt;br /&gt;
Has several features such as normal mapping, specular, gloss, reflections, ambient cube, parallax, etc. More info in the Polycount thread ''[http://boards.polycount.net/showthread.php?t=69161 &amp;quot;KoddeShader&amp;quot;, a Maya CGFX shader]''. '''Update:''' [http://www.kostas.se/?p=17 Version 2.0 here] including updates such as blended normals for skin, cube map mip level parameters for blurring reflections and ambient light, 2-pass transparency support, etc.&lt;br /&gt;
* '''[http://www.kostas.se/?p=30 TGA Physically Based Lighting shader]''' by [http://www.kostas.se Kostas &amp;quot;Kodde&amp;quot; Gialitakis] and [http://www.defrostgames.com Niklas Hansson]. Is based around a Physically Based Lighting method of shading where you define materials with albedo, substance and roughness texture rather than diffuse, specular, gloss. Has other features such as cube map based reflections and ambient lighting, normal maps, ambient occlusion, substance based fresnel term which alters reflections and specular, blurred reflections, fully linear shading, energy conserving ambient/reflections, blended normals, etc.&lt;br /&gt;
* '''[http://blog.leocov.com/p/downloads.html lcUberShader, lcSkinShader, lcHairShader, lcLitSphere, lcReproject]''' by [http://www.leocov.com/ Leonardo &amp;quot;chronic&amp;quot; Covarrubias]&lt;br /&gt;
Many techniques and parameters, including normal mapping, specular, ambient env cube, SSS, litspheres, etc.&lt;br /&gt;
* '''[https://dl.dropbox.com/u/53969153/Shaders/Cryengine3_VertexBlend_Maya1Light.zip Vertex Color BlendMasked CgFX Maya Shader]''' by [http://klass87.blogspot.fr/ Amir &amp;quot;choco&amp;quot; Abdaoui] and [http://cruxic.com/ Drew &amp;quot;Drew++&amp;quot; Watts].&lt;br /&gt;
More info in the Polycount thread ''[http://www.polycount.com/forum/showthread.php?t=105291 Vertex color BlendMasked cgfx maya shader]''.&lt;br /&gt;
&lt;br /&gt;
=== UDK Shaders ===&lt;br /&gt;
* '''[http://www.polycount.com/forum/showthread.php?t=103068 WL-Shader]''' by [http://unreal.rgr.jp/ &amp;quot;TA20&amp;quot;]&lt;br /&gt;
UDK shaders for cloth, skin, water, glass, foliage, bricks, etc.&lt;br /&gt;
&lt;br /&gt;
== Creating Shaders ==&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=118365 Advice with Learning Shader Programming] Polycount forum thread&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=104692 Material editors vs. Custom shader code] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
=== Beginner Tutorials ===&lt;br /&gt;
* [https://www.cg-academy.net/es_catalog/product_info.php?products_id=64&amp;amp;osCsid=5jn41nk4i5uii38d3t0sg4tn53c430a3 CG Academy HLSL Shader Creation series] by [http://www.bencloward.com/ Ben Cloward] ($) is an excellent 3-part series on making HLSL shaders for 3ds Max (can easily be transferred to Maya too).&lt;br /&gt;
* [http://cgcookie.com/unity/series/introduction-to-surface-shader-scripting CGCookie - Introduction to surface shader scripting in Unity by Alex Telford] Step by step tutorial with basics of writing for Unity 3.x.&lt;br /&gt;
* [http://cgcookie.com/unity/cgc-series/noob-to-pro-shader-writing-for-unity-4-beginner/ CGCookie - Noob to pro shader writing for Unity for beginners by Alex Telford] Another tutorial by Alex Telford designed for Unity 4.&lt;br /&gt;
* [http://eat3d.com/blog/eat-3d/new-dvd-release-shader-production-writing-custom-shaders-cgfx Eat3D's &amp;quot;Shader Production - Writing Custom Shaders with CGFX&amp;quot;] by [http://www.linkedin.com/pub/luiz-kruel/3/127/463 Luiz Kruel] ($) is anotehr excellent video tutorial that guides you through writing your own shaders, primarily with the CGFX shader language in Maya. DVD release was September 14, 2011.&lt;br /&gt;
* [http://bencloward.com/resources_shaders.shtml Shaders by Ben Cloward] These shaders are a bit outdated and there are more up-to-date shaders to learn from, but Ben's shaders are what got many artists started on the path and are still a solid learning resource.&lt;br /&gt;
* [http://www.robg3d.com/?page_id=13 Shaders by Rob Galanakis (right side of page)] Some well-commented shaders that cover a variety of intermediate to advanced topics.&lt;br /&gt;
* [[NormalMap]], the Wiki page on normal mapping, provides a comprehensive overview on the subject.&lt;br /&gt;
* [http://bencloward.com/resources_tutorials.shtml Ben Cloward's Normal Mapping Tutorial]: One of the best sources for people getting into shaders and who want a better understanding of what a normal map is.  Covers the basics of lighting, how normal maps work, and the process of creating and applying normal maps.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tutorials ===&lt;br /&gt;
* [http://www.moddb.com/games/unreal-tournament-3/tutorials/tf2-shading-in-ut3 TF2 Shading in UT3] by [http://polyphobia.de Steffen &amp;quot;Neox&amp;quot; &amp;quot;polyphobia&amp;quot; Unger]&lt;br /&gt;
Shows how the Team Fortress 2 look can be emulated using a shader network in Unreal Engine 3.&lt;br /&gt;
* [[ParallaxMap]]: different techniques for parallax mapping (offset, parallax occlusion, relief, etc.), with links to the papers detailing them and other related resources.&lt;br /&gt;
* [http://www.ericchadwick.com/examples/provost/byf1.html Beautiful, yet Friendly]: Article by Guillaume Provost, which explains the behind-the-scenes technical aspect of shaders.  A must-read when one starts to think about efficiency, math, and hardware.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tutorials ===&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
To create and edit shaders, most people use a text editor (like [http://notepad-plus.sourceforge.net Notepad ++]) to write them and a 3d program (a game engine, 3ds Max, Maya, etc.) to view them. For those who are new to shaders the following tools provide a graphical user interface for easier creation. &lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/fx_composer_home.html FX Composer] is NVIDIA's shader authoring toolset.&lt;br /&gt;
* [http://www.geeks3d.com/glslhacker/ GLSL Hacker] ''&amp;quot;is a cross-platform (Windows, Linux and OS X) tool for fast realtime 3D prototyping and coding. It's based on widely used standards such as GLSL (OpenGL Shading Language), Lua or Python. GLSL Hacker has been designed for developers (from newbies to confirmed) and technical 3D artists.&amp;quot;''&lt;br /&gt;
* [http://glsl.heroku.com/ GLSL Sandbox] is a browser-based code editor that shows the output live, right there behind your code. Also has a gallery of neat tricks to steal (ahem, borrow) from.&lt;br /&gt;
* [http://www.mentalimages.com/products/mental-mill/standard-edition.html mental mill Standard Edition] ''&amp;quot;allows the user to write and edit shader code, and visually debug the shader by interactively inspecting variables while stepping through the code.&amp;quot;'' The more limited [http://www.mentalimages.com/products/mental-mill/artist-edition.html Artist Edition] is free for personal use, and came bundled with 3ds Max 2010.&lt;br /&gt;
* [http://www.imgtec.com/powervr/insider/sdkdownloads/ PowerVR SDK] lets you live-edit and gives you rough estimates on shader costs. Helps with optimising GL ES2.0 shaders. Works with regular GLSL, too.&lt;br /&gt;
* [http://developer.amd.com/gpu/rendermonkey/ RenderMonkey] is AMD's shader authoring toolset.&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for 3ds Max ===&lt;br /&gt;
* [http://www.3pointstudios.com/3pointshader_about.shtml 3Point Shader Pro] ''&amp;quot;is a toolset for creation and presentation of high-quality real- time materials in the Autodesk 3ds Max™ viewport.&amp;quot;''&lt;br /&gt;
* [http://www.lumonix.net/shaderfx.html Shader FX] ''&amp;quot;is a full-featured real-time shader editor for 3ds Max that allows artists with no previous programming experience to build complex HLSL or CG FX shaders, using a graphical schematic interface to wire nodes together.&amp;quot;'' '''''No longer being developed'''''&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Maya ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=125197 Maya LT ShaderFX] is a node-based shader editor for [http://www.polycount.com/forum/showthread.php?t=125122 Maya LT].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unity ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123439 Shader Forge] ''&amp;quot;The goal with Shader Forge is to provide an intuitive and visual way of creating shaders in the Unity engine, just like the Material Editor in UDK.&amp;quot;''&lt;br /&gt;
* [http://www.shaderfusionblog.com/?cat=6 ShaderFusion] is a node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
* [http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source Strumpy Shader Editor] another node-based shader editor for [http://unity3d.com/ Unity].&lt;br /&gt;
&lt;br /&gt;
=== Shader Tools for Unreal Engine ===&lt;br /&gt;
* [http://udn.epicgames.com/Three/MaterialsAndTexturesHome.html Material Editor in UDK] &lt;br /&gt;
&lt;br /&gt;
== Tech_Artists.Org Wiki ==&lt;br /&gt;
For more info see [http://tech-artists.org/wiki/Portal:Shaders Portal:Shaders] on the Tech Artists Wiki.&lt;br /&gt;
&lt;br /&gt;
These pages need to be ported, see [[Category:Technical_Art#Tech-Artists.Org_Wiki_Conversion]].&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shaders for Artists]]&lt;br /&gt;
| What are shaders and what do they do?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Blending functions]]&lt;br /&gt;
| Photoshop functions converted into HLSL. Understanding the math behind Photoshop will give greater insight into how pixel shaders work, and the short functions will help teach HLSL syntax.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[NormalVector]], [[BinormalVector]], and [[TangentVector]]&lt;br /&gt;
| are the three vectors that make up surface vector information, and a basic understanding is essential to understand lighting.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Glossary (Shaders)]] &lt;br /&gt;
| A listing of terms used in shaders, such as half angle, glossiness, etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[UnitVector]]&lt;br /&gt;
| What is a unit vector (also known as a normalized vector), and why is it important to us?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Shading models]]&lt;br /&gt;
| Describe the different models, such as [[Blinn]], [[Phong]], etc.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[DDS]] and [[Normal map compression]]&lt;br /&gt;
| Explain the best ways to save and compress normal maps and other textures.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[Vertex skinning]]:&lt;br /&gt;
| An article about using the shader to deform skinned meshes. Ubiquitous in games now-a-days, but knowledge of it can help unlock what else is possible in the vertex shader.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;class=&amp;quot;red&amp;quot;&amp;gt;| [[MaxScript DirectX Scripted Material Plugin]]: &lt;br /&gt;
| A tutorial requiring intermediate to advanced [[HLSL]] and [[MaxScript]] knowledge. It will allow you to build your own unrestricted interfaces for DirectX 9 Shaders in Max, instead of using the default auto-generated UI.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Texturing]] [[Category:Portfolio]] [[Category:Technology]] [[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T20:07:28Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Blending_functions|Blending Functions]]&lt;br /&gt;
* [[Vertex_skinning|Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/PBR</id>
		<title>PBR</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/PBR"/>
				<updated>2014-08-06T20:05:44Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
= PBR =&lt;br /&gt;
Physically-Based Rendering (PBR) is an approach for materials and rendering that creates more accurate and predictable results than previous game rendering techniques, and works very well with dynamic  lighting conditions (like time-of-day).&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* [http://www.youtube.com/watch?v=LP7HgIMv4Qo Physically Based Rendering in Substance - YouTube] - PBR principles well explained&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=136390|PBR Physically Based Rendering Bible - Polycount Forum]&lt;br /&gt;
* [http://www.artisaverb.info/PBT.html Physically Based Texturing] by [http://www.polycount.com/forum/member.php?u=20394 Andrew 'd1ver' Maximov]&lt;br /&gt;
* [http://www.artisaverb.info/PBR.html Physically Based Rendering for Artists] by [http://www.polycount.com/forum/member.php?u=20394 Andrew 'd1ver' Maximov]&lt;br /&gt;
* [http://www.fxguide.com/featured/game-environments-parta-remember-me-rendering/ Rendering Remember Me] on fxguide.com&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=132790 Tileable Dirt &amp;amp; Pebbles Texture - Polycount Forum] - a process for developing PBR textures&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=124934 UDK Physically Based Lighting! - Polycount Forum]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=124683 Physically based rendering in games - Polycount Forum]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123826 Ready at Dawn's Material system - Polycount Forum] &lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=89658 TGA Physically Based Lighting CGFX Shader for Maya Viewport - Polycount Forum] &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Rendering]] [[Category:Texturing]] [[Category:Glossary]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/PBR</id>
		<title>PBR</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/PBR"/>
				<updated>2014-08-06T20:05:19Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
= PBR =&lt;br /&gt;
Physically-Based Rendering (PBR) is an approach for materials and rendering that creates more accurate and predictable results than previous game rendering techniques, and works very well with dynamic  lighting conditions (like time-of-day).&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* [http://www.youtube.com/watch?v=LP7HgIMv4Qo Physically Based Rendering in Substance - YouTube] - PBR principles well explained&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=136390|[PBR] Physically Based Rendering Bible - Polycount Forum]&lt;br /&gt;
* [http://www.artisaverb.info/PBT.html Physically Based Texturing] by [http://www.polycount.com/forum/member.php?u=20394 Andrew 'd1ver' Maximov]&lt;br /&gt;
* [http://www.artisaverb.info/PBR.html Physically Based Rendering for Artists] by [http://www.polycount.com/forum/member.php?u=20394 Andrew 'd1ver' Maximov]&lt;br /&gt;
* [http://www.fxguide.com/featured/game-environments-parta-remember-me-rendering/ Rendering Remember Me] on fxguide.com&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=132790 Tileable Dirt &amp;amp; Pebbles Texture - Polycount Forum] - a process for developing PBR textures&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=124934 UDK Physically Based Lighting! - Polycount Forum]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=124683 Physically based rendering in games - Polycount Forum]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=123826 Ready at Dawn's Material system - Polycount Forum] &lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=89658 TGA Physically Based Lighting CGFX Shader for Maya Viewport - Polycount Forum] &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Rendering]] [[Category:Texturing]] [[Category:Glossary]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:50:22Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Blending_functions|Blending Functions]]&lt;br /&gt;
* [[Vertex_skinning|Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Blending_functions</id>
		<title>Blending functions</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Blending_functions"/>
				<updated>2014-08-06T19:49:45Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: Created page with &amp;quot;Here are all the Photoshop Blending Modes, in easy to use functions for various languages.  ==HLSL== ===Category 1 (Darker)=== &amp;lt;pre&amp;gt;float4 Darken (float4 cBase, float4 cBlend)...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here are all the Photoshop Blending Modes, in easy to use functions for various languages.&lt;br /&gt;
&lt;br /&gt;
==HLSL==&lt;br /&gt;
===Category 1 (Darker)===&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Darken (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	cNew.rgb = min(cBase.rgb, cBlend.rgb);&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Multiply (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (cBase * cBlend);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 ColorBurn (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (1 - (1 - cBase) / cBlend);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 LinearBurn (float4 cBase, float4 CBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (cBase + cBlend - 1);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Category 2 (Lighter)===&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Lighten (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	cNew.rgb = max(cBase.rgb, cBlend.rgb);&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Screen (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (1 - (1 - cBase) * (1 - cBlend));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 ColorDodge (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (cBase / (1 - cBlend));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 LinearDodge (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (cBase + cBlend);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Category 3 (Complex)===&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Overlay (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
/*&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBase.r &amp;gt; .5) { cNew.r = 1 - (1 - 2 * (cBase.r - .5)) * (1 - cBlend.r); }&lt;br /&gt;
	else { cNew.r = (2 * cBase.r) * cBlend.r; }&lt;br /&gt;
	&lt;br /&gt;
	if (cBase.g &amp;gt; .5) { cNew.g = 1 - (1 - 2 * (cBase.g - .5)) * (1 - cBlend.g); }&lt;br /&gt;
	else { cNew.g = (2 * cBase.g) * cBlend.g; }&lt;br /&gt;
	&lt;br /&gt;
	if (cBase.b &amp;gt; .5) { cNew.b = 1 - (1 - 2 * (cBase.b - .5)) * (1 - cBlend.b); }&lt;br /&gt;
	else { cNew.b = (2 * cBase.b) * cBlend.b; }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
*/&lt;br /&gt;
	// Vectorized (easier for compiler)&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	&lt;br /&gt;
	// overlay has two output possbilities&lt;br /&gt;
	// which is taken is decided if pixel value&lt;br /&gt;
	// is below half or not&lt;br /&gt;
&lt;br /&gt;
	cNew = step(0.5,cBase);&lt;br /&gt;
	&lt;br /&gt;
	// we pick either solution&lt;br /&gt;
	// depending on pixel&lt;br /&gt;
	&lt;br /&gt;
	// first is case of &amp;lt; 0.5&lt;br /&gt;
	// second is case for &amp;gt;= 0.5&lt;br /&gt;
	&lt;br /&gt;
	// interpolate between the two, &lt;br /&gt;
	// using color as influence value&lt;br /&gt;
	cNew= lerp((cBase*cBlend*2),(1.0-(2.0*(1.0-cBase)*(1.0-cBlend))),cNew);&lt;br /&gt;
&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 SoftLight (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBlend.r &amp;gt; .5) { cNew.r = cBase.r * (1 - (1 - cBase.r) * (1 - 2 * (cBlend.r)));}&lt;br /&gt;
	else { cNew.r = 1 - (1 - cBase.r) * (1 - (cBase.r * (2 * cBlend.r))); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) { cNew.g = cBase.g * (1 - (1 - cBase.g) * (1 - 2 * (cBlend.g)));}&lt;br /&gt;
	else { cNew.g = 1 - (1 - cBase.g) * (1 - (cBase.g * (2 * cBlend.g))); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) { cNew.b = cBase.b * (1 - (1 - cBase.b) * (1 - 2 * (cBlend.b)));}&lt;br /&gt;
	else { cNew.b = 1 - (1 - cBase.b) * (1 - (cBase.b * (2 * cBlend.b))); }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 HardLight (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBlend.r &amp;gt; .5) { cNew.r = 1 - (1 - cBase.r) * (1 - 2 * (cBlend.r)); }&lt;br /&gt;
	else { cNew.r = cBase.r * (2 * cBlend.r); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) { cNew.g = 1 - (1 - cBase.g) * (1 - 2 * (cBlend.g)); }&lt;br /&gt;
	else { cNew.g = cBase.g * (2 * cBlend.g); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.b &amp;gt; .5) { cNew.b = 1 - (1 - cBase.b) * (1 - 2 * (cBlend.b)); }&lt;br /&gt;
	else { cNew.b = cBase.b * (2 * cBlend.b); }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 VividLight (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBlend.r &amp;gt; .5) {cNew.r = 1 - (1 - cBase.r) / (2 * (cBlend.r - .5)); }&lt;br /&gt;
	else {cNew.r = cBase.r / (1 - 2 * cBlend.r); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) {cNew.g = 1 - (1 - cBase.g) / (2 * (cBlend.g - .5)); }&lt;br /&gt;
	else {cNew.g = cBase.g / (1 - 2 * cBlend.g); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.b &amp;gt; .5) {cNew.b = 1 - (1 - cBase.b) / (2 * (cBlend.b - .5)); }&lt;br /&gt;
	else {cNew.b = cBase.b / (1 - 2 * cBlend.b); }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 LinearLight (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBlend.r &amp;gt; .5) {cNew.r = cBase.r + 2 * (cBlend.r - .5); }&lt;br /&gt;
	else {cNew.r = cBase.r + 2 * cBlend.r - 1; }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) {cNew.g = cBase.g + 2 * (cBlend.g - .5); }&lt;br /&gt;
	else {cNew.g = cBase.g + 2 * cBlend.g - 1; }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.b &amp;gt; .5) {cNew.b = cBase.b + 2 * (cBlend.b - .5); }&lt;br /&gt;
	else {cNew.b = cBase.b + 2 * cBlend.b - 1; }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 PinLight (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	float4 cNew;&lt;br /&gt;
	if (cBlend.r &amp;gt; .5) { cNew.r = max(cBase.r, 2 * (cBlend.r - .5)); }&lt;br /&gt;
	else {cNew.r = min(cBase.r, 2 * cBlend.r); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.g &amp;gt; .5) { cNew.g = max(cBase.g, 2 * (cBlend.g - .5)); }&lt;br /&gt;
	else {cNew.g = min(cBase.g, 2 * cBlend.g); }&lt;br /&gt;
	&lt;br /&gt;
	if (cBlend.b &amp;gt; .5) { cNew.b = max(cBase.b, 2 * (cBlend.b - .5)); }&lt;br /&gt;
	else {cNew.b = min(cBase.b, 2 * cBlend.b); }&lt;br /&gt;
	&lt;br /&gt;
	cNew.a = 1.0;&lt;br /&gt;
	return cNew;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Category 4 (Comparison)===&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Difference (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (abs(cBase - cBlend));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float4 Exclusion (float4 cBase, float4 cBlend)&lt;br /&gt;
{&lt;br /&gt;
	return (.5 - 2 * (cBase - .5) * (cBlend - .5));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HLSL]][[Category:Shaders]][[Category:Rendering]][[Category:Code]][[Category:Functions]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:48:30Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Vertex_skinning|Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:48:19Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Vertex_skinning||Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Vertex_skinning</id>
		<title>Vertex skinning</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Vertex_skinning"/>
				<updated>2014-08-06T19:47:51Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vertex Skinning, also known as weighting or binding (and archaically known as 'enveloping'), is creating a relationship of vertices to bones.  When bones [[transform]], the vertices transform along with them proportionally to their weight to the bone.&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
A good explanation is given by Jason Osippa in Stop Staring:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;[Skinning] really doesn't understand motion; it only understands positions.  If you have one point weighted 100% to a joint, it will indeed move in arcs, and follow rotations; it's followign the motions of the join 100%, and since the joint is rotating, the point seems like it is rotating.  As soon as you're at less than 100% weighting, it becomes apparent that the point is calculating a distance, not a motion.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Think of it this way- if you were to take the original joint and vertex position, and the position of the transformed joint, the vert at 100% weighting would behave just like a child.  If you draw a line from the original vert position to the 100% vert position, the vert position at less than 100% weighting will lie at the according distance along that line (it is, essentially, a [[LERP]], hence the name 'Linear Skinning').  With one vert and one influence, this is easy enough to understand:&lt;br /&gt;
&lt;br /&gt;
However, for multiple influences, it becomes more complex, but the above explanation does not change.  It may be helpful to examine the provided images while reading the Sample Code provided below.&lt;br /&gt;
&lt;br /&gt;
===A note on Algorithms (Linear Skinning vs. Dual Quaternion Skinning)===&lt;br /&gt;
The information here is applicable to Linear Skinning, by far the most common type.  Since 2006, there has been a technique called [[Dual Quaternion Skinning]] (you can find the paper [https://www.cs.tcd.ie/publications/tech-reports/reports.06/TCD-CS-2006-46.pdf here] and the website [http://isg.cs.tcd.ie/projects/DualQuaternions/ here]).  It will not be covered in this article other than this reference, but the workflow and concepts behind skinning remain the same, no matter the final algorithm used in the vertex shader.&lt;br /&gt;
&lt;br /&gt;
==The Process==&lt;br /&gt;
This section details the technical aspects of setting skinning in your 3d program.&lt;br /&gt;
===Creating the Skin===&lt;br /&gt;
There are a variety of skinning techniques for each program that will not be covered here.  It entails adding a Skin to a mesh and adding the bones to the system, and then adjusting the envelopes of the bones and/or the weights of individual points.&lt;br /&gt;
===Bone System===&lt;br /&gt;
Add the minimum number of bones necessary to the system.  All bones in the Skin must be passed to the Vertex Shader- it is perfectly fine to have bones in the skeleton that are not part of the Skin (they must be transformed but incur no additional cost for skinning).  You should aim for a maximum of 64 bones, preferably lower.  Any mesh that has more than 64 bones will usually be broken up either by the artist, or dynamically.&lt;br /&gt;
&lt;br /&gt;
[[Shader Model]] 2.0 and 3.0 support 256 vertex constant registers, and a bone is a 3x4 matrix, which is equivalent to 4 float3's.  Therefore, 256/4 = 64, which is the max number of bones in a system.  The lower the better, though.&lt;br /&gt;
===Influences per Vertex===&lt;br /&gt;
Hardware skinning supports a maximum of four influences per vertex (less influences will provide some performance savings, but this should not be a factor when you are skinning).&lt;br /&gt;
&lt;br /&gt;
The reason for this is how this info is passed into the shader.  The shader receives two inputs for each vertex (in addition to the constants mentioned above): BLENDWEIGHTS and BLENDINDICES.  Each is a float 4, which means they are just 4 floats each.  The BLENDINDICES contain the bone ID and the BLENDWEIGHTS contain the corresponding weight.  To store more than 4 bones would take additional inputs, which would be possible with custom code, but will add additional overhead (4 bones should be sufficient in most cases, anyway).&lt;br /&gt;
===Tips, tricks, and links===&lt;br /&gt;
If you are a technical animator, it would behoove you to create a custom skinning tool for your workflow if you have no already.  Default skinning tools in Max, Maya, and XSI, are decent, but you should build a custom skin tool to suit your workflow, since you will do A LOT of skinning, most likely.  It will allow you to customize your tool to your preferred workflow- for example, I generally weight points with Add/Subtract weights, Grow/Shrink selection, Blend, etc.  So I have a tool that allows me to customize every aspect of that (instead of being stuck adding/subtracting Max's default of .05).  More importantly, though, the tool will allow (and encourage) you to build custom tools.  My skin tools allow me to lock the weight of bones, have a Replace Weight function that will swap bone weights, mass copy-paste of verts, etc., whatever I find myself doing or wanting, I can add.&lt;br /&gt;
&lt;br /&gt;
==Hardware Skinning==&lt;br /&gt;
The actual 'Hardware Skinning' comes right at the rendering step, as the data is being passed to the shader.  To see where it fits into the general animation pipeline, check out the [[Skeletal animation]] article.  Three important keywords here are Bone Matrix Array/Bone matrices, Blend Indices, and Blend Weights.&lt;br /&gt;
&lt;br /&gt;
Bone matrices, as mentioned above, are 3x4 [[transforms]].  An array of the transforms is created on the CPU and passed for the bones that are part of the Skin system to the Vertex Shader.  Each matrix is 4 float3's, and takes 4 constant registers, as mentioned above.&lt;br /&gt;
&lt;br /&gt;
BLENDINDICES is a float4 the bones affecting vertex (and is a semantic in the vertex input struct).  The vertex shader will use these numbers to look up in the Bone Matrices array to find the transform.&lt;br /&gt;
&lt;br /&gt;
BLENDWEIGHTS is a float4 consisting of the weights corresponding to the BLENDINDICES above.  After the bone transform is indexed in the Bone Matrix Array, the vertex is transformed by that, with a weight of the blendweight (the vertex [[LERP]]s between the old and new position based on the weight).  It does the same for the Normal and the Tangent.&lt;br /&gt;
&lt;br /&gt;
Extra Indices and Weights are padded with 0's (and if [[Dynamic Branching]] is supported, such as in ShaderModel3 are skipped over).  The vertex shader iterates from the first Blend Index to the last, and the result is the transformed vertex.  This vertex, at this point, is processed and lit just as it normally would be for a static model.&lt;br /&gt;
&lt;br /&gt;
====Sample Program====&lt;br /&gt;
Below is some sample vertex skinning code, it is not a complete shader and is not functional as is.  It will still need other things in the [[Vertex Shader]] to work correctly, but it will demonstrate the concepts in this article.  The code was taken from [[OGRE]]'s example shader.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Bone matrix- You can call this whatever you want, this is your matrix of bones&lt;br /&gt;
//In this case, it is an array of 24 3x4 matrices, which is the max for shader model 1.1&lt;br /&gt;
//For shader model 2 or 3, it'd be 64&lt;br /&gt;
float3x4   worldMatrix3x4Array[24];	//This may have a semantic depending on your engine&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
//Relevant struct inputs&lt;br /&gt;
float4 position : POSITION;&lt;br /&gt;
float3 normal   : NORMAL;&lt;br /&gt;
float4 blendIdx : BLENDINDICES;&lt;br /&gt;
float4 blendWgt : BLENDWEIGHT;&lt;br /&gt;
//...and so on&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Vertex shader code&lt;br /&gt;
//...&lt;br /&gt;
// transform position by indexed matrix&lt;br /&gt;
float4 blendPos = float4(0,0,0,0);&lt;br /&gt;
int i;&lt;br /&gt;
for (i = 0; i &amp;lt; 4; ++i)&lt;br /&gt;
{&lt;br /&gt;
	blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// transform normal&lt;br /&gt;
float3 norm = float3(0,0,0);&lt;br /&gt;
for (i = 0; i &amp;lt; 4; ++i)&lt;br /&gt;
{&lt;br /&gt;
	norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * &lt;br /&gt;
	blendWgt[i];&lt;br /&gt;
}&lt;br /&gt;
norm = normalize(norm);&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
//You'd continue with the vertex shader as normal from here (lighting operations, etc).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]][[Category:Rigging]][[Category:Pipeline]][[Category:Deformation]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:46:37Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
* [[Vertex Skinning]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Vertex_skinning</id>
		<title>Vertex skinning</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Vertex_skinning"/>
				<updated>2014-08-06T19:46:09Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: Created page with &amp;quot;ertex Skinning, also known as weighting or binding (and archaically known as 'enveloping'), is creating a relationship of vertices to bones.  When bones transform, the ver...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ertex Skinning, also known as weighting or binding (and archaically known as 'enveloping'), is creating a relationship of vertices to bones.  When bones [[transform]], the vertices transform along with them proportionally to their weight to the bone.&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
A good explanation is given by Jason Osippa in Stop Staring:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;[Skinning] really doesn't understand motion; it only understands positions.  If you have one point weighted 100% to a joint, it will indeed move in arcs, and follow rotations; it's followign the motions of the join 100%, and since the joint is rotating, the point seems like it is rotating.  As soon as you're at less than 100% weighting, it becomes apparent that the point is calculating a distance, not a motion.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Think of it this way- if you were to take the original joint and vertex position, and the position of the transformed joint, the vert at 100% weighting would behave just like a child.  If you draw a line from the original vert position to the 100% vert position, the vert position at less than 100% weighting will lie at the according distance along that line (it is, essentially, a [[LERP]], hence the name 'Linear Skinning').  With one vert and one influence, this is easy enough to understand:&lt;br /&gt;
&lt;br /&gt;
However, for multiple influences, it becomes more complex, but the above explanation does not change.  It may be helpful to examine the provided images while reading the Sample Code provided below.&lt;br /&gt;
&lt;br /&gt;
===A note on Algorithms (Linear Skinning vs. Dual Quaternion Skinning)===&lt;br /&gt;
The information here is applicable to Linear Skinning, by far the most common type.  Since 2006, there has been a technique called [[Dual Quaternion Skinning]] (you can find the paper [https://www.cs.tcd.ie/publications/tech-reports/reports.06/TCD-CS-2006-46.pdf here] and the website [http://isg.cs.tcd.ie/projects/DualQuaternions/ here]).  It will not be covered in this article other than this reference, but the workflow and concepts behind skinning remain the same, no matter the final algorithm used in the vertex shader.&lt;br /&gt;
&lt;br /&gt;
==The Process==&lt;br /&gt;
This section details the technical aspects of setting skinning in your 3d program.&lt;br /&gt;
===Creating the Skin===&lt;br /&gt;
There are a variety of skinning techniques for each program that will not be covered here.  It entails adding a Skin to a mesh and adding the bones to the system, and then adjusting the envelopes of the bones and/or the weights of individual points.&lt;br /&gt;
===Bone System===&lt;br /&gt;
Add the minimum number of bones necessary to the system.  All bones in the Skin must be passed to the Vertex Shader- it is perfectly fine to have bones in the skeleton that are not part of the Skin (they must be transformed but incur no additional cost for skinning).  You should aim for a maximum of 64 bones, preferably lower.  Any mesh that has more than 64 bones will usually be broken up either by the artist, or dynamically.&lt;br /&gt;
&lt;br /&gt;
[[Shader Model]] 2.0 and 3.0 support 256 vertex constant registers, and a bone is a 3x4 matrix, which is equivalent to 4 float3's.  Therefore, 256/4 = 64, which is the max number of bones in a system.  The lower the better, though.&lt;br /&gt;
===Influences per Vertex===&lt;br /&gt;
Hardware skinning supports a maximum of four influences per vertex (less influences will provide some performance savings, but this should not be a factor when you are skinning).&lt;br /&gt;
&lt;br /&gt;
The reason for this is how this info is passed into the shader.  The shader receives two inputs for each vertex (in addition to the constants mentioned above): BLENDWEIGHTS and BLENDINDICES.  Each is a float 4, which means they are just 4 floats each.  The BLENDINDICES contain the bone ID and the BLENDWEIGHTS contain the corresponding weight.  To store more than 4 bones would take additional inputs, which would be possible with custom code, but will add additional overhead (4 bones should be sufficient in most cases, anyway).&lt;br /&gt;
===Tips, tricks, and links===&lt;br /&gt;
If you are a technical animator, it would behoove you to create a custom skinning tool for your workflow if you have no already.  Default skinning tools in Max, Maya, and XSI, are decent, but you should build a custom skin tool to suit your workflow, since you will do A LOT of skinning, most likely.  It will allow you to customize your tool to your preferred workflow- for example, I generally weight points with Add/Subtract weights, Grow/Shrink selection, Blend, etc.  So I have a tool that allows me to customize every aspect of that (instead of being stuck adding/subtracting Max's default of .05).  More importantly, though, the tool will allow (and encourage) you to build custom tools.  My skin tools allow me to lock the weight of bones, have a Replace Weight function that will swap bone weights, mass copy-paste of verts, etc., whatever I find myself doing or wanting, I can add.&lt;br /&gt;
&lt;br /&gt;
==Hardware Skinning==&lt;br /&gt;
The actual 'Hardware Skinning' comes right at the rendering step, as the data is being passed to the shader.  To see where it fits into the general animation pipeline, check out the [[Skeletal animation]] article.  Three important keywords here are Bone Matrix Array/Bone matrices, Blend Indices, and Blend Weights.&lt;br /&gt;
&lt;br /&gt;
Bone matrices, as mentioned above, are 3x4 [[transforms]].  An array of the transforms is created on the CPU and passed for the bones that are part of the Skin system to the Vertex Shader.  Each matrix is 4 float3's, and takes 4 constant registers, as mentioned above.&lt;br /&gt;
&lt;br /&gt;
BLENDINDICES is a float4 the bones affecting vertex (and is a semantic in the vertex input struct).  The vertex shader will use these numbers to look up in the Bone Matrices array to find the transform.&lt;br /&gt;
&lt;br /&gt;
BLENDWEIGHTS is a float4 consisting of the weights corresponding to the BLENDINDICES above.  After the bone transform is indexed in the Bone Matrix Array, the vertex is transformed by that, with a weight of the blendweight (the vertex [[LERP]]s between the old and new position based on the weight).  It does the same for the Normal and the Tangent.&lt;br /&gt;
&lt;br /&gt;
Extra Indices and Weights are padded with 0's (and if [[Dynamic Branching]] is supported, such as in ShaderModel3 are skipped over).  The vertex shader iterates from the first Blend Index to the last, and the result is the transformed vertex.  This vertex, at this point, is processed and lit just as it normally would be for a static model.&lt;br /&gt;
&lt;br /&gt;
====Sample Program====&lt;br /&gt;
Below is some sample vertex skinning code, it is not a complete shader and is not functional as is.  It will still need other things in the [[Vertex Shader]] to work correctly, but it will demonstrate the concepts in this article.  The code was taken from [[OGRE]]'s example shader.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Bone matrix- You can call this whatever you want, this is your matrix of bones&lt;br /&gt;
//In this case, it is an array of 24 3x4 matrices, which is the max for shader model 1.1&lt;br /&gt;
//For shader model 2 or 3, it'd be 64&lt;br /&gt;
float3x4   worldMatrix3x4Array[24];	//This may have a semantic depending on your engine&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
//Relevant struct inputs&lt;br /&gt;
float4 position : POSITION;&lt;br /&gt;
float3 normal   : NORMAL;&lt;br /&gt;
float4 blendIdx : BLENDINDICES;&lt;br /&gt;
float4 blendWgt : BLENDWEIGHT;&lt;br /&gt;
//...and so on&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Vertex shader code&lt;br /&gt;
//...&lt;br /&gt;
// transform position by indexed matrix&lt;br /&gt;
float4 blendPos = float4(0,0,0,0);&lt;br /&gt;
int i;&lt;br /&gt;
for (i = 0; i &amp;lt; 4; ++i)&lt;br /&gt;
{&lt;br /&gt;
	blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// transform normal&lt;br /&gt;
float3 norm = float3(0,0,0);&lt;br /&gt;
for (i = 0; i &amp;lt; 4; ++i)&lt;br /&gt;
{&lt;br /&gt;
	norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * &lt;br /&gt;
	blendWgt[i];&lt;br /&gt;
}&lt;br /&gt;
norm = normalize(norm);&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
//You'd continue with the vertex shader as normal from here (lighting operations, etc).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]][[Category:Rigging]][[Category:Pipeline]][[Category:Deformation]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:45:31Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
* [[Shaders for Artists]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:44:36Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
* [[Shaders]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Technical_Art</id>
		<title>Technical Art</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Technical_Art"/>
				<updated>2014-08-06T19:44:19Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: /* Shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What Is Technical Art? ==&lt;br /&gt;
Technical Artists help Artists and Designers get their content into the game with the least pain possible, and help Engineers and Artists communicate fluidly. &lt;br /&gt;
&lt;br /&gt;
Technical Artists must know what a healthy art pipeline &amp;quot;looks like&amp;quot; and must help make sure that content creators have the tools &amp;amp;amp; support necessary to do their jobs. &lt;br /&gt;
&lt;br /&gt;
* [http://tech-artists.org/forum/showthread.php?41-Technical-Artist-job-description-at-your-company Technical Artist job description at your company] Tech-Artists.Org forum thread&lt;br /&gt;
* [http://ericchadwick.com/img/techart_guidelines.html Technical Artist Guidelines] - by [http://www.linkedin.com/in/ericchadwick Eric Chadwick] and [http://www.linkedin.com/pub/ryan-mcclure/13/761/a51 Ryan McClure]&lt;br /&gt;
&lt;br /&gt;
== Technical Art Skills ==&lt;br /&gt;
There are many roles in Technical Art. The skills of Technical Artists vary widely from studio to studio; they often specialize in a particular subset. The most common task is writing tools for the artists in their teams.&lt;br /&gt;
&lt;br /&gt;
=== Rigging ===&lt;br /&gt;
[[Category:Animation]]#Rigging&lt;br /&gt;
&lt;br /&gt;
=== Shaders ===&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Shaders]]&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
[http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on: FOREVER Edition!]&lt;br /&gt;
&lt;br /&gt;
=== Visual Effects ===&lt;br /&gt;
[[Category:SpecialEffects]]&lt;br /&gt;
&lt;br /&gt;
== Tech-Artists.Org Wiki Conversion ==&lt;br /&gt;
The [http://tech-artists.org/index.php Tech-Artists.Org] administrators [http://tech-artists.org/forum/showthread.php?2687-How-to-grow-the-forum&amp;amp;p=16323&amp;amp;viewfull=1#post16323 are interested] in moving [http://tech-artists.org/wiki/Main_Page their wiki content] into the Polycount wiki. Their wiki has suffered from a lack of updated content, and has frequently been attacked by spam. &lt;br /&gt;
&lt;br /&gt;
Unfortunately the two wikis use different markup syntax. Theirs uses [http://meta.wikimedia.org/wiki/Help:Editing MediaWiki syntax], ours uses [http://wiki.polycount.com/HelpOnMoinWikiSyntax MoinMoin syntax]. There is [http://moinmo.in/MediaWikiConverter one converter] from [[MediaWiki]] into [[MoinMoin]], and there are [http://www.mediawiki.org/wiki/MoinMoin a few conversion scripts] that go in the opposite direction. &lt;br /&gt;
&lt;br /&gt;
We would be very appreciative if someone could help with this! &lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://tech-artists.org/index.php Tech-Artists.Org]&lt;br /&gt;
* [http://www.polycount.com/forum/showthread.php?t=68788 Tech Artist - What are you working on] Polycount forum thread&lt;br /&gt;
&lt;br /&gt;
== Pages in This Category ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Discipline]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-06T19:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a [[NormalMap|normal map]] is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-06T19:42:31Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a [[Normal Map]] is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-06T19:42:01Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a [[NormalMap]] is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	<entry>
		<id>http://wiki.polycount.com/wiki/Shaders_for_Artists</id>
		<title>Shaders for Artists</title>
		<link rel="alternate" type="text/html" href="http://wiki.polycount.com/wiki/Shaders_for_Artists"/>
				<updated>2014-08-06T19:38:35Z</updated>
		
		<summary type="html">&lt;p&gt;Haiddasalami: Created page with &amp;quot;==Introduction== As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
As the fidelity of graphics increase, as there are more and more sheets and models and polygons an artist must make to strive towards their intended graphical outcome, one can often feel lost in a sea of terms that we don't understand. Everyone knows what a [[normal map]] is, but how does it work? What is [[gloss]]? What does a [[specular]] texture do?&lt;br /&gt;
&lt;br /&gt;
Most of us know what a normal map looks like, we know what gloss does, we know that specular means highlights. But its been my experience that actually knowing something about these techniques, getting under the hood of [[shaders]] (the things that drive the actual rendering, and all we are really concerned with as modelers and texture-artists), has increased my ability many times over.&lt;br /&gt;
&lt;br /&gt;
I'm going to ignore the traditional way of learning vertex and pixel shaders; that is, doing your rendering with a [[vertex shader]], and then showing you how to do it so much better with a [[pixel shader]]. As artists, this is mostly pointless.&lt;br /&gt;
&lt;br /&gt;
==Overview of Shaders==&lt;br /&gt;
 &lt;br /&gt;
===What is a Shader?===&lt;br /&gt;
Everyone has heard of shaders, or shader-based engines or software, but most people don't know what they are, or what the craze is. The most succinct explanation I can think of for a shader is:&lt;br /&gt;
&lt;br /&gt;
''A shader takes something, does stuff to it, and gives you something else.''&lt;br /&gt;
&lt;br /&gt;
Depending on who you are, that is either the most mundane explanation, or the most intriguing explanation. Obviously, programmers find it intriguing. And I hope you will too.&lt;br /&gt;
&lt;br /&gt;
Shaders come in two sorts. Vertex shaders, and pixel shaders. They go together hand in hand, but it is pixel shaders that are where the magic happens.&lt;br /&gt;
&lt;br /&gt;
===The GPU/Rendering Pipeline===&lt;br /&gt;
&lt;br /&gt;
Given the definition of the shader above, it would be useful to briefly visit the rendering pipeline. Since we are concerned with shaders, we will be looking at the &amp;quot;[[programmable pipeline]],&amp;quot; as opposed to the now obsolete fixed-function pipeline. The [[GPU]] is what is known as a parallel processor: it receives information and operates on it. What it can do, however, is somewhat limited- it is a one-way street, in that the GPU cannot backtrack and reuse info. For example, even if we light an object with the same normal map in three passes, the normal must be calculated for each pass. The second and more serious limitiation is that the GPU cannot talk to other information it is processing. If we think of the GPU as a stack of tubes, information passes in one end and goes out the other- there is movement only one way and the tubes cannot cross or interact with each other. This means that you cannot get info for other vertices or pixels, etc.&lt;br /&gt;
&lt;br /&gt;
It is important to understand at least in such a summary sense the rendering pipeline. It will, hopefully, help the rest of the article to make more sense. In some sense all of what follows are simply elements that are used in a single tube of many- these operations go on for every vertex and every pixel in near-unison but also near-isolation.&lt;br /&gt;
&lt;br /&gt;
==Mathematics==&lt;br /&gt;
===Integers, Floats, and Vectors===&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Data Types]]''&lt;br /&gt;
&lt;br /&gt;
This is simple. A float is a real number with a decimal point. It contains a certain number of bits of information which limit its accuracy, but don't worry about it. So, a float2 are two real numbers, and a float3 are three real numbers, and a float4, four real numbers.&lt;br /&gt;
&lt;br /&gt;
Integers are whole numbers (0, -2, 1035, etc.). But we won't worry about integers- for our purposes, we will only deal with floats. Another name for a float is a scalar value. &amp;quot;4.&amp;quot; and 0.0374832 are both floats. Floats are used for a variety of things.&lt;br /&gt;
&lt;br /&gt;
Float2's are normally used for UV coordinates. An example of a float2 is &amp;quot;5.3, 2.5493&amp;quot;, ie, its just a list of two numbers.&lt;br /&gt;
&lt;br /&gt;
Float3's are usually called vectors. They are depicted with the subtext of &amp;quot;name.xyz&amp;quot; or &amp;quot;name.rgb&amp;quot;. However, they really have many sub-categories. Vectors are directions: 1 is along the positive axis and -1 along the negative axis for each component. Vectors are generally 'normalized' (see below), and each component falls between -1 and 1. Float3's can also be position values.&lt;br /&gt;
&lt;br /&gt;
Though float3's are vectors, float4's are more commonly used in shaders because graphics hardware are optimized for them. They contain a fourth value, which can refer to the magnitude of a vector, or the value of an alpha channel. They are depicted with the subset of &amp;quot;name.xyzw&amp;quot; or &amp;quot;name.rgba&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Normalization===&lt;br /&gt;
:''For more info, see [[Unit Vector]]''&lt;br /&gt;
&lt;br /&gt;
Normalization is essentially setting a vector's length/magnitude to 1. This makes the vector such that when the XYZ components are added they equal 1, and the W value also equals 1. This is important for multiplying and comparing vectors (a requirement for things such as lighting).&lt;br /&gt;
&lt;br /&gt;
===World, Object, and Tangent Space===&lt;br /&gt;
:''For more info, see [[Coordinate Systems]]''&lt;br /&gt;
We generally talk about shaders, and graphics in general, with regards to three different types of 'spaces': World Space, Object (or Local) Space, and Tangent Space. I will introduce these briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Spaces&amp;quot; work very similarly to the &amp;quot;Reference Coordinate System&amp;quot; in 3ds (or the Tool Settings panel in Maya). 3ds has two &amp;quot;Systems&amp;quot; which are of importance to us: World and Local.&lt;br /&gt;
&lt;br /&gt;
To test them out, create an object, and translate and rotate it. Use &amp;quot;World,&amp;quot; and your Move and Rotate axes will always stay aligned with the 3ds axis (Z up, X horizontal, Y into the screen). This is the equivalent of &amp;quot;World Space&amp;quot; in graphics programming. Now go into &amp;quot;Local.&amp;quot; When you have an object selected, the Move and Rotate will adjust itself to the &amp;quot;local&amp;quot; axis of the object... if you rotate the object 90 degrees around the Z axis, the X axis now points into the screen, and the Y horizontal. Play around and experiment. This is the &amp;quot;Local/Object Space&amp;quot; in graphics programming. Finally, select a vertex of your object (still use Local Space). You will see that the move/scale gizmo now is aligned with the vertex's &amp;quot;normal&amp;quot; (actually its the averaged normal of the adjacent faces but that's not important). This is what is referred to as &amp;quot;Tangent Space.&amp;quot; (A normal is a vector that is perpendicular to a surface).&lt;br /&gt;
&lt;br /&gt;
So how does this apply to Shaders? Well, Vertex Shaders will 'use' these spaces, putting different 'inputs' into the same space so they can be measured and compared. For this article, we will be mostly concerned with World Space. Object space is very similar. Tangent Space is more complicated, but conceptually you should understand it after this article. We will explore Tangent Space more when we cover Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
==Vertex Shader==&lt;br /&gt;
:''For more info, see [[Vertex Shader]]''&lt;br /&gt;
&lt;br /&gt;
Now that we know what a Shader does, let's take a look at one.  This shader converts things to World Space.  We will break down a simple shader line-by-line.&lt;br /&gt;
 &lt;br /&gt;
Remeber our initial definition?  ''A shader takes something, does stuff to it, and gives you something else.''  Well, we first have to set up what &amp;quot;something&amp;quot; we take, and the &amp;quot;something else&amp;quot; we will eventually get.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// input from application &lt;br /&gt;
struct a2v { &lt;br /&gt;
 float4 position  : POSITION; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 tangent  : TANGENT; &lt;br /&gt;
 float3 binormal  : BINORMAL; &lt;br /&gt;
 float3 normal  : NORMAL; &lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
All application inputs inherited from the application like this are in [[Object Space]] (many rendering engines allow you to take variables, such as light position, in world space or object space, but they are not part of the vertex input structure... they are separate variables).  These are the things the application passes into the vertex shader.  The application says &amp;quot;this vector (float3) is your tangent, this is your normal, and this is your binormal.  This float2 is the UV coordinates of the vertex.  And this vector (float4) is the vertex's position in Object Space.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;// output to fragment program &lt;br /&gt;
struct v2f { &lt;br /&gt;
 float4 position     : POSITION; &lt;br /&gt;
 float3 lightVec     : TEXCOORD4; &lt;br /&gt;
 float3 eyeVec      : TEXCOORD3; &lt;br /&gt;
 float2 texCoord  : TEXCOORD0; &lt;br /&gt;
 float3 worldTangent   : TEXCOORD6; &lt;br /&gt;
 float3 worldBinormal  : TEXCOORD7; &lt;br /&gt;
 float3 worldNormal    : TEXCOORD5;&lt;br /&gt;
}; &amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what the vertex shader outputs into the pixel shader (AKA, fragment program).  The actual code of the vertex shader will show us how we go calculate these outputs.  [[TEXCOORD]] is just a semantic for a &amp;quot;[[register]],&amp;quot; that says to the vertex shader, &amp;quot;store this number in this place with the name &amp;quot;TEXCOORD#&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
Now, the actual Vertex Shader code (this is the &amp;quot;stuff we do to it, going back to our original definition):&lt;br /&gt;
&amp;lt;pre&amp;gt;v2f v(a2v In) &lt;br /&gt;
{ &lt;br /&gt;
 v2f Out = (v2f)0; &lt;br /&gt;
Out.position = mul(In.position, wvp);&lt;br /&gt;
Out.texCoord = In.texCoord;&amp;lt;/pre&amp;gt;&lt;br /&gt;
These are just your standard things to do.  This first &amp;quot;zeros out&amp;quot; your result to make sure the calculations are correct.  Then, you convert your vertex position (in object space) to &amp;quot;screen space&amp;quot; so it shows up correctly on the screen (multiplying by the &amp;quot;world view projection matrix&amp;quot;).  Finally, you take your input UV coordinates and pass them through, unmodified.&lt;br /&gt;
&lt;br /&gt;
:''For more info, see [[Transforms]]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;float3 worldSpacePos = mul(In.position, world);&lt;br /&gt;
Out.lightVec = lightPosition - worldSpacePos;&lt;br /&gt;
Out.eyeVec = eyePosition - worldSpacePos;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Matrix multiplication is a doozy... don't even try to think about it mathematically.  This multiplies the object space vertex position by the &amp;quot;world matrix&amp;quot; to find the world space vertex position.  Then we take the world space light and eye position, subtract the world space vertex position, and we get a vector pointing from the light (or eye) to the vertex position.&lt;br /&gt;
 &lt;br /&gt;
In this case, our light and eye are in world space... if they weren't, we'd multiply their object space positions by the World Matrix to put them into world space, ''before'' we do the subtraction.&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;Out.worldNormal = mul(In.normal, worldIT).xyz;&lt;br /&gt;
Out.worldBinormal = mul(In.binormal, worldIT).xyz;&lt;br /&gt;
Out.worldTangent = mul(In.tangent, worldIT).xyz;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This just converts your normal, binormal, and tangent inputs, into world space, by multiplying them by the World Inverse Transpose Matrix.  Now, everything (vertex position, light vector, eye vector, normal, binormal, and tangent vectors) are in world space.&lt;br /&gt;
 &lt;br /&gt;
==Lighting==&lt;br /&gt;
Before we move into Pixel Shaders, we need to understand lighting, both Vertex Lighting and [[Per-Pixel Lighting]].  Fortunately they use exactly the same math.  Before we get into the pixel shader, which is intertwined with normal mapping as far as we are concerned, we must understand lighting more fully.&lt;br /&gt;
 &lt;br /&gt;
As far as we are concerned, lighting comes in two essential forms: diffuse lighting, and specular lighting.  There are different techniques for both of these, and there are also interesting ways to do ambient lighting, sub-surface scattering, anisotropic lighting, etc., but since this is an intro, we will look at the most common formulas of the most common lighting types.&lt;br /&gt;
 &lt;br /&gt;
===Diffuse Lighting===&lt;br /&gt;
Two inputs are of importance when we consider diffuse lighting.  The normal (N), and the light vector (L).  The comparison between these, called the [[Dot Product]], determines how much illumination reaches a surface (we call this, NdotL).  The dot product is a mathematical function of two vectors; if they are 'facing' each other head on, the result is 1.  If they are perpendicular, the result is 0.  If they are parallel, the result is -1, but we usually &amp;quot;clamp&amp;quot; any negative values to 0.&lt;br /&gt;
 &lt;br /&gt;
So, let us look at this setup, of a single light positioned directly above the vertex of a plane.  The lines pointing from the vertex are the vertex normals.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/8862/maya2007-03-3001-10-41-20.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6460/maya2007-03-3001-10-24-71.jpg&lt;br /&gt;
&lt;br /&gt;
The dot product of the vertex directly under the light is 1.  The darker a vertex is, the lower its dot product.  Exact values aren't important, only the idea is.&lt;br /&gt;
 &lt;br /&gt;
Let's also look at the same setup, but with a plane with exponentially more vertices.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/7220/maya2007-03-3000-50-43-65.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/6078/maya2007-03-3000-50-31-92.jpg&lt;br /&gt;
http://img177.imageshack.us/img177/1664/maya2007-03-3000-50-55-82.jpg&lt;br /&gt;
&lt;br /&gt;
The lighting is done exactly the same way, the NdotL is calculated per-vertex, and interpolated linearly across the plane... meaning, that if one vertex has an NdotL of 1, and an adjacent vertex has an NdotL of 0, the point half-way between the two vertices will have a dot product of .5.  Because things are done per-vertex, however, this interpolation/lack of sampling creates problems, as we can see in the following image.&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/9507/maya2007-03-3001-17-34-57.jpg&lt;br /&gt;
&lt;br /&gt;
The NdotL of all vertices is exactly the same, so the surface is shaded with a solid color (the NdotL is .6 at each vertex, and thus is .6 everywhere).&lt;br /&gt;
 &lt;br /&gt;
Enter, per-pixel lighting and pixel shaders.  With per-pixel lighting, we get the following result to the same exact geometry:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/1296/maya2007-03-3001-17-12-31.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The reason is that we are finding the NdotL at each ''pixel'' instead of vertex.  This is much more accurate and precise.  Instead of being concerned with the normal of each vertex, we are concerned with the normal of each pixel, which is given to us from, you guessed it, a '''normal map''' (or a normalized normal from the vertex shader, but those days of non-normal-mapped surfaces are behind us).&lt;br /&gt;
&lt;br /&gt;
Finally, the original simple plane with per-pixel lighting:&lt;br /&gt;
&lt;br /&gt;
http://img177.imageshack.us/img177/656/maya2007-03-3000-52-17-29.jpg '''&amp;lt;broken&amp;gt;'''&lt;br /&gt;
http://img177.imageshack.us/img177/7296/maya2007-03-3000-52-29-31.jpg&lt;br /&gt;
&lt;br /&gt;
===Specular Lighting===&lt;br /&gt;
Specular lighting is a 'fake' reflection of the light on the surface.  It provides 'central hotspot' and the size of the area around it.  Specularity isn't as straightforward as diffuse lighting, but it is still relatively simple.  Specular lighting is dependent upon the location of the eye/camera, remember, not just the normal and light.  &lt;br /&gt;
&lt;br /&gt;
====Half Angle (H)====&lt;br /&gt;
So, we start with specular lighting, by finding what is called the &amp;quot;half angle&amp;quot;, that is, '''L + E''', or the light vector plus the eye vector.  This gives us a vector pointing half-way between the Light and Eye vectors (angles).  Imagine a vector as an arrow, to add vectors, you add the bottom of one arrow to the arrowhead of the other arrow... draw this out, and you'll see that what we do indeed get is the half-way vector.  Imagine your light and camera are in the same spot, the half angle points in the exact same direction.  But as your camera rotates around the object, the half-angle vector rotates at half the 'rate', for all means and purposes.&lt;br /&gt;
&lt;br /&gt;
====NdotH====&lt;br /&gt;
So, we take the [[half angle]], or H, and get '''NdotH''', the dot product between the normal and the half angle.  So, once again, imagine our eye and light are in the same position and we are looking at a sphere.  The shader returns an NdotH of 1 for the vertex directly in front of the camera/light.  Now, let us move our camera 90 degrees around the sphere... the half angle is at 45 degrees from our start point, so if we are concerned with the NdotH of the vertex directly in front of us, it should return a value of &amp;quot;.5&amp;quot;.  The only time you will return an NdotH of 0 is when you are looking at the light towards a surface pointing directly away from it (the light on one side of the sphere, and the eye at the complete opposite).&lt;br /&gt;
&lt;br /&gt;
====Gloss/Shininess/Specular Power====&lt;br /&gt;
For specular lighting, we have the &amp;quot;[[specular power]],&amp;quot; which is also called [[gloss]], [[shininess]], etc.  This controls the size of the [[specular highlight]].  The best way to explain this is mathematically.  What we do is take the NdotH, and raise it to the &amp;quot;gloss&amp;quot; power.  So, let's compare two gloss powers: 5, and 60.  The result of NdotH^gloss (NdotH raised to the &amp;quot;gloss&amp;quot; exponent/power) we will call the '''Specular Level'''.&lt;br /&gt;
&lt;br /&gt;
Where NdotH is .5, the Specular Level becomes .03, and .000000000000000000867, respectively.  Where NdotH is 1, the Specular Level becomes 1, and 1, respectively (1 to any exponent is 1).  Where NdotH is .75, the Specular Level is .23, and .00000003189, respectively.  What we can see happening, if we did this for every hundredth decimal place or so, is an exponential falloff (duh).  Higher exponents lead to a tighter highlight (because even relatively high NdotH values are multiplied by themselves so many times to become negligable.&lt;br /&gt;
&lt;br /&gt;
===Ambient===&lt;br /&gt;
Ambient lighting is &amp;quot;flat&amp;quot; traditionally.  Now many games are using what are called &amp;quot;[[diffusely convolved cube map]]s&amp;quot; that simulate [[Global Illumination]], but we can consider ambient lighting as adding a uniform brightness to the scene.&lt;br /&gt;
&lt;br /&gt;
===Putting Lighting Together===&lt;br /&gt;
Lighting is done by adding together the diffuse, specular, and ambient components.  The most simple, basic, greyscale lighting can essentially be written as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 lighting = dot(N, L) + dot(N, (E + L)) + ambientColor&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is just adding together the three types of lighting for that vertex or pixel.  The values are clipped to 0 and 1 by the hardware display (that popular buzzword, HDR, doesn't clip the values and dynamically adjusts what values are clipped, and some other things, to achieve a more realistic rendering and eye behaviour).&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;br /&gt;
[[Category:HLSL]]&lt;br /&gt;
[[Category:Rendering]]&lt;/div&gt;</summary>
		<author><name>Haiddasalami</name></author>	</entry>

	</feed>