UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SHMath.h File Reference
#include "CoreTypes.h"
#include "HAL/UnrealMemory.h"
#include "Math/Color.h"
#include "Math/MathFwd.h"
#include "Math/UnrealMathSSE.h"
#include "Math/UnrealMathUtility.h"
#include "Math/Vector.h"
#include "Math/Vector4.h"
#include "Math/VectorRegister.h"

Go to the source code of this file.

Classes

class  TSHVectorRGB< MaxSHOrder >
 

Typedefs

typedef TSHVector< 3 > FSHVector3
 
typedef TSHVector< 2 > FSHVector2
 
typedef TSHVectorRGB< 3 > FSHVectorRGB3
 
typedef TSHVectorRGB< 2 > FSHVectorRGB2
 

Functions

CORE_API float LegendrePolynomial (int32 L, int32 M, float X)
 
CORE_API FLinearColor SHGetLuminanceFactors ()
 
UE_FORCEINLINE_HINT int32 SHGetBasisIndex (int32 L, int32 M)
 
template<int32 Order>
class MS_ALIGN (16) TSHVector
 
 GCC_ALIGN (16)
 
template<int32 Order>
TSHVectorRGB< Order > operator* (const TSHVector< Order > &A, const FLinearColor &B)
 

Variables

CORE_API float NormalizationConstants [9]
 
CORE_API int32 BasisL [9]
 
CORE_API int32 BasisM [9]
 

Typedef Documentation

◆ FSHVector2

◆ FSHVector3

◆ FSHVectorRGB2

◆ FSHVectorRGB3

Function Documentation

◆ GCC_ALIGN()

GCC_ALIGN ( 16  )

◆ LegendrePolynomial()

CORE_API float LegendrePolynomial ( int32  L,
int32  M,
float  X 
)
extern

Evaluates the LegendrePolynomial for L,M at X

◆ MS_ALIGN()

template<int32 Order>
class MS_ALIGN ( 16  )

A vector of spherical harmonic coefficients.

The integral of the constant SH basis.

Default constructor.

Scalar multiplication operator.

Changed to float& from float to avoid LHS

Scalar division operator.

Addition operator.

Subtraction operator.

Dot product operator.

In-place addition operator.

Changed from (*this = *this + B;} to calculate here to avoid LHS

Now this avoids TSHVector + operator thus LHS on *this as well as Result and more

In-place subtraction operator.

Changed from (*this = *this - B;} to calculate here to avoid LHS

Now this avoids TSHVector - operator thus LHS on *this as well as Result and

In-place scalar division operator.

Changed to float& from float to avoid LHS

Changed from (*this = *this * (1.0f/B);) to calculate here to avoid LHS

Now this avoids TSHVector * operator thus LHS on *this as well as Result and LHS

In-place scalar multiplication operator.

Changed to float& from float to avoid LHS

Changed from (*this = *this * B;) to calculate here to avoid LHS

Now this avoids TSHVector * operator thus LHS on *this as well as Result and LHS

Calculates the integral of the function over the surface of the sphere.

Scales the function uniformly so its integral equals one.

Compute the direction which the spherical harmonic is highest at.

Returns the value of the SH basis L,M at the point on the sphere defined by the unit vector Vector.

The ambient incident lighting function.

◆ operator*()

template<int32 Order>
TSHVectorRGB< Order > operator* ( const TSHVector< Order > &  A,
const FLinearColor B 
)
inline

Color multiplication operator.

◆ SHGetBasisIndex()

UE_FORCEINLINE_HINT int32 SHGetBasisIndex ( int32  L,
int32  M 
)

Returns the basis index of the SH basis L,M.

◆ SHGetLuminanceFactors()

CORE_API FLinearColor SHGetLuminanceFactors ( )
extern

Variable Documentation

◆ BasisL

CORE_API int32 BasisL[9]
extern

◆ BasisM

CORE_API int32 BasisM[9]
extern

◆ NormalizationConstants

CORE_API float NormalizationConstants[9]
extern