| 57 | |
| 58 | |
| 59 | SH9 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 | |
| 81 | SH9Color ProjectOntoSH9Color(const Float3& dir, const Float3& color) |
| 82 | { |
no outgoing calls
no test coverage detected