vimwiki/tech/light_transport.wiki

130 lines
3.5 KiB
Plaintext

= Light transport =
== Radiometry recap ==
What is radiant flux?
* total amount of energy passing through a surface (measured per second)
* Radiant flux in Watts or Joules/second
=== Why do we not use radiant flux? ===
* When we emasure a high flux val, we dont know if lots of energy through a
small surface, or a little energy through a huge surface
* TLDR its to ambiguous
New unit irradiance
* Flux per unit area
* IE Watt/m^2
=== Why do we not use irradiance? ===
We know the surface, but we still need an angle
* Could be lost of energy in a huge angle
* little energy in a small angle
New unit Radiance
* Flux per unit area angle
* W / (m^2 * radians)
== Basic question ==
How do we calculate how much light exits a surface point in a given direction
[[maxwell_equations|Maxwell equations]]!
In practive, we dont do that. We try to think of light as a ray unless we have
to
Instead we use the rendering equation!
Terms used in diagrams
* V - direction towards the viewer
* N - surface normal
* L - vector pointing towards the light source
* R - reflected ray direction
* Theta,,i,, and Theta,,r,, - incident and reflected angles
To calcuate R `R = L - 2N(L * N)`
== Light attentuation ==
* The amount of intensity light looses as it travels farther away. Light looses
energy as well as it reflects off of surfaces
* How can we calculate attentuation?
`L * N`
Assuming that L and N are normalized, the attentuation will be equal to
`cos(theta)` where theta is the angle between L and N. This is true because of
the dot product.
== Materials ==
How can we simluate the look of different materials?
Based on how they relfect light.
* Specular surface reflects exactly one ray
* One incoming direction
* One outgoing direction
* Diffuse spreads ray into smaller rays in all directions
* On incoming direction
* many outgoing direction
* many outgoing intesntiy
* Spread breaks out the ray into a few smaller rays in a single direction
To simulate a surface, we can use a probability density function that takes
* incoming light direction
* point on surface
This method will output the _probability of a given outward direction_
Something like `probability of happening = f(incoming direction, point, outgoing direction)`.
This is known as the _Bidirectional reflectance distribution function (BRDF)_.
What about materials that reflect some light allow some right through
(transmitted).
Properties of a transparent material
* Helmholtz-reciprocity
* direction of the ray of light can be reveresd
* This means the odds of the light bouncing from A to B are the same as the
odds of boucing B to A
* Positivity
* It is impossible for an exit direction to have a negative probability
* Energy conservation
* An object may reflect OR absorb incoming light, but no more light can come
out than the incoming amount
== Rendering equation ==
Sum of all light reflections and absorbtions at a point
Note that an object can emit light itself. It also receives light from
different directions, which it will either reflect or absorb. Therefore
`Light exiting = Emitted light + reflected incoming light`
AKA
{{{
Light output(x, vector w) = Light emitted(x, vector w)
+ Integral of (Light incoming to x from vector w * BRFD(vector w, x vector w
prime) cos theta dw
}}}
Problems with above
* The exitant radiance of a point x depends on the incoming radiance of every
other point, which also depends on x
* We cannot solve this integral in closed form
* The integral is infinite dimensional
* It is singular
We simply dont know enough to even start