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

Function EvalSH9Cosine

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

Source from the content-addressed store, hash-verified

88}
89
90Float3 EvalSH9Cosine(const Float3& dir, const SH9Color& sh)
91{
92 SH9 dirSH = ProjectOntoSH9(dir);
93 dirSH.Coefficients[0] *= CosineA0;
94 dirSH.Coefficients[1] *= CosineA1;
95 dirSH.Coefficients[2] *= CosineA1;
96 dirSH.Coefficients[3] *= CosineA1;
97 dirSH.Coefficients[4] *= CosineA2;
98 dirSH.Coefficients[5] *= CosineA2;
99 dirSH.Coefficients[6] *= CosineA2;
100 dirSH.Coefficients[7] *= CosineA2;
101 dirSH.Coefficients[8] *= CosineA2;
102
103 Float3 result;
104 for(uint64 i = 0; i < 9; ++i)
105 result += dirSH.Coefficients[i] * sh.Coefficients[i];
106
107 return result;
108}
109
110H4 ProjectOntoH4(const Float3& dir)
111{

Callers

nothing calls this directly

Calls 1

ProjectOntoSH9Function · 0.85

Tested by

no test coverage detected