MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / Sample

Method Sample

SampleFramework12/v1.00/Graphics/Skybox.cpp:228–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228Float3 SkyCache::Sample(Float3 sampleDir) const
229{
230 Assert_(StateR != nullptr);
231
232 float gamma = AngleBetween(sampleDir, SunDirection);
233 float theta = AngleBetween(sampleDir, Float3(0, 1, 0));
234
235 Float3 radiance;
236
237 radiance.x = float(arhosek_tristim_skymodel_radiance(StateR, theta, gamma, 0));
238 radiance.y = float(arhosek_tristim_skymodel_radiance(StateG, theta, gamma, 1));
239 radiance.z = float(arhosek_tristim_skymodel_radiance(StateB, theta, gamma, 2));
240
241 // Multiply by standard luminous efficacy of 683 lm/W to bring us in line with the photometric
242 // units used during rendering
243 radiance *= 683.0f;
244
245 return radiance * FP16Scale;
246}
247
248#endif // EnableSkyModel_
249

Callers

nothing calls this directly

Calls 3

AngleBetweenFunction · 0.85
Float3Class · 0.85

Tested by

no test coverage detected