Do a projection of the colors onto the SG's
| 195 | |
| 196 | // Do a projection of the colors onto the SG's |
| 197 | static void SolveProjection(SGSolveParam& params) |
| 198 | { |
| 199 | Assert_(params.XSamples != nullptr); |
| 200 | Assert_(params.YSamples != nullptr); |
| 201 | |
| 202 | // Project color samples onto the SGs |
| 203 | for(uint32 i = 0; i < params.NumSamples; ++i) |
| 204 | ProjectOntoSGs(params.XSamples[i], params.YSamples[i], params.OutSGs, params.NumSGs); |
| 205 | |
| 206 | // Weight the samples by the monte carlo factor for uniformly sampling the hemisphere |
| 207 | float monteCarloFactor = ((2.0f * Pi) / params.NumSamples); |
| 208 | for(uint32 i = 0; i < params.NumSGs; ++i) |
| 209 | params.OutSGs[i].Amplitude *= monteCarloFactor; |
| 210 | } |
| 211 | |
| 212 | // Solve the set of spherical gaussians based on input set of data |
| 213 | void SolveSGs(SGSolveParam& params) |
no test coverage detected