Manual/Ramps
From BlenderWiki
Contents[hide] |
Ramps
Mode: All Modes
Panel: Shading/Material Context → Ramps
Hotkey: F5
Description
Ramps allow you to precisely control the colour gradient across a material, rather than just a simple blend from a brightened colour to a darkened colour, from the most strongly lit area to the darkest lit area. As well as several options for controlling the gradient from lit to shadowed, ramps also provide 'normal' input, to define a gradient from surfaces facing the camera to surfaces facing away from the camera. This is often used for materials like some types of metallic car paint, that change colour based on viewing angle.
Since texture calculations in Blender happen before shading, the Ramp Shader can completely replace texture or material color. But by use of the mixing options and Alpha values it is possible to create an additional layer of shading in Blender materials.
Options
- Input
- The input menu contains the following options for defining the gradient:
- Shader
- The value as delivered by the material's shader (like Lambert or Phong) defines the color. Here the amount of light doesn't matter for color, only the direction of the light.
- Energy
- As Shader, but now also lamp energy, color and distance, is taken into account. This makes the material change color when more light shines on it.
- Normal
- The surface normal, relative to camera, is used for the Ramp Shader. This is possible with a texture as well, but added for convenience.
- Result
- All three previous options work per lamp, this option only does it in the end of all shading calculation. This allows full control over the entire shading, including 'Toon' style results. Using alpha values here is most useful for tweaking a finishing touch to a material.
- Method
- A list of the various blending modes available for blending the ramp with the base material.
- Factor
- The amount that the ramp is blended with the base material, from 0.0 (no effect) to 1.0 (full effect).
Colorbands
Mode: All Modes
Panel: Shading/Material Context → Ramps
Hotkey: F5
Description
A colorband can contain a gradient through a sequence of many colors (with alpha), each color acting across a certain position in the spectrum.
Options
- Add
- Add a new mark to the centre of the colorband with default colours. New marks can also be added with Ctrl LMB
click on the colorband itself, which will add the mark at the position of the click, with the same colour as already existing underneath the mouse pointer.
- Del
- Remove a mark from the colorband
- Cur
- The number of the current selected mark on the colorband
that's being edited. The current selected mark is shown on the
colorband with double width, and can be changed by selecting with a LMB
click.
- Pos
- The location of the current mark along the colorband, from
0.0 (left) to 1.0 (right). The position of the marks can also be
changed by clicking and dragging them with LMB
- R/G/B
- The colour of the current mark
- Alpha
- The alpha value (opacity) of the current mark. An Alpha value of 0 means that the color is totally transparent and will not be seen in the final colorband. A value of 1 sets the color opaque. If you defined colors with different Alpha values, they will be interpolated between each other to get a smooth transition between different transparency settings. You can preview the Alpha settings on the colorband with the checker board pattern behind the colorband. If pattern is visible then the transparency is less than 1.
The colors can interpolate from one to the other in the following ways:
- E
- Ease in by a quadratic equation
- C
- Cardinal
- L
- Linear (Default). A smooth, consistent transition between colors
- S
- B-Spline
Introduction
In many real life situations - like skin or metals - the color of diffuse and specular reflections can differ slightly, based on the amount of energy a surface receives or on the light angle of incidence. The new Ramp Shader options in Blender now you allow to set a range of colors for a Material, and define how the range will vary over a surface, and how it blends with the 'actual color' (typically from material or as output of texture). Since texture calculations in Blender happen before shading, the Ramp Shader can completely replace texture or material color. But by use of the mixing options and Alpha values it is possible to create an additional layer of shading in Blender materials.
Interface
The Ramps panel is located in the Material context (F5). Here you can use the top two buttons to show either settings by pressing Show Col Ramp for diffuse or Show Spec Ramp for specular ramps. (Ramps Panel.).
Pressing the button Colorband enables Ramp Shaders. By default it opens with 2 colors, with the first having Alpha = 0, and no color. And the second having Alpha = 1 and a cyan color. (Ramps Panel Colorband.).
- Add - Adds a new color in the middle of the colorband with neutral grey as default color.
- Cur - Displays the current selected color number on the colorband.
- Del - Deletes the current position.
- E/L/S - Defines the type of interpolation between the Ramp Shader color and the Material color.
- E - Ease or Qubic, L - Linear and
- S - B-Spline.
- Alpha - Defines how much of the Ramp Shader effect will be seen. An Alpha value of 0 means that the Ramp Shader is totally transparent and will not be seen in the final material. A value of 1 sets the Ramp Shader opaque. If you defined colors with different Alpha values, they will be interpolated between each other to get a smooth transition between different transparency settings. You can preview the Alpha settings on the color band with the checker board pattern behind the colorband. If pattern is visible then the transparency is less than 1.
- R/G/B - The current color RGB values. You can LMB on the color field under the Pos field to choose a color using the Color Picker.
The current color is marked with a slightly thicker bar in the colorband. To select a color position you can either press LMB on the desired color position, or step the current color number up and down with the right and left arrows in the Cur field. You can also SHIFT-LMB in the field and enter the required color number manually. You can move the position of a color by simply pressing the LMB and dragging over the colorband. There is also a Pos field where you can move the position with the left and right arrows or SHIFT-LMB in the field and enter the position manually.
Note: {{{2}}} |
The two pop-up buttons and the value slider in the bottom of the panel defines how the Ramp Shaders work:
Input
- Shader - The value as delivered by the basic shading formula (like Lambert or Phong) defines the color. Here the amount of light doesn't matter for color, only the direction of the light.
- Energy - As Shader, but now also lamp energy, color and distance, is taken into account. This makes the material change color when more light shines on it.
- Normal - The surface normal, relative to camera, is used for the Ramp Shader. This is possible with a texture as well, but added for convenience.
- Result - All three previous options work per lamp, this option only does it in the end of all shading calculation. This allows full control over the entire shading, including 'Toon' style results. Using alpha values here is most useful for tweaking a finishing touch to a Material.
Method
The Method menu has several options for blending type: Mix, Add, Subtract, Multiply, Screen, Divide, Difference, Darken and Lighten. Method options gives an option to choose how the blending between the color from Input and the Ramp Shader will be done.
Factor
The Factor slider denotes the overall factor of the Ramp Shader effect: 0 means no effect and 1.0 means full effect.
Example
Let us make a simple example using Ramp Shaders.
- Remove default cube object from scene and add a Monkey mesh (SHIFT-A -> Add -> Mesh -> Monkey). Press Subsurf and set display and render Subsurf Subdivision level to 2. Press Set Smooth to get a nice smooth Monkey. All this in Edit context. (F9).
- Now press TAB to exit EditMode. Press F5 to enter Material context. In the Material panel press Add New to add a new material. Change the parameters in the Shaders tab as Shader settings..
- Press Ramps tab to open the Ramp Shader panel. Press Colorband to activate the Ramp Shader effect. Now try to set the parameters as Ramp Shader settings.. Remember to set the Input to Normal. The second color to the right is set to Alpha = 0 and the color to pure black.
- In the Ramps tab press Show Spec Ramp and try to set the parameters as Specular Ramp Shader color 0. and Specular Ramp Shader color 1..
Here is the rendered result of the settings we just entered above. In No Ramp Shader. there is no Ramp Shader active. In Color Ramp. the Color Ramp is activated and finally in Both Color and Specular Ramp. both Color Ramp and Specular Ramp are activated! Remember here we have just demonstrated one effect of the Ramp Shader. There is much more to explore, try changing the Input and Method parameters, to see totally different results from the ones we have just seen in this example.
|