Skip to content

Commit 94c82ca

Browse files
committed
fix: save default lod bias
1 parent 3faeb75 commit 94c82ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/UI/Panels/MiscPanel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public Misc(UIBase owner) : base(owner)
4848
Toggle HighLodToggle;
4949
object qualitySettings = null;
5050
PropertyInfo lodBias = null;
51+
float _defaultLodBias = 1;
5152

5253
// We save the current properties of the Renderers and Lights to restore them after editing them with togglers
5354
internal Dictionary<Renderer, bool> renderersReceiveShadows = new();
@@ -122,9 +123,9 @@ private void ToogleHighLods(bool areHighLodsOn){
122123
if (lodBias == null){
123124
Type qualitySettingsType = qualitySettings is Type type ? type : qualitySettings.GetActualType();
124125
lodBias = qualitySettingsType.GetProperty("lodBias");
126+
_defaultLodBias = (float)lodBias.GetValue(null);
125127
}
126-
127-
lodBias.SetValue(null, areHighLodsOn ? 10000 : 1, null);
128+
lodBias.SetValue(null, areHighLodsOn ? 10000 : _defaultLodBias, null);
128129
}
129130

130131
private void ToggleAllMeshesCastAndRecieveShadows(bool enable){

0 commit comments

Comments
 (0)