| 17 | { |
| 18 | |
| 19 | SH9 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 | |
| 41 | SH9Color ProjectOntoSH9Color(const Float3& dir, const Float3& color) |
| 42 | { |
no outgoing calls
no test coverage detected