Add realtime sky/skybox capturing for GI

This commit is contained in:
Wojciech Figat
2022-05-23 12:53:39 +02:00
parent 375222a089
commit 72c0474397
13 changed files with 156 additions and 39 deletions

View File

@@ -195,6 +195,11 @@ void Sky::DrawFog(GPUContext* context, RenderContext& renderContext, GPUTextureV
context->DrawFullscreenTriangle();
}
bool Sky::IsDynamicSky() const
{
return !IsStatic() || (SunLight && !SunLight->IsStatic());
}
void Sky::ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world)
{
// Get precomputed cache and bind it to the pipeline

View File

@@ -74,6 +74,7 @@ public:
void DrawFog(GPUContext* context, RenderContext& renderContext, GPUTextureView* output) override;
// [ISkyRenderer]
bool IsDynamicSky() const override;
void ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world) override;
protected:

View File

@@ -87,6 +87,11 @@ bool Skybox::IntersectsItself(const Ray& ray, float& distance, Vector3& normal)
return false;
}
bool Skybox::IsDynamicSky() const
{
return !IsStatic();
}
void Skybox::ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world)
{
// Prepare mock draw call data

View File

@@ -68,6 +68,7 @@ public:
bool IntersectsItself(const Ray& ray, float& distance, Vector3& normal) override;
// [ISkyRenderer]
bool IsDynamicSky() const override;
void ApplySky(GPUContext* context, RenderContext& renderContext, const Matrix& world) override;
protected: