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

Function SolveProjection

BakingLab/SG.cpp:197–210  ·  view source on GitHub ↗

Do a projection of the colors onto the SG's

Source from the content-addressed store, hash-verified

195
196// Do a projection of the colors onto the SG's
197static 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
213void SolveSGs(SGSolveParam& params)

Callers 1

SolveSGsFunction · 0.85

Calls 1

ProjectOntoSGsFunction · 0.85

Tested by

no test coverage detected