MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / ProjectOntoSH9

Function ProjectOntoSH9

SampleFramework12/v1.00/Graphics/SH.cpp:19–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18
19SH9 ProjectOntoSH9(const Float3& dir)
20{
21 SH9 sh;
22
23 // Band 0
24 sh.Coefficients[0] = 0.282095f;
25
26 // Band 1
27 sh.Coefficients[1] = 0.488603f * dir.y;
28 sh.Coefficients[2] = 0.488603f * dir.z;
29 sh.Coefficients[3] = 0.488603f * dir.x;
30
31 // Band 2
32 sh.Coefficients[4] = 1.092548f * dir.x * dir.y;
33 sh.Coefficients[5] = 1.092548f * dir.y * dir.z;
34 sh.Coefficients[6] = 0.315392f * (3.0f * dir.z * dir.z - 1.0f);
35 sh.Coefficients[7] = 1.092548f * dir.x * dir.z;
36 sh.Coefficients[8] = 0.546274f * (dir.x * dir.x - dir.y * dir.y);
37
38 return sh;
39}
40
41SH9Color ProjectOntoSH9Color(const Float3& dir, const Float3& color)
42{

Callers 2

ProjectOntoSH9ColorFunction · 0.85
EvalSH9IrradianceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected