No More Retake

3DCG屋さん向けTips&Referenceサイト

メニュー

Maya:『writeToColorBuffer』その1

今回は”WriteToColorBuffer”ノードについて書くことにしました。
MayaでPass出力する場合、避けては通れないノードですね。
意外と長くなりそうなので、何回かに分けるつもりです。

このノード、ひとことで言うと『自分で任意のカラーPassを作成することの出来るノード』です。
各Attributeの説明はひとまず置いておくとして、実際の使い方を簡単にやってみたいと思います。
例によってMayaは2012の英語版。
サンプルシーンは下のようなもので、Materialはmia_material_x_passesに環境マップをコネクトしただけのシンプルなものです。
レンダリングすると一番右の画像のようになります。
また、出力ファイルフォーマットはOpenEXRの16bitHalfです。
マルチパスの場合はもはやOpenEXR一択でしょうか。
12_WriteToColor_01_Pic

このシーンに”WriteToColorBuffer”ノードを使って下のようなグラデーションのPassを追加してみようと思います。

①:出力用にPassを一つ作成します。

RenderSettingで”Custom Color”Passを作成します。作成したPassはAssociated Passesに降ろしておきましょう。あとでこのPassに”WriteToColorBuffer”をリンクさせます。
12_WriteToColor_02_CustomPass2

 

②:HypershadeでWriteToColorBufferノードと、Rampノードを一つずつ作成します。

mia_amterial_x_passes.result ?–> ?writeToColorBuffer.evaluationPassThrought
ramp.outColor ?–> ?writeToColorBuffer.color
こんな感じにコネクトします。
12_WriteToColor_03_Hypershade

③:Custom Color Passを設定

WriteToColorBufferノードの”Custom Color Pass”アトリビュートをに①で作成した”customColor”が追加されているので、それを選択します。
これで、WriteToColorBufferノードと”customColor”Passがリンクされます。

④:レンダリング

レンダリングすると、通常の”RGBA”に加え” customColor?”Passとして下の絵が出力されます。

 

こんな具合に、WriteToColorBufferノードとCustomColorPassをリンクさせてあげることで、任意のPassを作成する事ができます。

手順をざっくりまとめると、
①RenderSettingsで”Custom Color”Passを作成
②WriteToColorBufferノードを作成
③Pass出力したい要素をWriteToColorBufferにつっこむ
④WriteToColorBufferでリンクさせる”Custom Color”Passを指定
です。
簡単ですが、流れとしてはこんな感じです。
このノードを使うことで、Mayaで提供されていないようなPassも自由に作成することができます。
また、mentalrayマテリアルの場合は、Diffuse rawやDiffuse Levelなど、要素ごとにさらに細かくPassを出すこともできます。
そのへんはまた追々。

Mayaは2012の英語版を使用しています。
最新のバージョンとは異なる可能性がありますのであしからず。
次回は”WriteToColorBuffer”ノードのAttributeについて確認していきたいと思います。

関連記事

コメントをお待ちしております

このサイトについて

3DCG Tipsサイト。Houdiniの記事が多めです。

RSS

follow us in feedly

Archives

  • 2024 (1)
  • 2023 (2)
  • 2022 (9)
  • 2021 (14)
  • 2020 (46)
  • 2019 (17)
  • 2018 (33)
  • 2017 (29)
  • 2016 (36)
  • 2015 (64)
  • 2014 (54)
  • 2013 (60)
  • 2012 (55)

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

Houdiniを使えるようになる本


Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fnomoreretake.net%2F2012%2F09%2F10%2Fmaya_writetocolorbuffer_part01%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.b.st-hatena.com/entry.count?url=http%3A%2F%2Fnomoreretake.net%2F2012%2F09%2F10%2Fmaya_writetocolorbuffer_part01%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132