Skip to content

sebh/HLSL-Spherical-Harmonics

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
October 27, 2018 16:22
October 27, 2018 21:36
August 27, 2021 17:57

HLSL-Spherical-Harmonics

Description

A collection of HLSL functions one can include to use spherical harmonics in shaders. This is practical when generating and consuming SH on the GPU.

Using Git, this repository can be integrated in your project as a submodule.

Files description:

  • SphericalHarmonics.hlsl: the HLSL file containing all the SH functions.
  • sh2.nb : A Mathematica notebook to verify and visualize SH functions correctness.
  • sh2.pdf: A compiled pdf to simply read sh2.nb.

Examples

Precomputed occlusion as SH for cloud ambient lighting. Result as video and as images (1st image: directional occlusion as SH, 2nd image: final cloud render):

cloud

cloud

Future

  • As of today, only 2nd order SH functions are provided. 3rd order SH could be added.
  • Do not hesitate to send suggestions or improvements.

About

A collection of HLSL functions one can include to use spherical harmonics in shaders. This repository can be simply be used as a submodule.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published