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

Method RenderSimpleSky

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

Source from the content-addressed store, hash-verified

379}
380
381void Skybox::RenderSimpleSky(ID3D11DeviceContext* context,
382 Float3 skyColor,
383 Float3 sunDirection,
384 Float3 sunColor,
385 float sunSize,
386 const Float4x4& view,
387 const Float4x4& projection,
388 Float3 scale)
389{
390 PIXEvent pixEvent(L"Skybox Render Simple Sky");
391
392 // Set the pixel shader constants
393 bool enableSun = sunSize > 0.0f && sunColor.x > 0.0f && sunColor.y > 0.0f && sunColor.z > 0.0f;
394 psConstantBuffer.Data.SkyColor = skyColor;
395 psConstantBuffer.Data.SunDirection = sunDirection;
396 psConstantBuffer.Data.EnableSun = enableSun ? 1 : 0;
397 psConstantBuffer.Data.SunColor = sunColor;
398 psConstantBuffer.Data.Scale = scale;
399 psConstantBuffer.Data.CosSunAngularRadius = std::cos(DegToRad(sunSize));
400
401 RenderCommon(context, nullptr, simpleSkyPS, view, projection, scale);
402}
403
404Float3 Skybox::SampleSky(const SkyCache& cache, Float3 sampleDir)
405{

Callers 1

RenderMainPassMethod · 0.80

Calls 2

cosFunction · 0.85
DegToRadFunction · 0.85

Tested by

no test coverage detected