No More Retake

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

メニュー

Maya:『mib_color_mix』ノード

今回は”mib_color_mix”ノードをやります。

名前のとおり、カラーをミックスするノードです。最大8レイヤまでミックスできます。
ミックスする方法は加算や乗算など7つのモードから選べます。
基本となるベースカラーがあり、その上に重ねていきます。
layeredTextureノードと似たようなものと思えばいいのでは。
Attribute01

アトリビュートを見ていきましょう。

Num

ミックスする色の数です。指定した数だけレイヤが有効になります。ベースカラーは含まれません。たとえば、Num=1の場合、Mode0、Weight0、Color0が有効に、Num=3の場合はMode2、Weight2、Color2までが有効になります。

Mode

重ね方のモードです[Blend],[mix],[add],[bound add],[multiply],[bound multiply],[replace alpha]の全7種類です。詳しくは後述

Weight

ウェイト。ある意味、各レイヤのアルファチャンネルのようなもの

Color

Bloendするカラー。

Color Base

ベースカラー。この上に他のカラーがミックスされていきます。

Mode、Weight、Colorはそれぞれ0~7までナンバリングされており、それぞれの数字がレイヤに対応しています。たとえば、Mode0、Weight0、Color0で1セットですね。
あと、レイヤの重なる順番はBaseの上に0、1、2・・・7という順番。

では各Modeを確認して行きましょうかね。
検証にあたって下のようなサンプルシーンを用意しました。
Sample

テクスチャとしてこれも用意しました。
BaseLayerをColorBaseにLayer1をColor0にコネクトしました。layer1は丸くアルファを持っています。

[R]: 次の結果
[A]: 前の結果
[B]: 現在のカラー
[w]: 現在のウェイト[a]:アルファ

 

Blend

[R = A ・ (1 – Ba).・w + B・w] 上の式の通り。言葉で説明が難しいです。

Mix

R = A .・(1 – w)+ B・ w
うーん、これも上の式より分かりやすく言葉にできないw

 

Add

R = A + B .・w
これはイケる。加算。

 

bound Add

R =bound(A + B・ w, 0, 1)
範囲つき加算。加算の結果が、0~1(0~255)の範囲に制限されます。
普通のAddだと1より明るい白が可能だけど、bound Addだと1より明るい白はない。
16bit halfとか32bit floatとかのHDR画像で顕著に分かるのでは。

 

multiply

R = A .・(B ・ w)
乗算ですね。

 

bound multiply

R = bound(A . B・w, 0, 1)範囲つき乗算です。bound addの乗算版。

 

repalece

Rrgb = Argb ;  Ra = Ba
サンプルでいえばRGBはBaseLayerのをつかって、アルファはLayer1のをつかうということ。
ただ・・・つかったことがありません。

 

Mayaは2012の英語版を使用しています。
最新のバージョンとは異なる可能性がありますのであしからず。

関連記事

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

このサイトについて

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%2F11%2F26%2Fmaya_mib_color_mix%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%2F11%2F26%2Fmaya_mib_color_mix%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