【maya】カラーマップを使ったContour lineの入り抜き表現

Contourでのラインで入り抜き表現をカラーマップとコントラストを使って行うやり方です。
How to specify line thickness in Contour using color map and contrast.

【maya】Contour lineで入り抜き表現ではvertexColorを使う方法をまとめていますが、モデルを修正したり頂点情報が変わるとvertexColorがなくなってしまいます。
In 【maya】line width with contour line vertexColor is used, but once the topology of the model changes the vertexColor is gone.

マテリアルのcolorとambientにマップを用意することでラインの出方を指定しつつラインの入り抜きをつける方法がありました。
By preparing a map for color and ambient it is possible to adjust the width of the line.

contour_width_contrast_001contour_width_contrast_002

【maya】Contour lineでのトゥーンラインのようにトゥーン設定を行います。
Set up the toon setting like 【maya】toon with contour line.

②contour_contrast_function_levelsのcontrastのチェックを入れます。
Check the contrast option in contour_contrast_function_levels node.

③lambertを用意してモデルにアサインします。
contour_shader_widthfromcolorを出して、contour_shader_widthfromcolor.outValueをlambert.miContourShaderにつなげます。
Prepare a lambert and connect contour_shader_widthfromcolor.outValue to lambert.miContourShader.

④Diffuseの値を0にします。Diffuseに値が入るとコントラストがはっきりでないため、contrastで入れたいラインが入りません。
Turn the value for diffuse to 0. When diffuse is greater than 0 the contrast is not as strong so the line will no show up.

⑤マテリアルのcolorにコントラスト用のマップを入れます。
contour_contrast_function_levelsのcontrastのチェックを入れることで、色の変化の強い所(コントラストのある所)にラインが表示されます。
グラデーションにしてあげることで、ラインが出なくなります。
上の画像ではカラーに青、緑、赤のマップを入れることで、ラインの出る箇所を指定しています。
Put a texture for contrast in color of the material.
By turning contrast in contour_contrast_function_levels, a line will show up where there’s a strong contrast.
Line will not show up when there’s a gradation.
The upper image with two spheres has a color map with blue, green and red where I want the lines to be.

⑥マテリアルのambientに入り抜き用のグラデーションマップを用意します。
白がcontour_shader_widthfromcolorのMinWidth、黒がMaxWidthになります。
Put a gradation map in the ambient to adjust the width of the line.
White will be the thickness specified in contour_shader_widthfromcolor’s MinWidth, and black will be MaxWidth.

今回の例ではモデルの-xからx方面に白から黒のグラデーションrampをambientに入れてみてます。
For the example I’ve put a white to black x direction gradation ramp in the ambient node.

contour_width_contrast_003

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA