R2 Shaders
|
Functions for variance shadows. More...
#include "R2LogDepth.h"
Go to the source code of this file.
Data Structures | |
struct | R2_shadow_variance_t |
A variance shadow. More... | |
Functions | |
float | R2_varianceChebyshevUpperBound (const R2_shadow_variance_t s, const vec2 moments, const float depth) |
float | R2_varianceLinearStep (const float min, const float max, const float x) |
float | R2_varianceLightBleedReduction (const R2_shadow_variance_t s, const float p_max) |
float | R2_varianceShadowFactor (const R2_shadow_variance_t s, const R2_light_projective_vectors_t v) |
Functions for variance shadows.
Definition in file R2ShadowVariance.h.
float R2_varianceChebyshevUpperBound | ( | const R2_shadow_variance_t | s, |
const vec2 | moments, | ||
const float | depth | ||
) |
Compute an upper bound on the probability that the position at depth
is in shadow.
s | The shadow |
moments | The sampled shadow map depth moments |
depth | The current depth |
0.0
and 1.0
, where 1.0 indicates that the area is certainly in shadow. Definition at line 38 of file R2ShadowVariance.h.
float R2_varianceLightBleedReduction | ( | const R2_shadow_variance_t | s, |
const float | p_max | ||
) |
Apply light bleed reduction to the given shadow probability.
s | The shadow |
p | The shadow probability |
p
with light bleed reduction applied Definition at line 79 of file R2ShadowVariance.h.
float R2_varianceLinearStep | ( | const float | min, |
const float | max, | ||
const float | x | ||
) |
A linear step function that maps all values less than min
to min
, all values greater than max
to max
, and linearly scales all values in [min, max]
to [min, max]
.
min | The minimum value |
max | The maximum value |
x | The value to scale |
Definition at line 61 of file R2ShadowVariance.h.
float R2_varianceShadowFactor | ( | const R2_shadow_variance_t | s, |
const R2_light_projective_vectors_t | v | ||
) |
Calculate a shadow factor for the given position.
s | The shadow |
v | The projective light vectors, including the position in various light coordinate spaces |
s.factor_minimum
if the point is fully in shadow, or 1.0
if the point is Definition at line 95 of file R2ShadowVariance.h.