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

Method SampleSky

SampleFramework11/v1.02/Graphics/Skybox.cpp:404–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404Float3 Skybox::SampleSky(const SkyCache& cache, Float3 sampleDir)
405{
406 Assert_(cache.StateR != nullptr);
407
408 float gamma = AngleBetween(sampleDir, cache.SunDirection);
409 float theta = AngleBetween(sampleDir, Float3(0, 1, 0));
410
411 Float3 radiance;
412
413 radiance.x = float(arhosek_tristim_skymodel_radiance(cache.StateR, theta, gamma, 0));
414 radiance.y = float(arhosek_tristim_skymodel_radiance(cache.StateG, theta, gamma, 1));
415 radiance.z = float(arhosek_tristim_skymodel_radiance(cache.StateB, theta, gamma, 2));
416
417 // Multiply by standard luminous efficacy of 683 lm/W to bring us in line with the photometric
418 // units used during rendering
419 radiance *= 683.0f;
420
421 radiance *= FP16Scale;
422
423 return radiance;
424}
425
426}

Callers

nothing calls this directly

Calls 3

AngleBetweenFunction · 0.85
Float3Class · 0.85

Tested by

no test coverage detected