| 379 | } |
| 380 | |
| 381 | void 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 | |
| 404 | Float3 Skybox::SampleSky(const SkyCache& cache, Float3 sampleDir) |
| 405 | { |
no test coverage detected