Recalculate chunk bounding boxes when the settings of a heightlayer change (closes #2096)

* Correctly calculate Offset when negative numbers are involved
* Adds tile index layer for the Moon
* Remove empty spaces
This commit is contained in:
Alexander Bock
2022-11-07 15:45:54 +01:00
committed by GitHub
parent 6d379a537e
commit 12bb47c71e
16 changed files with 76 additions and 31 deletions
@@ -85,6 +85,14 @@ LayerRenderSettings::LayerRenderSettings()
});
}
void LayerRenderSettings::onChange(std::function<void()> callback) {
opacity.onChange(callback);
gamma.onChange(callback);
multiplier.onChange(callback);
multiplier.onChange(callback);
offset.onChange(callback);
}
float LayerRenderSettings::performLayerSettings(float v) const {
return
((glm::sign(v) * glm::pow(glm::abs(v), gamma) * multiplier) + offset) * opacity;