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

Function ProjectOntoSH9

SampleFramework11/v1.02/Graphics/SH.cpp:59–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57
58
59SH9 ProjectOntoSH9(const Float3& dir)
60{
61 SH9 sh;
62
63 // Band 0
64 sh.Coefficients[0] = 0.282095f;
65
66 // Band 1
67 sh.Coefficients[1] = 0.488603f * dir.y;
68 sh.Coefficients[2] = 0.488603f * dir.z;
69 sh.Coefficients[3] = 0.488603f * dir.x;
70
71 // Band 2
72 sh.Coefficients[4] = 1.092548f * dir.x * dir.y;
73 sh.Coefficients[5] = 1.092548f * dir.y * dir.z;
74 sh.Coefficients[6] = 0.315392f * (3.0f * dir.z * dir.z - 1.0f);
75 sh.Coefficients[7] = 1.092548f * dir.x * dir.z;
76 sh.Coefficients[8] = 0.546274f * (dir.x * dir.x - dir.y * dir.y);
77
78 return sh;
79}
80
81SH9Color ProjectOntoSH9Color(const Float3& dir, const Float3& color)
82{

Callers 3

ProjectOntoSH9ColorFunction · 0.85
EvalSH9CosineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected