記事一覧
Classic 3D Rendering 古典的 3D レンダリング
昔から使われている古典的な3Dレンダリングの手法を見てみましょう。今から見れば性能が低いコンピュータでも計算できるようにかなり単純化されていますが、その分とりつき安いと思います。また作りたい物によってはこのページのテクニックも十分現役で役に立ちます。
Let's take a look at classic 3D rendering techniques that have been around
Specular reflections and diffuse light鏡面反射と拡散光
水やガラスなどの透明な素材を除くと私たちは主に物体の表面で跳ね返った光を見ているこのになります。この現象は大きくスペキュラー(鏡面反射)とディフューズ(拡散光)の2つに分けることができ、また物質は導体(Conductor)と誘電体 (Dielectric)に分けて考えることができます。
Except for transparent materials such as water and glass
Reflection and Refraction 反射と屈折
When light hits an object, some of it penetrates the object while the rest is reflected.
光は何か物体に当たると一部は中に進んで行き、残りは反射します。
Reflection 反射
When light is reflected, the angle of incidence and the angle of
Computing Colors 色を計算する
カラーモデルにはそれぞれ特徴があるので、行いたい操作によってモデルを選ぶようにしましょう。このページではいくつか例をあげてみます。
Each color model has its own characteristics, and it is useful to choose a model according to the operation you want to perform. Below
Various Color Models 様々なカラーモデル
RGB on devices
デバイス上でのRGB
The values we usually use on devices and in coding can be thought of as a specific range that can be reproduced on the actual device cut out from the XYZ color space.
デバイス上やコ
CIE Color spaces CIE色空間
CIE XYZ color space
CIE XYZ色空間
可視光による刺激と、人間が知覚する色との関係を初めて定量的な結びつけたのがCIE色空間です。
The CIE color spaces were the first to quantitatively link the relationship between visible light stimuli and colors perce
Spectrum and Cones スペクトルと錐体
Spectral distribution スペクトル分布光源はそれぞれ異なる波長毎のエネルギー分布を持っていて、この特性を「スペクトル分布」と呼びます。下の絵は異なる光源を比べた例です。白熱電球は蛍光灯やLEDよりも黄色やオレンジがかって見え、熱も発生しますが、グラフを見ると確かに青側よりも赤側の成分やその下の赤外線が多く含まれていることがわかります。
Each light source has
What is light? 光とは何か
Electromagnetic radiation 電磁波光は人間が見ることができる電磁波の一種です。人間に見える可視光線は、電磁波のごく一部で、その他にも電波、マイクロ波、赤外線、紫外線、X線、ガンマ線などの種類があります。電磁波の種類は周波数によって分けられていて、それによって物質にどう影響するかが異なります。
Light is a type of electromagnetic radiat
Pitch and Frequency 音高と周波数
音は、固体、液体、気体などの媒体を伝わる振動です。高い音は高い周波数に対応し、低い音は低い周波数に対応します。周波数はヘルツ(Hz)という単位で測られます。1ヘルツは、ある事象が1秒間に1回繰り返されることを意味し、波の場合は1秒間に1回振動することを表します。
Sound is a vibration that travels through a medium such as a solid,
Sine waves and Additive Synthesis サイン波と加算合成
もう一度サイン波を見てみましょう。このようにプロットすると、三角関数との関係が明確になります。
Let's look at the sine wave again. Plotting it this way makes the relationship to the trigonometric functions clearer.
Waves can be added together. Add
Direction of the waves 波の向き
波を描くときに一番普通なのはこんな形でしょう。これはサインカーブと呼ばれていてサイン関数をグラフにしたものです。
This is probably the most common shape when drawing a wave. This is called a sine curve and is a graphical representation of the sine function.
Signed distance functions 符号付き距離関数
「符号付き距離関数」(“Signed distance functions”、略してSDF)とは怖そうな名前ですが、実は割とシンプルです。SDFとは、ある点がある他の形の表面、例えば球面から(通常ユークリッド空間で)どのくらい離れているかを教えてくれる関数です。
“Signed distance functions”, or SDF sounds scary but it is not too c
Visualizing Distances 距離を視覚化する
GLSLを使って距離を視覚化してみます。画面の中心からの距離を元に等高線のような白黒の縞模様を描きました。GLSLについての技術的な説明は The Book of Shaders に譲るとして、ここでは距離を定義する式だけに注目しましょう。
Let's visualize distances using GLSL. A black-and-white stripe pattern like a c