Shaders for Shadows
Shader code for rendering shadows of translucent occluders, soft shadows and single scattering with moment shadow maps.
|
#include "ComplexAlgebra.fx"
Go to the source code of this file.
Functions | |
float2x2 | GetRoots (float3x2 pCoefficient) |
float3x2 | GetRoots (float4x2 pCoefficient) |
float4x2 | GetRoots (float2 pCoefficient[5]) |
float3 | GetRoots (float p, float q) |
float2 | Dot (float3x2 LHS, float3x2 RHS) |
float2 | Dot (float4x2 LHS, float4x2 RHS) |
float2 | Dot (float2 LHS[5], float2 RHS[5]) |
float3x2 | Multiply (float3x3 MatrixRealPart, float3x3 MatrixImaginaryPart, float3x2 RHSVector) |
float4x2 | Multiply (float4x4 MatrixRealPart, float4x4 MatrixImaginaryPart, float4x2 RHSVector) |
void | Multiply (out float2 OutProduct[5], float MatrixRealPart[5][5], float MatrixImaginaryPart[5][5], float2 RHSVector[5]) |
void | GetToeplitzInverse (out float3x3 OutToeplitzInverseReal, out float3x3 OutToeplitzInverseImaginary, float2 pTrigonometricMoment[2]) |
float3x2 | SolveToeplitzSystem (float2 TrigonometricMoment1, float2 TrigonometricMoment2, float2 RHS1, float2 RHS2) |
float | GetDeterminant (float2 pTrigonometricMoment[2]) |
This header defines advanced utility functions to deal with complex matrices and complex polynomials. It is specifically used for computing lower bounds to CDFs in trigonometric moment problems.
Definition in file TrigonometricMomentProblemShadowAlgebra.fx.
float2 Dot | ( | float3x2 | LHS, |
float3x2 | RHS | ||
) |
This function evaluates the standard Hermitian form of two complex vectors.
Definition at line 10 of file TrigonometricMomentProblemShadowAlgebra.fx.
float GetDeterminant | ( | float2 | pTrigonometricMoment[2] | ) |
This function returns the determinant of the Toeplitz matrix arising from the given normalized, trigonometric moments.
Definition at line 228 of file TrigonometricMomentProblemShadowAlgebra.fx.
float2x2 GetRoots | ( | float3x2 | pCoefficient | ) |
This function outputs the two roots of the specified quadratic polynomial. The complex number given by pCoefficient[j] is used as coefficient for the j-th power. No guarantees are made concerning the order of the output roots. Roots with multiplicity are output repeatedly.
Definition at line 64 of file TrigonometricMomentProblemShadowAlgebra.fx.
float3x2 GetRoots | ( | float4x2 | pCoefficient | ) |
Like float2x2 GetRoots(float3x2) but for cubic polynomials.
Definition at line 78 of file TrigonometricMomentProblemShadowAlgebra.fx.
float4x2 GetRoots | ( | float2 | pCoefficient[5] | ) |
Like float2x2 GetRoots(float3x2) but for quartic polynomials.
Definition at line 99 of file TrigonometricMomentProblemShadowAlgebra.fx.
float3 GetRoots | ( | float | p, |
float | q | ||
) |
This function computes all roots of the depressed cubic equation x^3+p*x+q=0 under the assumption, that it has three real roots (counting multiplicity).
Definition at line 146 of file TrigonometricMomentProblemShadowAlgebra.fx.
void GetToeplitzInverse | ( | out float3x3 | OutToeplitzInverseReal, |
out float3x3 | OutToeplitzInverseImaginary, | ||
float2 | pTrigonometricMoment[2] | ||
) |
Given an array consisting of normalized trigonometric moments (starting with the first moment) this function outputs the real part and imaginary part of the inverse of the corresponding Toeplitz matrix.
Definition at line 169 of file TrigonometricMomentProblemShadowAlgebra.fx.
float3x2 Multiply | ( | float3x3 | MatrixRealPart, |
float3x3 | MatrixImaginaryPart, | ||
float3x2 | RHSVector | ||
) |
Multiplies a complex valued vector by a complex valued matrix. The vectors are given as matrices with two columns where the first column holds the real part and the second column holds the imaginary parth. The matrix is given as two real matrices, one for the real part, the other for the imaginary part. Matrix multiplication is done from the right.
Definition at line 36 of file TrigonometricMomentProblemShadowAlgebra.fx.
float3x2 SolveToeplitzSystem | ( | float2 | TrigonometricMoment1, |
float2 | TrigonometricMoment2, | ||
float2 | RHS1, | ||
float2 | RHS2 | ||
) |
This function solves a linear system of the form Toeplitz*Result=RHS where Toeplitz is a Hermitian Toeplitz matrix with one on the diagonal and the given trigonometric moments below that in the first column. RHS is a complex row-vector where the first entry is one and the other two are given. Note that the Toeplitz matrix has to be positive definite. It returns Result.
Definition at line 200 of file TrigonometricMomentProblemShadowAlgebra.fx.