Light emitters can take whatever form you like since, ultimately, the effect of
a light is something computed in the vertex or fragment shading. That said,
there are a few different common forms of lights used in applications. The
simplest is called a directional light. This type of light is defined by just
that, a direction vector. A directional light is something like the sun. The
direction to the sun is essentially the same for every object on earth, and a
directional light is considered infinitely far away. In many modelers, such as
the 3JS editor here, the directional light will be shown as some local point
that you can move around. However, you're truly manipulating the direction, not
the location of the light. Since we often combine colors in various ways,
there's not necessarily an upper limit of 1.0 to a color channel. It all
depends. For example, if I want a clear the screen, I would want to use values
from zero to one. There's an upper limit of each channel's intensity, so values
larger than 1.0 are beyond the monitor's abilities. However, if I wanted to
make the light bright, I might set its intensity to 11. When the distance from
the light to the object and the object's color are taken into account, the
final color may well be within the zero to one range. In some systems, you can
even set the light intensity to a negative number, meaning the light is somehow
sucking photons from the surface. The light's color is just a number in an
equation after all. This is true for a material's color too, that it could be
set however you want, but we tend to leave material colors between zero and
one, thinking of them as reflectivities. These basic illumination equations are
not based on any physical unit, such as watts or lumens, but rather are set in
the zero to one range for our convenience.
ライトの形態は好きなように選べます
ライトの効果とはシェーダで行われる
計算の結果に過ぎないからです
ライトにはいくつか種類があります
最もシンプルなものは平行光源です
方向ベクトルが平行なライトのことです
太陽のように地球上のすべての物を
同じ方向から照らします
平行光源は無限遠から差すライトだと考えてください
three.jsエディタを含む多くのモデラにおいて
平行光源は自由に動かせる点として表されます
しかし操作するのは
ライトの方向であって位置ではありません
色を混ぜる手法は様々で
色の最大値は必ずしも1.0ではありません
例えばスクリーンをきれいにしたいときは
0.0~1.0の値を使用します
各色の最大値は決まっているので
1.0より大きな値はモニタには反映されません
しかしライトを明るくしたい場合は値を11にします
ライトからの距離とオブジェクトの色が考慮され
最終的に0.0~1.0の間に収まるでしょう
ライトの強度を負の値にできる場合もあります
ライトが表面から光子を吸収している形です
ライトの色は方程式中の数字に過ぎません
マテリアルの色も同様です
値は何でも構いませんが大抵は0.0~1.0にします
反射率だと考えてください
ライトの方程式はワットやルーメンなどの
実際の単位によるものではなく
便宜的に0.0~1.0の間で設定されています
光的發射體可以是任何形式
光的效果終究會到 Vertex 或 Fragment Shader 計算
但應用程式面有幾種光的常用的形式
最簡單的是定向光(Directional light)
這種光只由一個方向向量定義
定向光是像太陽的光源
對地球上所有物件來說到太陽的方向都是一樣的
定向光被認為是距離無窮遠
許多模型編輯器,像是這個 Three.js 編輯器
定向光顯示成一個點,你可以拖曳移動
但是你操作的實際上是光的方向,不是位置
因為我們用不同方式合併顏色,所以顏色通道不一定有 1.0 上限
都是看情況
如果我要顯示在螢幕上,我會用 0.0 到 1.0 範圍
各通道有強度上限,超過 1.0 的值就超越了螢幕的顯示能力
但如果我想要讓光變亮,我可能會把強度設到 11
經過光到物件的距離衰減跟物件本身顏色的計算
最後顏色結果可能落在 0.0 到 1.0 之間
有些系統甚至能將光強度設為負數
代表光以某種方式從場景中吸走光子
畢竟光的顏色強度只是計算公式上的一項
材質顏色也能像這樣隨意設定
但我們傾向設定在 0.0 到 1.0 之間,像是當作反射率(Reflectivity)
這些基礎照明公式沒有參考現實物理單位像是瓦跟流明
而是為了我們的方便壓縮在 0.0 到 1.0 範圍