ray.h file
Optical depth and Beer attenuation on one segment.
A segment, not a tracer. Transmission is $e^{-\tau}$. Optical depth above the documented cutoff returns 0 transmission without a denormal.
Functions
-
auto vm_ray_tau(vm_
float_ t kappa, vm_ float_ t s) -> vm_ float_ t - Optical depth of a uniform segment,
$\tau = \kappa s$. -
auto vm_ray_tau_sum(const vm_
float_ t* kappa, const vm_ float_ t* s, int n) -> vm_ float_ t - Piecewise optical depth, sum of
$\kappa_k s_k$. -
auto vm_ray_transmit(vm_
float_ t tau) -> vm_ float_ t - Beer transmission
$e^{-\tau}$. -
auto vm_ray_emit(vm_
float_ t tau, vm_ float_ t B) -> vm_ float_ t - Emission integral along a uniform segment,
$(1 - e^{-\tau}) B$.
Defines
- #define VM_RAY_TAU_CUTOFF
- Cutoff above which transmission is returned as 0.
Function documentation
vm_ float_ t vm_ray_tau(vm_ float_ t kappa,
vm_ float_ t s)
Optical depth of a uniform segment, $\tau = \kappa s$.
| Parameters | |
|---|---|
| kappa | Opacity. |
| s | Segment length. |
| Returns | Optical depth. Negative inputs return 0. |
vm_ float_ t vm_ray_tau_sum(const vm_ float_ t* kappa,
const vm_ float_ t* s,
int n)
Piecewise optical depth, sum of $\kappa_k s_k$.
| Parameters | |
|---|---|
| kappa | Opacity of each piece; length n. |
| s | Length of each piece; length n. |
| n | |
| Returns | Sum of the piece optical depths. |
vm_ float_ t vm_ray_transmit(vm_ float_ t tau)
Beer transmission $e^{-\tau}$.
| Parameters | |
|---|---|
| tau | Optical depth. |
| Returns | Transmission. tau <= 0 returns 1. tau above VM_ returns 0. |
vm_ float_ t vm_ray_emit(vm_ float_ t tau,
vm_ float_ t B)
Emission integral along a uniform segment, $(1 - e^{-\tau}) B$.
| Parameters | |
|---|---|
| tau | Optical depth. |
| B | Source radiance. |
| Returns | Emission. A long segment approaches B. |
Define documentation
#define VM_RAY_TAU_CUTOFF
Cutoff above which transmission is returned as 0.
exp(-tau) underflows for large tau. Values above this cutoff return 0 transmission.