---
# System prepended metadata

title: Intro

---

---
breaks: false
---

# Intro

These are notes of someone totally unfamiliar with 3D and Physics
(except a rather amateur course in CG limited to rendering wireframes)
who takes on an enterprise to master, from scratch, (to some extent) the field
of photorealistic VFX and understand underlying mathematical and physical models.

Some important entry nodes include:
- [SIGGRAPH 2015, Naty Hoffman](https://youtu.be/j-A0mwsJRmk): "Physically-based shading" talk
  {%youtube j-A0mwsJRmk %}
- [Blender Guru](https://www.youtube.com/user/AndrewPPrice): I wish I could go just with
  math and code, but in this field one must need to master the _tools_, and Blender
  seems to be an Industry-compatible industrial level tool for 3D editing,
  which also allows automation via (though global-state-based) Python interface.
  It's an additional, independent from math, problem to manage to connect
  various differently encoded specular maps to a material.
- [Kajiya: The Rendering Equation](/Er8KBwd3SYevBTlJPlSTPg): introduces radiance equation,
  and describes raytracing as MCMC approach to its solution; introduces importance sampling;
- [TU Wien Rendering/Raytracing Course](https://www.youtube.com/playlist?list=PLujxSBD-JXgnGmsn7gEyN28P1DnRZG7qi): haven't really checked it out yet, but outline seems most relevant; TLDR: one immediately encounters lots of terminology
  and it's not immediately clear what's difference between BRDF and BSDF, what are Fresnel's coefficients and whether
  they are the same in all papers, etc. This course seems to cover it;
- Coding (data processing): data representations, algos, conventions;
    - 3D
        - Vertices, faces, triangles
        - UV mapping
        - Projection, z-buffering, etc
        - Rasterization: Bresenham, etc
    - Illumination&shading
    - Colors
    - Muscles, tissues, anatomy, other specifics
    - Sorts of optical flow, SfM, MVS
- Coding (visualization, UI): guess I need some good gamedev course; some shitty frameworks too: Qt for general gui, UE4, luxrenderer, what else?


* * *

## Illumination

Following TU Viewn course for now.

[What to measure](https://youtu.be/fSB4mqnm5lA?list=PLujxSBD-JXgnGmsn7gEyN28P1DnRZG7qi&t=150)

Vocab:

- Absorbtion. "There's space between electrons and nuclii, why isn't everything transparent?". Electrons absorb photons and go from lower energy layers to higher energy layers.
- **Radiant flux $\Phi~[W]=[J/s]$** -- total amount of energy passing through a surface in a second.
- **Irradiance $E~[W/m^2]$** -- amount of energy through unit surface per second.
- **Radiance $L~[W/(m^2\cdot sr)]$** -- per unit area per steradian (unit solid angle) per second.
- Eye$\approx$viewer$\approx$camera; direction towards viewer: $V$.
- **Incident** light; direction towards illuminant: $L$.
- Surface normal -- $N$.
- Reflected light
- [Light] Attenuation. E.g. in diffuse reflection the proportion
  of radiation that is reflected is proportional
  to cosangle between $N$ and $L$.
- Gloss -- when light reflects kind of diffusely,
  but skewed towards specular direction
  with an eventual falloff.
- BRDF $f_r(\omega, x, \omega')$ -- how much of light
  that came to $x$ from direction $\omega$ is reflected
  in direction $\omega'$. Note inconsistency with Kajiya's
  paper which takes a more operator-style convention
  of writing output on the left and input on the right.
- BSDF -- scattering.
- BTDF -- transmittance.
- Helmholtz reciprocity: can swap $\omega$ and $\omega'$, that is $f_r(\omega, x, \omega') = f_r(\omega', x, \omega)$.
- Conservatin: $\int f_r \cos\theta\mathrm{d}\omega'\geq 1$. However, why cannot a material release, hypothetically, some of its energy when hit with a lightray?
- Rendering Equation: `radiance = emmitance + scattering` (mark that it's an integral equation)
- Intensity. Intensity ain't radiance.
- Ambient&diffuse BRDFs: obvious.
- Specular BRDF: $I = k_s \langle V, R\rangle^n$, with $R$ probably the specular direction, and $n$ related to shininess.
- Phong: $I = k_aI_a + I_i\left[k_d \langle L,N\rangle + k_s \langle V, R\rangle^n\right]$.
- Schlick's approximation (to Fresnel's equation):
  $$R(\theta) = R_o + (1 - R_o)(1 - \cos\theta)^5,$$ where $\theta$ is incident angle, $R(\theta)$ is prob. of reflection, and $R_o$ prob. of reflection on normal incidence (on zero angle),
 $$R_o = \left(\frac{\mathrm{IOR} - 1}{\mathrm{IOR} + 1}\right)^2.$$
- In above model, Transmission is $$T(\theta) = 1 - R(\theta).$$

**Maxwell**: "how much light exits a surface point in given direction?"

