Add realtime sky/skybox capturing for GI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user