add snowfall level, which turns the sky grey

This commit is contained in:
Crypto City 2021-08-29 11:17:18 +00:00
parent d9c97295c2
commit 1b65353931
2 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,7 @@ ProcSky::ProcSky(Context* context):
, mieCollectionPower_(0.39f)
, mieDistribution_(0.63f)
, timeOfDay_(0.0f)
, snowfall_(0.0f)
{
faceRotations_[FACE_POSITIVE_X] = Matrix3(0,0,1, 0,1,0, -1,0,0);
faceRotations_[FACE_NEGATIVE_X] = Matrix3(0,0,-1, 0,1,0, 1,0,0);
@ -161,6 +162,7 @@ bool ProcSky::Initialize(const char *light_name, Zone *zone, const char *skybox_
atmoParams["LightDir"] = Vector3::DOWN;
atmoParams["InvProj"] = cam_->GetProjection().Inverse();
atmoParams["TimeOfDay"] = timeOfDay_;
atmoParams["Snowfall"] = snowfall_;
// Add custom quad commands to render path.
for (unsigned i = 0; i < MAX_CUBEMAP_FACES; ++i) {
@ -258,6 +260,7 @@ void ProcSky::Update() {
rPath_->SetShaderParameter("MieDistribution", mieDistribution_);
rPath_->SetShaderParameter("InvProj", cam_->GetProjection().Inverse());
rPath_->SetShaderParameter("TimeOfDay", timeOfDay_);
rPath_->SetShaderParameter("Snowfall", snowfall_);
SetRenderQueued(true);
}

View File

@ -136,4 +136,5 @@ public:
float mieCollectionPower_;
float mieDistribution_;
float timeOfDay_;
float snowfall_;
};