Manual/PartIII/Ramp Shaders
Wikipedia,自由的百科全书
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). 新的渐变着色器(Ramp Shader) 选项如今在Blender中允许你为 一个材质设置一个颜色变化范围, 并且定义在一个曲面上该范围将如何变化, 以及它将如何混合实际的颜色(特别是从材质本身或者贴图的输出颜色)。 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. 因为在Blender中纹理计算发生在着色(明暗处理)之前,所以 Ramp Shader 可能完全替代掉贴图或者材质的颜色。 但是使用混合选项和 Alpha 值是有可能在Blender材质中创建一个额外的着色层的。
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.). Ramps 面板位于 Material上下文中(F5)。 这里你可以使用 顶部两个按钮来显示任一个设置,按Show Col Ramp 按钮显示漫反射,或者按Show Spec Ramp 按钮显示镜面反射颜色渐变范围。 (“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.). 按下按钮Colorband 启用Ramp Shaders。 缺省的它开启两个颜色,第一个 Alpha = 0,并且无颜色。而第二个 Alpha = 1是青色(蓝绿色)。 (Figure 10.16, “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.
E/L/S - 定义在 Ramp Shader 颜色和材质 颜色之间的插值类型。 E - Ease or Qubic, L - 线性和 S - B-样条.
- 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.
Alpha - 定义有多少 Ramp Shader 效果会被看到. Alpha 值为 0 意味着 Ramp Shader 完全透明 ,所以在最终的材质中不可见。 值为 1 将 Ramp Shader 设为不透明。如果你 定义的颜色具有不同的Alpha 值, 他们将会互相之间内插来获得不同透明度设置之间平滑的过渡。 通过色带后面的小方格图案,你可以在色带上预览Alpha设置的效果。如果图案可见那么透明度就小于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.
R/G/B - 当前颜色的 RGB 值。你可以用 鼠标左键 按Pos 控件下方的色块 弹出颜色选择器来选择一个颜色。
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. 当前颜色在色带中被标记为稍稍厚实的条带。要选择一个颜色位置,你可以在需要的颜色位置上按 鼠标左键 ,或用 Cur 区域中的左右按钮上下切换当前色号。你也可以在该区域中按 SHIFT-LMB然后手工输入要求的色号。 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. 你可以通过简单的按住 LMB 并在色带上拖曳来移动一个颜色的位置。 也有一个Pos 控件,你可以用其左右箭头来移动位置或者按 SHIFT-LMB 然后手工输入位置。
| note注意:
If you reorder the positions of the colors, they will be renumbered so that they always start with 0 from the left and increment to the right.如果你重新排序颜色的位置,它们将被重新编号,因此它们总是从左到右由0 开始递增。 |
The two pop-up buttons and the value slider in the bottom of the panel defines how the Ramp Shaders work: 位于面板底部的两个弹出式按钮和数字滑块决定Ramp Shaders 怎样工作:
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.
着色器 - 该值与基础着色方程(象兰伯特或者Phong)给出的一样定义了颜色。这里光的数量不影响颜色,只有光的方向起作用。
- 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.
法线 - 曲面的法线,与照相机有关,被用于 Ramp Shader。这与对待贴图一样,只是为了便利而添加的。
- 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.
效果 - 前面的三种选项对每盏灯起作用,这个选项只有在所有的着色(明暗处理)计算结束之后才起作用。 这就允许对整个着色结果包括卡通风格的完全控制。这里使用alpha值是调节一个最终材质最有用的
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. Method 菜单提供一些混合类型的选项: 混合, 加, 减, 乘, 屏幕, 除, 微分, 变暗 和 变亮. Method 选项提供一个选择怎样混合来自输入和Ramp Shader的颜色。
Factor 因子
The Factor slider denotes the overall factor of the Ramp Shader effect: 0 means no effect and 1.0 means full effect. Factor滑块指示了Ramp Shader 效果的完全混合因子: 0 意味着无效而 1.0 意味着全效。
Example 例子
Let us make a simple example using Ramp Shaders. 让我们用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).
移除场景中缺省的立方体然后添加一个猴子网格物体。 (SHIFT-A -> Add -> Mesh -> Monkey). 按细分曲面Subsurf 然后设置显示和渲染曲面细分级别到2。 按Set Smooth按钮来获得一个表面光滑的猴子! 所有这些都在 Edit 上下文。 (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..
现在按TAB键退出 编辑模式。 按F5进入 材质上下文。 在材质 面板上 按新增来添加一个新材质! 修改 Shaders页上的参数如图“着色器设置.”。
- 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!
按Ramps 页打开 斜坡着色器 面板。按色带 来 激活斜坡着色器 效果。现在试着 按图 10.21, “斜坡着色器设置.”设置参数。 记得 设置输入为法线。 靠右边的第二个颜色 设Alpha = 0 并且将颜色设为纯黑!
- 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..
在Ramps页上按 Show Spec Ramp 然后试着如图Specular Ramp Shader color 0. 和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. 这是我们上面输入的设置所渲染的结果。在No Ramp Shader. 图中没有激活Ramp Shader。在Color Ramp. 图中Color Ramp 被激活以及最终Both Color and Specular Ramp.图中 Color Ramp 和Specular Ramp 都被激活!记住在这里我们仅仅展示了Ramp Shader的一个效果。还有很多可以展开,要看与这个例子完全不同的效果,试着修改输入 和方法参数。
|












