프로퍼티 | 타입 | 설명 | |
---|---|---|---|
ALF | double | ||
EPS | double | ||
FACTORIAL | double[] | ||
ITMAX | int | ||
SQRT2 | double | ||
STPMX | double | ||
TOLX | double | ||
TOLY | double |
메소드 | 설명 | |
---|---|---|
BuildRotationMatrix ( |
Builds the matrix to apply the SH coefficients to make them rotate by the specified matrix
|
|
CartesianToSpherical ( |
Converts a cartesian UNIT vector into spherical coordinates (θ,ϕ)
|
|
ComputeClebschGordan ( int j1, int j2, int m1, int m2, int j, int m ) : double | ||
ComputeRotatedZHCoefficients ( double _ZHCoefficients, |
Computes the SH coefficients of originaly Y-aligned Zonal Harmonics coefficients rotated to match the provided axis Be careful the returned coefficients are SH coefficients, hence the _RotatedSHCoefficients vector should be N² if rotating an order N Zonal Harmonics vector |
|
ComputeSHWindowedCos ( int l, int m, double _θ, double _ϕ, int _Order ) : double | ||
ComputeSHWindowedSinc ( int l, int m, double _θ, double _ϕ, int _Order ) : double | ||
ComputeSigmaFactorCos ( int l, double h ) : double | ||
ComputeSigmaFactorCos ( int l, int _Order ) : double |
Sigma factor using a cardinal sine for windowing From "Real-time Soft Shadows in Dynamic Scenes using Spherical Harmonic Exponentiation" by Ren et al. (2006) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorCos( l ) * ComputeSH( l, m )
|
|
ComputeSigmaFactorSinc ( int l, int _Order ) : double |
Sigma factor using a cardinal sine for windowing From "A Quick Rendering Method Using Basis Functions for Interactive Lighting Design" by Dobashi et al. (1995) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorSinc( l ) * ComputeSH( l, m )
|
|
ComputeZH ( int l, double _θ ) : double | ||
ComputeZH ( int l, |
||
Convolve ( |
Computes the convolution of 2 3-vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the vectors' coefficients change |
|
EncodeIntoSH ( double _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSH _Delegate ) : void |
Encodes a function evaluated by the provided delegate into a series of ZH coefficients
|
|
EncodeIntoSH ( |
Encodes a function evaluated by the provided delegate into a series of ZH coefficients
|
|
EncodeIntoZH ( double _Coefficients, int _SamplesCount, int _RandomSeed, EvaluateFunctionZH _Delegate ) : void |
Attempts to encode a function evaluated by the provided delegate into a series of ZH coefficients
|
|
EvaluateSH ( double _Coefficients, double _θ, double _ϕ, int _Order ) : double |
Evaluates the amplitude encoded by the SH coefficients in the provided direction
|
|
EvaluateSH ( double _Coefficients, |
Evaluates the amplitude encoded by the SH coefficients in the provided direction
|
|
EvaluateZH ( double _Coefficients, double _θ ) : double |
Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction
|
|
EvaluateZH ( double _Coefficients, |
Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction
|
|
FilterGaussian ( float _SH, int w ) : void | ||
FilterGaussian ( |
||
FilterHanning ( float _SH, int w ) : void | ||
FilterHanning ( |
||
FilterLanczos ( float _SH, int w ) : void | ||
FilterLanczos ( |
||
InitializeSHCoefficients ( int _Order, double _θ, double _ϕ, double _Coefficients ) : void |
Initializes the provided vector with the SH coefficients corresponding to the specified direction
|
|
InitializeSHCoefficients ( int _Order, double _θ, double _ϕ, |
Initializes the provided vector with the SH coefficients corresponding to the specified direction
|
|
InitializeSHCoefficients ( int _Order, |
Initializes the provided vector with the SH coefficients corresponding to the specified direction
|
|
InitializeSHCoefficients ( int _Order, |
Initializes the provided vector with the SH coefficients corresponding to the specified direction
|
|
K ( int l, int m ) : double | ||
MapSHIntoZH ( double _SHCoefficients, int _Order, float2 _ZHAxes, double _ZHCoefficients, int _HemisphereResolution, int _FunctionSamplingResolution, double _BFGSConvergenceTolerance, double &_RMS, ZHMappingFeedback _Delegate ) : void |
Performs mapping of a set of SH coefficients into N sets of ZH coefficients WARNING: Takes hell of a time to compute !
|
|
MirrorY ( double _Vector, double _MirroredVector, int _Order ) : void |
Applies a simple mirroring on the Y axis
|
|
MirrorY ( |
Applies a simple mirroring on the Y axis
|
|
P ( int l, int m, double x ) : double | ||
P0 ( int l, double x ) : double | ||
Product3 ( double a, double b ) : double[] |
Computes the product of 2 SH vectors of order 3 (code from John Snyder "Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares")
|
|
ProductClebschGordan ( double _Vector0, double _Vector1, int _Order, ProductDelegate _Delegate ) : double[] |
Computes the product and re-projection in SH of 2 vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the SH vectors' coefficients change |
|
Rotate ( double _Vector, double _RotationMatrix, double _RotatedVector, int _Order ) : void |
Applies rotation to the specified SH vector using the specified rotation matrix yielded by the above "BuildRotationMatrix()" method
|
|
Rotate ( |
Applies rotation to the specified 3-vector using the specified rotation matrix returned by the "BuildRotationMatrix()" method
|
|
RotateY ( double _Vector, double _ϕ, double _RotatedVector, int _Order ) : void |
Applies a simple fast rotation about the Y axis
|
|
RotateY ( |
Applies a simple fast rotation about the Y axis
|
|
SphericalToCartesian ( double _θ, double _ϕ ) : |
Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector
|
|
SphericalToCartesian ( double _θ, double _ϕ, |
Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector
|
|
Ylm ( int l, int m, double _θ, double _ϕ ) : double | ||
Ylm ( int l, int m, |
메소드 | 설명 | |
---|---|---|
ComputeP ( int _a, int _b, int _i, int _l, double _Matrix ) : double |
Factored code used to compute U,V,W coefficients needed for rotation matrix inference
|
|
ComputeRho ( int j1, int j2, int j ) : double | ||
ComputeSigma ( int j1, int j2, int j, int m1, int m2, int m ) : double | ||
ComputeSummedDifferences ( SHSamplesCollection _SamplesCollection, double _Normalizer, double _GoalSHEvaluation, double _SHEstimate, int _Order ) : double |
Computes the square difference between a current SH estimate and a goal SH function given a set of samples
|
|
ComputeTau ( int j1, int j2, int j, int m1, int m2 ) : double | ||
Factorial ( int _Value ) : double |
Computes the factorial of the given integer value
|
|
ZHMappingGlobalFunctionEval ( double _Coefficients, object _Params ) : double | ||
ZHMappingGlobalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void | ||
ZHMappingLocalFunctionEval ( double _Coefficients, object _Params ) : double | ||
ZHMappingLocalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void | ||
dfpmin ( double _Coefficients, double _ConvergenceTolerance, int &_PerformedIterationsCount, double &_Minimum, BFGSFunctionEval _FunctionEval, BFGSFunctionGradientEval _FunctionGradientEval, object _Params ) : void |
Performs BFGS function minimzation on a quadratic form function evaluated by the provided delegate
|
|
lnsrch ( int n, double xold, double fold, double g, double p, double x, double &f, double stpmax, int &check, BFGSFunctionEval _FunctionEval, object _Params ) : void |
메소드 | 설명 | |
---|---|---|
Filter ( float _SH, int l, float a ) : void | ||
Filter ( |
||
Ylm ( |
Computes the 9 Ylm coefficients for order 2 SH evaluated in the requested direction
|
public static BuildRotationMatrix ( |
||
_Rotation | The 3x3 rotation matrix to infer the SH rotation matrix from | |
_Matrix | double | The resulting _Order² x _Order² rotation matrix |
_Order | int | The order of the SH vectors that will be rotated using the matrix |
리턴 | void |
public static CartesianToSpherical ( |
||
_Direction | The cartesian unit vector to convert | |
_θ | double | The polar elevation |
_ϕ | double | The azimuth |
리턴 | void |
public static ComputeClebschGordan ( int j1, int j2, int m1, int m2, int j, int m ) : double | ||
j1 | int | |
j2 | int | |
m1 | int | |
m2 | int | |
j | int | |
m | int | |
리턴 | double |
protected static ComputeP ( int _a, int _b, int _i, int _l, double _Matrix ) : double | ||
_a | int | |
_b | int | |
_i | int | |
_l | int | |
_Matrix | double | The source rotation matrix |
리턴 | double |
protected static ComputeRho ( int j1, int j2, int j ) : double | ||
j1 | int | |
j2 | int | |
j | int | |
리턴 | double |
public static ComputeRotatedZHCoefficients ( double _ZHCoefficients, |
||
_ZHCoefficients | double | The ZH coefficients to rotate |
_TargetAxis | The target axis to match (the original axis being positive Y) | |
_RotatedSHCoefficients | double | The rotated SH coefficients |
리턴 | void |
public static ComputeSHWindowedCos ( int l, int m, double _θ, double _ϕ, int _Order ) : double | ||
l | int | |
m | int | |
_θ | double | |
_ϕ | double | |
_Order | int | |
리턴 | double |
public static ComputeSHWindowedSinc ( int l, int m, double _θ, double _ϕ, int _Order ) : double | ||
l | int | |
m | int | |
_θ | double | |
_ϕ | double | |
_Order | int | |
리턴 | double |
protected static ComputeSigma ( int j1, int j2, int j, int m1, int m2, int m ) : double | ||
j1 | int | |
j2 | int | |
j | int | |
m1 | int | |
m2 | int | |
m | int | |
리턴 | double |
public static ComputeSigmaFactorCos ( int l, double h ) : double | ||
l | int | |
h | double | |
리턴 | double |
public static ComputeSigmaFactorCos ( int l, int _Order ) : double | ||
l | int | Current band |
_Order | int | Max used SH order |
리턴 | double |
public static ComputeSigmaFactorSinc ( int l, int _Order ) : double | ||
l | int | Current band |
_Order | int | Max used SH order |
리턴 | double |
protected static ComputeSummedDifferences ( SHSamplesCollection _SamplesCollection, double _Normalizer, double _GoalSHEvaluation, double _SHEstimate, int _Order ) : double | ||
_SamplesCollection | SHSamplesCollection | The collection of samples to use for the computation |
_Normalizer | double | The normalizer for the final result |
_GoalSHEvaluation | double | The goal SH function's evaluations for each sample |
_SHEstimate | double | The estimate SH function's coefficients |
_Order | int | The SH order |
리턴 | double |
protected static ComputeTau ( int j1, int j2, int j, int m1, int m2 ) : double | ||
j1 | int | |
j2 | int | |
j | int | |
m1 | int | |
m2 | int | |
리턴 | double |
public static ComputeZH ( int l, double _θ ) : double | ||
l | int | |
_θ | double | |
리턴 | double |
public static ComputeZH ( int l, |
||
l | int | |
_Direction | ||
리턴 | double |
public static Convolve ( |
||
_Vector0 | First 3-vector | |
_Vector1 | Second 3-vector | |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | SharpMath.float3[] |
public static EncodeIntoSH ( double _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSH _Delegate ) : void | ||
_Coefficients | double | The coefficients supposed to best fit the provided function (the length of the vector must be _Order²) |
_SamplesCountTheta | int | |
_SamplesCountPhi | int | |
_RandomSeed | int | The random seed to initialize the RNG with when drawing random sample position |
_Order | int | The order of the SH vector to encode |
_Delegate | EvaluateFunctionSH | The delegate that will be called to evaluate the function to encode |
리턴 | void |
public static EncodeIntoSH ( |
||
_Coefficients | The coefficients supposed to best fit the provided function (the length of the vector must be _Order²) | |
_SamplesCountTheta | int | |
_SamplesCountPhi | int | |
_RandomSeed | int | The random seed to initialize the RNG with when drawing random sample position |
_Order | int | The order of the SH vector to encode |
_Delegate | EvaluateFunctionSHVector3 | The delegate that will be called to evaluate the function to encode |
리턴 | void |
public static EncodeIntoZH ( double _Coefficients, int _SamplesCount, int _RandomSeed, EvaluateFunctionZH _Delegate ) : void | ||
_Coefficients | double | The coefficients supposed to best fit the provided function (the length of the vector will also provide the ZH/SH order) |
_SamplesCount | int | The amount of samples to use to fit the function |
_RandomSeed | int | The random seed to initialize the RNG with when drawing random sample position |
_Delegate | EvaluateFunctionZH | The delegate that will be called to evaluate the function to encode |
리턴 | void |
public static EvaluateSH ( double _Coefficients, double _θ, double _ϕ, int _Order ) : double | ||
_Coefficients | double | The SH coefficients encoding an amplitude in various directions |
_θ | double | The elevation of the direction of the SH sampling |
_ϕ | double | The azimuth of the direction of the SH sampling |
_Order | int | The order of the SH vector |
리턴 | double |
public static EvaluateSH ( double _Coefficients, |
||
_Coefficients | double | The SH coefficients encoding an amplitude in various directions |
_Direction | The direction where to evalute the SH | |
_Order | int | The order of the SH vector |
리턴 | double |
public static EvaluateZH ( double _Coefficients, double _θ ) : double | ||
_Coefficients | double | The SH coefficients encoding an amplitude in various directions |
_θ | double | The elevation of the direction of the ZH sampling |
리턴 | double |
public static EvaluateZH ( double _Coefficients, |
||
_Coefficients | double | The SH coefficients encoding an amplitude in various directions |
_Direction | The direction where to evalute the ZH | |
리턴 | double |
protected static Factorial ( int _Value ) : double | ||
_Value | int | The value to compute the factorial of |
리턴 | double |
public static FilterGaussian ( float _SH, int w ) : void | ||
_SH | float | |
w | int | |
리턴 | void |
public static FilterGaussian ( |
||
_SH | ||
w | int | |
리턴 | void |
public static FilterHanning ( float _SH, int w ) : void | ||
_SH | float | |
w | int | |
리턴 | void |
public static FilterHanning ( |
||
_SH | ||
w | int | |
리턴 | void |
public static FilterLanczos ( float _SH, int w ) : void | ||
_SH | float | |
w | int | |
리턴 | void |
public static FilterLanczos ( |
||
_SH | ||
w | int | |
리턴 | void |
public static InitializeSHCoefficients ( int _Order, double _θ, double _ϕ, double _Coefficients ) : void | ||
_Order | int | The order of the SH vector |
_θ | double | The elevation of the direction of the SH sampling |
_ϕ | double | The azimuth of the direction of the SH sampling |
_Coefficients | double | The array of coefficients to fill up |
리턴 | void |
public static InitializeSHCoefficients ( int _Order, double _θ, double _ϕ, |
||
_Order | int | The order of the SH vector |
_θ | double | The elevation of the direction of the SH sampling |
_ϕ | double | The azimuth of the direction of the SH sampling |
_Coefficients | The array of coefficients to fill up | |
리턴 | void |
public static InitializeSHCoefficients ( int _Order, |
||
_Order | int | The order of the SH vector |
_Direction | The direction of the SH sampling | |
_Coefficients | double | The array of coefficients to fill up |
리턴 | void |
public static InitializeSHCoefficients ( int _Order, |
||
_Order | int | The order of the SH vector |
_Direction | The direction of the SH sampling | |
_Coefficients | The array of coefficients to fill up | |
리턴 | void |
public static MapSHIntoZH ( double _SHCoefficients, int _Order, float2 _ZHAxes, double _ZHCoefficients, int _HemisphereResolution, int _FunctionSamplingResolution, double _BFGSConvergenceTolerance, double &_RMS, ZHMappingFeedback _Delegate ) : void | ||
_SHCoefficients | double | The SH coefficients to map into ZH |
_Order | int | The order of the SH coefficients vector |
_ZHAxes | float2 | The double array of resulting ZH axes (i.e. [θ,ϕ] couples) |
_ZHCoefficients | double | The double array of resulting ZH coefficients (the dimension of the outter array gives the amount of requested ZH lobes while the dimension of the inner arrays should be of size "_Order") |
_HemisphereResolution | int | The resolution of the hemisphere used to perform initial guess of directions (e.g. using a resolution of 100 will test for 20 * (4*20) possible lobe orientations) |
_FunctionSamplingResolution | int | The resolution of the sphere used to perform function sampling and measuring the error (e.g. using a resolution of 100 will estimate the function with 100 * (2*100) samples) |
_BFGSConvergenceTolerance | double | The convergence tolerance for the BFGS algorithm (the lower the tolerance, the longer it will compute) |
_RMS | double | The resulting array of RMS errors for each ZH lobe |
_Delegate | ZHMappingFeedback | An optional delegate to pass the method to get feedback about the mapping as it can be a lengthy process (!!) |
리턴 | void |
public static MirrorY ( double _Vector, double _MirroredVector, int _Order ) : void | ||
_Vector | double | The vector to mirror |
_MirroredVector | double | The mirrored vector |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static MirrorY ( |
||
_Vector | The vector to mirror | |
_MirroredVector | The mirrored vector | |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static Product3 ( double a, double b ) : double[] | ||
a | double | |
b | double | |
리턴 | double[] |
public static ProductClebschGordan ( double _Vector0, double _Vector1, int _Order, ProductDelegate _Delegate ) : double[] | ||
_Vector0 | double | First vector |
_Vector1 | double | Second vector |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
_Delegate | ProductDelegate | |
리턴 | double[] |
public static Rotate ( double _Vector, double _RotationMatrix, double _RotatedVector, int _Order ) : void | ||
_Vector | double | The vector to rotate |
_RotationMatrix | double | The SH rotation matrix |
_RotatedVector | double | The rotated vector |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static Rotate ( |
||
_Vector | The 3-vector to rotate | |
_RotationMatrix | double | The SH rotation matrix |
_RotatedVector | The rotated vector | |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static RotateY ( double _Vector, double _ϕ, double _RotatedVector, int _Order ) : void | ||
_Vector | double | The vector to rotate |
_ϕ | double | The rotation angle |
_RotatedVector | double | The rotated vector |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static RotateY ( |
||
_Vector | The vector to rotate | |
_ϕ | double | The rotation angle |
_RotatedVector | The rotated vector | |
_Order | int | The order of the vectors (i.e. vectors must have a length of Order²) |
리턴 | void |
public static SphericalToCartesian ( double _θ, double _ϕ ) : |
||
_θ | double | The polar elevation |
_ϕ | double | The azimuth |
리턴 |
public static SphericalToCartesian ( double _θ, double _ϕ, |
||
_θ | double | The polar elevation |
_ϕ | double | The azimuth |
_Direction | The unit vector in cartesian coordinates | |
리턴 | void |
public static Ylm ( int l, int m, double _θ, double _ϕ ) : double | ||
l | int | |
m | int | |
_θ | double | |
_ϕ | double | |
리턴 | double |
public static Ylm ( int l, int m, |
||
l | int | |
m | int | |
_Direction | ||
리턴 | double |
protected static ZHMappingGlobalFunctionEval ( double _Coefficients, object _Params ) : double | ||
_Coefficients | double | |
_Params | object | |
리턴 | double |
protected static ZHMappingGlobalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void | ||
_Coefficients | double | |
_Gradients | double | |
_Params | object | |
리턴 | void |
protected static ZHMappingLocalFunctionEval ( double _Coefficients, object _Params ) : double | ||
_Coefficients | double | |
_Params | object | |
리턴 | double |
protected static ZHMappingLocalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void | ||
_Coefficients | double | |
_Gradients | double | |
_Params | object | |
리턴 | void |
protected static dfpmin ( double _Coefficients, double _ConvergenceTolerance, int &_PerformedIterationsCount, double &_Minimum, BFGSFunctionEval _FunctionEval, BFGSFunctionGradientEval _FunctionGradientEval, object _Params ) : void | ||
_Coefficients | double | The array of initial coefficients (indexed from 1!!) that will also contain the resulting coefficients when the routine has converged |
_ConvergenceTolerance | double | The tolerance error to accept as the minimum of the function |
_PerformedIterationsCount | int | The amount of iterations performed to reach the minimum |
_Minimum | double | The found minimum |
_FunctionEval | BFGSFunctionEval | The delegate used to evaluate the function to minimize |
_FunctionGradientEval | BFGSFunctionGradientEval | The delegate used to evaluate the gradient of the function to minimize |
_Params | object | Some user params passed to the evaluation functions |
리턴 | void |
protected static lnsrch ( int n, double xold, double fold, double g, double p, double x, double &f, double stpmax, int &check, BFGSFunctionEval _FunctionEval, object _Params ) : void | ||
n | int | |
xold | double | |
fold | double | |
g | double | |
p | double | |
x | double | |
f | double | |
stpmax | double | |
check | int | |
_FunctionEval | BFGSFunctionEval | |
_Params | object | |
리턴 | void |