|
Photon Engine 2.0.0-beta
A physically based renderer.
|
Basic sampling routines. More...
#include "Math/math.h"#include <Common/assertion.h>#include <Common/primitive_type.h>#include <cstddef>#include <array>#include <utility>#include <type_traits>#include <climits>Go to the source code of this file.
Namespaces | |
| namespace | ph |
| The root for all renderer implementations. | |
| namespace | ph::math |
| Math functions and utilities. | |
Functions | |
| template<typename To , typename From , std::size_t N> | |
| std::array< To, N > | ph::math::sample_cast (const std::array< From, N > &sample) |
| template<typename T > | |
| bool | ph::math::pick (const T pickProbability, const T sample) |
| Randomly pick a branch with some probability. | |
| template<typename T > | |
| bool | ph::math::reused_pick (const T pickProbability, T &sample) |
| template<typename T , typename BitsType > | |
| T | ph::math::bits_to_sample (const BitsType &bits) |
Converts input bits to a sample. For standard unsigned integral types, this is effectively normalizing the integer value represented by bits into the range [0, 1]. | |
Basic sampling routines.
A "sample" is expected to be uniformly and randomly distributed in [0, 1].