Skip to content

Fix box light migration after enabling applyRangeAttenuation to them #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum Version
AreaLightShapeTypeLogicIsolation,
PCSSUIUpdate,
MoveEmissionMesh,
EnableApplyRangeAttenuationOnBoxLight,
}

/// <summary>
Expand Down Expand Up @@ -163,6 +164,19 @@ private static readonly MigrationDescription<Version, HDAdditionalLightData> k_H
data.m_AreaLightEmissiveMeshShadowCastingMode = oldShadowCastingMode;
data.m_AreaLightEmissiveMeshMotionVectorGenerationMode = oldMotionVectorMode;
}
}),
MigrationStep.New(Version.EnableApplyRangeAttenuationOnBoxLight, (HDAdditionalLightData data) =>
{
// When enabling range attenuation for box light, the default value was "true"
// causing a migration issue. So when we migrate we setup applyRangeAttenuation to false
// if we are a box light to keep the previous behavior
if (data.type == HDLightType.Spot)
{
if (data.spotLightShape == SpotLightShape.Box)
{
data.applyRangeAttenuation = false;
}
}
})
);
#pragma warning restore 0618, 0612
Expand Down