-
Notifications
You must be signed in to change notification settings - Fork 241
SHMath
This is an implementation of the original D3DXMath library spherical harmonics math functions using DirectXMath.
See this blog post for more information and details.
All functions are in the C++ namespace DirectX
Evaluates the Spherical Harmonic basis functions. Equivalent to D3DXSHEvalDirection function.
Rotates SH vector by a rotation matrix. Equivalent to the D3DXSHRotate function.
Rotates the SH vector in the Z axis by an angle. Equivalent to the D3DXSHRotateZ function.
Adds two SH vectors. Equivalent to the D3DXSHAdd function.
Scales a SH vector. Equivalent to the D3DXSHScale function.
Computes the dot product of two SH vectors. Equivalent to the D3DXSHDot function.
Computes the product of two functions represented using SH. Equivalent to D3DXSHMultiply2, D3DXSHMultiply3, D3DXSHMultiply4, D3DXSHMultiply5, and D3DXSHMultiply6.
Evaluates a directional light and returns spectral SH data. Equivalent to the D3DXSHEvalDirectionalLight function.
Evaluates a spherical light and returns spectral SH data. Equivalent to the D3DXEvalSphericalLight function.
Evaluates a light that is a cone of constant intensity and returns spectral SH data. Equivalent to the D3DXSHEvalConeLight function.
Evaluates a light that is a linear interpolant between two colors over the sphere. Equivalent to the D3DXSHEvalHemisphereLight function.
Projects a function represented in a cube map into spherical harmonics. Equivalent to the D3DX11SHProjectCubeMap function.
For DirectX 11, you must do
#include <d3d11.h>
before#include <DirectXSH.h>
.
For DirectX 12, you must do
#include <d3d12.h>
before#include <DirectXSH.h>
.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- GCC 10.5, 11.4, 12.3
- MinGW 12.2, 13.2
- Intel Classic Compiler
- Intel oneAPI Compiler
DirectX Tool Kit for DirectX 11