You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$w=[wx,wy,wz]$ - camera vertical normalized vector which idicates where is up and were is down (not shown on picture, usually equal [0,1,0]).
$\theta \in [0,\pi)$ - field of view (slacar value, for human eye $\approx 90^\circ$)
$k$ - number of pixels on screen width
$m$ - number of pixels screen in height
IDEA: lets find position of center of each pixel $P_{ij}$ which allows us to easily find ray which starts at $E$ and go thought that pixel. To do it we find first $P_{1m}$ and find others by move on vievports plane.
ASSUMPTION: $d=1$ which simplify calculations but not change the result (because $r_{ij}$ is normalized and viewport size is determined by $k,m$ and $\theta$)
PRECALCULATIONS: First we calculate normalized vectors $v_n, b_n$ from picutre (which are parallel to viewport plane and give as direction for shifting)
Ray marching is used to calculate color/light of each ray (pixel). To do it we use distance function which is central concept of raymarching technique. Distance function is very simple -
Step 1.
The source of above four pictures and animation cames from JAmstrong article.