Shaders for Shadows
Shader code for rendering shadows of translucent occluders, soft shadows and single scattering with moment shadow maps.
 All Classes Files Functions Variables Pages
Functions
TrigonometricMomentProblemShadow.fx File Reference
#include "TrigonometricMomentProblemShadowAlgebra.fx"

Go to the source code of this file.

Functions

float GetWeightExclusive (float3 pWeight, float3x2 pRoot)
 
float3x2 MomentGeneratingFunction2 (float Point)
 
float3x2 MomentGeneratingFunction2 (float2 CirclePoint)
 
void Get2TMSMCanonicalDistribution (out float3 pOutWeight, out float3x2 pOutRoot, float2 pTrigonometricMoment[2], float PrescribedRoot)
 
float Get2TMSMCanonicalWeightExclusive (float2 pTrigonometricMoment[2], float PrescribedRoot)
 
void GetExtremalWeightHelpers2 (out float3x2 OutMomentEnd, out float3x2 OutInvertedMomentEnd, out float3x2 OutInvertedMomentOne, out float2 OutEndDotOne, out float OutOneDotOne, float2 pTrigonometricMoment[2], float IntervalEnd)
 
float4x2 GetWeightMapCriticalPoints (float3x2 MomentEnd, float3x2 InvertedMomentEnd, float2 EndDotOne, float OneDotOne, float2 pTrigonometricMoment[2], float IntervalEnd)
 
float GetMinimizingWeightAtOne (float2 pTrigonometricMoment[2], float IntervalEnd)
 
float Get2TMSMMinimalWeight (float2 pTrigonometricMoment[2], float IntervalEnd)
 
float CircleToParameter (float2 UnitCirclePoint)
 
float2 CircleToParameter (float2x2 UnitCirclePoint)
 
float3 CircleToParameter (float3x2 UnitCirclePoint)
 
float4 CircleToParameter (float4x2 UnitCirclePoint)
 
void CircleToParameter (out float pOutParameter[5], float2 pUnitCirclePoint[5])
 

Detailed Description

This header defines utility functions related to the trigonometric moment problem and its applications for shadow mapping.

Definition in file TrigonometricMomentProblemShadow.fx.

Function Documentation

float CircleToParameter ( float2  UnitCirclePoint)

Converts one or more points on the unit-circle to parameters identifying the location of these points on the circle. The parameter is guaranteed to increase monotonously as the point goes away from (1.0,0.0) in counter-clockwise direction.

Warning
Except for the mentioned guarantee no guarantees are made. In particular this function does not return an arclength parametrization! It should only be used to induce an order on points on the unit circle.

Definition at line 18 of file TrigonometricMomentProblemShadow.fx.

void Get2TMSMCanonicalDistribution ( out float3  pOutWeight,
out float3x2  pOutRoot,
float2  pTrigonometricMoment[2],
float  PrescribedRoot 
)

This function constructs the unique canonical distribution matching the given trigonometric moments and having the given root. It is assumed that the first and second moment are given and that the zeroth moment is one. It outputs the weights and the corresponding roots. The roots are given as points on the unit circle. The prescribed root has index zero.

Definition at line 75 of file TrigonometricMomentProblemShadow.fx.

float Get2TMSMCanonicalWeightExclusive ( float2  pTrigonometricMoment[2],
float  PrescribedRoot 
)

Computes the canonical distribution for the given moments and root (see Get2TMSMCanonicalDistribution()) and returns its total weight on the interval from 0.0 to PrescribedRoot excluding endpoints.

Definition at line 99 of file TrigonometricMomentProblemShadow.fx.

float Get2TMSMMinimalWeight ( float2  pTrigonometricMoment[2],
float  IntervalEnd 
)

This function computes a distribution realizing the given normalized, trigonometric moments and having a minimal weight on the open interval (0,IntervalEnd). This minimal weight is returned.

Definition at line 275 of file TrigonometricMomentProblemShadow.fx.

void GetExtremalWeightHelpers2 ( out float3x2  OutMomentEnd,
out float3x2  OutInvertedMomentEnd,
out float3x2  OutInvertedMomentOne,
out float2  OutEndDotOne,
out float  OutOneDotOne,
float2  pTrigonometricMoment[2],
float  IntervalEnd 
)

Computes various sizes which are needed by multiple functions dealing with optimization problems constrained by two normalized trigonometric moments.

Definition at line 127 of file TrigonometricMomentProblemShadow.fx.

float GetMinimizingWeightAtOne ( float2  pTrigonometricMoment[2],
float  IntervalEnd 
)

This function determines the weight that a distribution realizing the given normalized, trigonometric moments should have at one if it is to minimize the cumulative probability between zero and the given location.

Definition at line 192 of file TrigonometricMomentProblemShadow.fx.

float GetWeightExclusive ( float3  pWeight,
float3x2  pRoot 
)

This function computes the weight of the given distribution on the unit circle segment from one to root zero of the given distribution in counter-clockwise direction. Endpoints are excluded. Distributions are supposed to be given in the form in which Get2TMSMCanonicalDistribution() returns them.

Definition at line 42 of file TrigonometricMomentProblemShadow.fx.

float4x2 GetWeightMapCriticalPoints ( float3x2  MomentEnd,
float3x2  InvertedMomentEnd,
float2  EndDotOne,
float  OneDotOne,
float2  pTrigonometricMoment[2],
float  IntervalEnd 
)

This function computes critical points of a special weight map. If one of these points is used as point of support for a distribution matching the given normalized, trigonometric moments with weight at one, IntervalEnd and at most one additional point, the weight at the returned point is either undefined or extremal. The critical points are returned as points on the unit circle. The output of GetExtremalWeightHelpers2() has to be provided.

Definition at line 146 of file TrigonometricMomentProblemShadow.fx.

float3x2 MomentGeneratingFunction2 ( float  Point)

The function generating two trigonometric moments and the zeroth moment, i.e. row j is exp(2*pi*i*j*Point).

Definition at line 50 of file TrigonometricMomentProblemShadow.fx.

float3x2 MomentGeneratingFunction2 ( float2  CirclePoint)

Like MomentGeneratingFunction2(float) but expects the point on the unit circle instead of its scaled argument. Row j is CirclePoint^j.

Definition at line 61 of file TrigonometricMomentProblemShadow.fx.