Unity でのライトの使用は簡単です - 必要な種類のライトを作成 (例えば、メニューから GameObject > Light > Point Light を選択) し、シーン内の任意の場所に配置するだけです。シーンビューのライティングを有効にしてから (ツールバーの “電球” のボタン)、ライトオブジェクトを移動してパラメーターを設定すると、ライティングがどのように見えるかプレビューを確認できます。
ディレクショナルライトは、前方/Z 軸が方向を示すようにして、(クッキーを使用している場合を除いて) シーン内のどこにでも配置できます。スポットライトにも方向がありますが、範囲が限られているため、その位置は重要です。 スポットライト、ポイントライト、エリアライトの形状パラメーターは、Inspector から、またはシーンビューでライトのギズモを直接使用して調整できます。
ディレクショナルライトは太陽を表すことが多く、シーンの外観に大きな影響を与えます。そのライトの方向はわずかに下を向く必要がありますが、通常はシーン内の主要なオブジェクトに対してわずかな角度をなすようにする必要があります。例えば、ほぼ立方体のオブジェクトの場合、ライトがある面に真正面から当たっていないほうが、より興味深い陰影が付けられ、3D でより “飛び出して” 見えます。
スポットライトとポイントライトは通常人工的な光源に使用されるため、その位置は多くの場合シーンのオブジェクトによって決まります。これらのライトに関して良くある落とし穴は、単純にシーンに追加しただけでは何も効果が出ていないように見えることです。これは、光の範囲をシーン内にきれいに収まるように調整する場合に起こります。ライトの範囲とは、つまり光の輝度が弱まって 0 になる限界点です。例えば、スポットライトの円錐の底が床にぴったり落ちるように設定した場合、ライトの下を何か他のオブジェクトが通過しない限り、そのライトの効果はまったく得られないか、得られたとしてもほんのわずかです。レベルのジオメトリを証明したい場合は、ポイントライトやスポットライトの範囲を拡大して壁や床を通過するようにします。
光の色と強度 (輝度) は、Inspector から設定できるプロパティです。オブジェクトにシェーディングを付けるために使用する “通常の” ライティングには、初期値の強度と白色で事足りますが、特別な効果を作る場合にはプロパティを調整したい場合があります。例えば、緑に発光する力場は、周囲のオブジェクトを強い緑色の光で照らすのに十分な明るさにする必要があるかもしれません。あるいは、車のヘッドライト (特に古い車) は、真っ白というよりは少し黄色がかっているのが普通です。こういった効果にはポイントライトやスポットライトが最も多く使用されますが、例えばゲームが赤い太陽を持つ遠くの惑星を舞台にしている場合、ディレクショナル ライトの色を変更することもできます。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.