Add skybox rotation feature

#3592
This commit is contained in:
Wojtek Figat
2025-09-21 21:58:03 +02:00
parent 7da5ce3ed4
commit a0f764a774
3 changed files with 5 additions and 2 deletions

BIN
Content/Engine/SkyboxMaterial.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -129,6 +129,7 @@ void Skybox::ApplySky(GPUContext* context, RenderContext& renderContext, const M
material->SetParameterValue(TEXT("PanoramicTexture"), PanoramicTexture.Get(), false);
material->SetParameterValue(TEXT("Color"), Color * Math::Exp2(Exposure), false);
material->SetParameterValue(TEXT("IsPanoramic"), PanoramicTexture != nullptr, false);
material->SetParameterValue(TEXT("RotationEuler"), _rotationEuler, false);
material->Bind(bindParams);
}
}
@@ -163,4 +164,5 @@ void Skybox::OnTransformChanged()
_box = BoundingBox(_transform.Translation);
_sphere = BoundingSphere(_transform.Translation, 0.0f);
_rotationEuler = GetOrientation().GetEuler() * DegreesToRadians;
}

View File

@@ -18,6 +18,7 @@ class FLAXENGINE_API Skybox : public Actor, public ISkyRenderer
private:
AssetReference<MaterialInstance> _proxyMaterial;
int32 _sceneRenderingKey = -1;
Float3 _rotationEuler;
public:
/// <summary>