Add absvalue support for heat and humidity noises
This commit is contained in:
parent
3bd107f72d
commit
71401a207f
@ -173,6 +173,9 @@ A Voronoi diagram is supposed to be here but for some reason it cannot be displa
|
|||||||
<label for="inputNoiseHeatPersistence">Persistence: </label>
|
<label for="inputNoiseHeatPersistence">Persistence: </label>
|
||||||
<input id="inputNoiseHeatPersistence" class="numInput" type="number" value="0.5" step=0.01>
|
<input id="inputNoiseHeatPersistence" class="numInput" type="number" value="0.5" step=0.01>
|
||||||
|
|
||||||
|
<input id="inputNoiseHeatAbsvalue" type="checkbox">
|
||||||
|
<label for="inputNoiseHeatAbsvalue">absvalue</label>
|
||||||
|
|
||||||
<h3>Humidity (<code id="noiseSettingNameHumidity">mg_biome_np_humidity</code>)</h3>
|
<h3>Humidity (<code id="noiseSettingNameHumidity">mg_biome_np_humidity</code>)</h3>
|
||||||
<label for="inputNoiseHumidityOffset">Offset: </label>
|
<label for="inputNoiseHumidityOffset">Offset: </label>
|
||||||
<input id="inputNoiseHumidityOffset" class="numInput" type="number" value="50" step=0.01>
|
<input id="inputNoiseHumidityOffset" class="numInput" type="number" value="50" step=0.01>
|
||||||
@ -186,6 +189,9 @@ A Voronoi diagram is supposed to be here but for some reason it cannot be displa
|
|||||||
<label for="inputNoiseHumidityPersistence">Persistence: </label>
|
<label for="inputNoiseHumidityPersistence">Persistence: </label>
|
||||||
<input id="inputNoiseHumidityPersistence" class="numInput" type="number" value="0.5" step=0.01>
|
<input id="inputNoiseHumidityPersistence" class="numInput" type="number" value="0.5" step=0.01>
|
||||||
|
|
||||||
|
<input id="inputNoiseHumidityAbsvalue" type="checkbox">
|
||||||
|
<label for="inputNoiseHumidityAbsvalue">absvalue</label>
|
||||||
|
|
||||||
<h3>Reset</h3>
|
<h3>Reset</h3>
|
||||||
<button id="inputNoiseReset" type="button">Reset noise parameters</button>
|
<button id="inputNoiseReset" type="button">Reset noise parameters</button>
|
||||||
</form>
|
</form>
|
||||||
|
35
libpov.js
35
libpov.js
@ -1476,10 +1476,12 @@ function updateWidgetStates() {
|
|||||||
inputNoiseHeatScale.value = noises.heat.scale;
|
inputNoiseHeatScale.value = noises.heat.scale;
|
||||||
inputNoiseHeatOctaves.value = noises.heat.octaves;
|
inputNoiseHeatOctaves.value = noises.heat.octaves;
|
||||||
inputNoiseHeatPersistence.value = noises.heat.persistence;
|
inputNoiseHeatPersistence.value = noises.heat.persistence;
|
||||||
|
inputNoiseHeatAbsvalue.checked = noises.heat.absvalue;
|
||||||
inputNoiseHumidityOffset.value = noises.humidity.offset;
|
inputNoiseHumidityOffset.value = noises.humidity.offset;
|
||||||
inputNoiseHumidityScale.value = noises.humidity.scale;
|
inputNoiseHumidityScale.value = noises.humidity.scale;
|
||||||
inputNoiseHumidityOctaves.value = noises.humidity.octaves;
|
inputNoiseHumidityOctaves.value = noises.humidity.octaves;
|
||||||
inputNoiseHumidityPersistence.value = noises.humidity.persistence;
|
inputNoiseHumidityPersistence.value = noises.humidity.persistence;
|
||||||
|
inputNoiseHumidityAbsvalue.checked = noises.humidity.absvalue;
|
||||||
|
|
||||||
if (v6_flag_snowbiomes) {
|
if (v6_flag_snowbiomes) {
|
||||||
inputV6FreqDesert.disabled = true;
|
inputV6FreqDesert.disabled = true;
|
||||||
@ -2206,19 +2208,29 @@ function blurNoiseParam(noiseName, noiseValueName, element, defaultValue) {
|
|||||||
draw(true);
|
draw(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function updateNoiseParamCheckbox(noiseName, noiseValueName, element) {
|
||||||
|
let val = element.checked;
|
||||||
|
noises[noiseName][noiseValueName] = val;
|
||||||
|
clear();
|
||||||
|
updateAreaVars();
|
||||||
|
draw(true);
|
||||||
|
}
|
||||||
|
|
||||||
let noiseWidgetTable = [
|
let noiseWidgetTable = [
|
||||||
{ elem: inputNoiseHeatScale, noise: "heat", noise_param: "scale", default_modern: NOISE_SCALE_DEFAULT, default_v6: NOISE_V6_HEAT_SCALE_DEFAULT },
|
{ elem: inputNoiseHeatScale, type: "input", noise: "heat", noise_param: "scale", default_modern: NOISE_SCALE_DEFAULT, default_v6: NOISE_V6_HEAT_SCALE_DEFAULT },
|
||||||
{ elem: inputNoiseHeatOffset, noise: "heat", noise_param: "offset", default_modern: NOISE_OFFSET_DEFAULT, default_v6: NOISE_V6_HEAT_OFFSET_DEFAULT },
|
{ elem: inputNoiseHeatOffset, type: "input", noise: "heat", noise_param: "offset", default_modern: NOISE_OFFSET_DEFAULT, default_v6: NOISE_V6_HEAT_OFFSET_DEFAULT },
|
||||||
{ elem: inputNoiseHeatOctaves, noise: "heat", noise_param: "octaves", default_modern: NOISE_OCTAVES_DEFAULT, default_v6: NOISE_V6_HEAT_OCTAVES_DEFAULT },
|
{ elem: inputNoiseHeatOctaves, type: "input", noise: "heat", noise_param: "octaves", default_modern: NOISE_OCTAVES_DEFAULT, default_v6: NOISE_V6_HEAT_OCTAVES_DEFAULT },
|
||||||
{ elem: inputNoiseHeatPersistence, noise: "heat", noise_param: "persistence", default_modern: NOISE_PERSISTENCE_DEFAULT, default_v6: NOISE_V6_HEAT_PERSISTENCE_DEFAULT },
|
{ elem: inputNoiseHeatPersistence, type: "input", noise: "heat", noise_param: "persistence", default_modern: NOISE_PERSISTENCE_DEFAULT, default_v6: NOISE_V6_HEAT_PERSISTENCE_DEFAULT },
|
||||||
{ elem: inputNoiseHumidityScale, noise: "humidity", noise_param: "scale", default_modern: NOISE_SCALE_DEFAULT, default_v6: NOISE_V6_HUMIDITY_SCALE_DEFAULT },
|
{ elem: inputNoiseHeatAbsvalue, type: "checkbox", noise: "heat", noise_param: "absvalue", default_modern: NOISE_ABSVALUE_DEFAULT, default_v6: NOISE_V6_HEAT_ABSVALUE_DEFAULT },
|
||||||
{ elem: inputNoiseHumidityOffset, noise: "humidity", noise_param: "offset", default_modern: NOISE_OFFSET_DEFAULT, default_v6: NOISE_V6_HUMIDITY_OFFSET_DEFAULT },
|
{ elem: inputNoiseHumidityScale, type: "input", noise: "humidity", noise_param: "scale", default_modern: NOISE_SCALE_DEFAULT, default_v6: NOISE_V6_HUMIDITY_SCALE_DEFAULT },
|
||||||
{ elem: inputNoiseHumidityOctaves, noise: "humidity", noise_param: "octaves", default_modern: NOISE_OCTAVES_DEFAULT, default_v6: NOISE_V6_HUMIDITY_OCTAVES_DEFAULT },
|
{ elem: inputNoiseHumidityOffset, type: "input", noise: "humidity", noise_param: "offset", default_modern: NOISE_OFFSET_DEFAULT, default_v6: NOISE_V6_HUMIDITY_OFFSET_DEFAULT },
|
||||||
{ elem: inputNoiseHumidityPersistence, noise: "humidity", noise_param: "persistence", default_modern: NOISE_PERSISTENCE_DEFAULT, default_v6: NOISE_V6_HUMIDITY_PERSISTENCE_DEFAULT },
|
{ elem: inputNoiseHumidityOctaves, type: "input", noise: "humidity", noise_param: "octaves", default_modern: NOISE_OCTAVES_DEFAULT, default_v6: NOISE_V6_HUMIDITY_OCTAVES_DEFAULT },
|
||||||
|
{ elem: inputNoiseHumidityPersistence, type: "input", noise: "humidity", noise_param: "persistence", default_modern: NOISE_PERSISTENCE_DEFAULT, default_v6: NOISE_V6_HUMIDITY_PERSISTENCE_DEFAULT },
|
||||||
|
{ elem: inputNoiseHumidityAbsvalue, type: "checkbox", noise: "humidity", noise_param: "absvalue", default_modern: NOISE_ABSVALUE_DEFAULT, default_v6: NOISE_V6_HUMIDITY_ABSVALUE_DEFAULT },
|
||||||
]
|
]
|
||||||
|
|
||||||
for (let n of noiseWidgetTable) {
|
for (let n of noiseWidgetTable) {
|
||||||
|
if (n.type === "input") {
|
||||||
n.elem.oninput = function() {
|
n.elem.oninput = function() {
|
||||||
updateNoiseParam(n.noise, n.noise_param, this);
|
updateNoiseParam(n.noise, n.noise_param, this);
|
||||||
}
|
}
|
||||||
@ -2227,6 +2239,11 @@ for (let n of noiseWidgetTable) {
|
|||||||
let defaultValue = n[DEFAULT_BIOME_NAME + "_" + biomeMode];
|
let defaultValue = n[DEFAULT_BIOME_NAME + "_" + biomeMode];
|
||||||
blurNoiseParam(n.noise, n.noise_param, this, defaultValue);
|
blurNoiseParam(n.noise, n.noise_param, this, defaultValue);
|
||||||
}
|
}
|
||||||
|
} else if (n.type === "checkbox") {
|
||||||
|
n.elem.onchange = function() {
|
||||||
|
updateNoiseParamCheckbox(n.noise, n.noise_param, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inputNoiseReset.onclick = function() {
|
inputNoiseReset.onclick = function() {
|
||||||
@ -2260,11 +2277,13 @@ inputNoiseReset.onclick = function() {
|
|||||||
inputNoiseHeatScale.value = noises.heat.scale;
|
inputNoiseHeatScale.value = noises.heat.scale;
|
||||||
inputNoiseHeatOctaves.value = noises.heat.octaves;
|
inputNoiseHeatOctaves.value = noises.heat.octaves;
|
||||||
inputNoiseHeatPersistence.value = noises.heat.persistence;
|
inputNoiseHeatPersistence.value = noises.heat.persistence;
|
||||||
|
inputNoiseHeatAbsvalue.checked = noises.heat.absvalue;
|
||||||
|
|
||||||
inputNoiseHumidityOffset.value = noises.humidity.offset;
|
inputNoiseHumidityOffset.value = noises.humidity.offset;
|
||||||
inputNoiseHumidityScale.value = noises.humidity.scale;
|
inputNoiseHumidityScale.value = noises.humidity.scale;
|
||||||
inputNoiseHumidityOctaves.value = noises.humidity.octaves;
|
inputNoiseHumidityOctaves.value = noises.humidity.octaves;
|
||||||
inputNoiseHumidityPersistence.value = noises.humidity.persistence;
|
inputNoiseHumidityPersistence.value = noises.humidity.persistence;
|
||||||
|
inputNoiseHumidityAbsvalue.checked = noises.humidity.absvalue;
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
updateAreaVars();
|
updateAreaVars();
|
||||||
|
@ -147,8 +147,6 @@
|
|||||||
|
|
||||||
<p>Heat/humidity <b>values above 1,000,000 or below −1,000,000</b> are <b>not supported</b> and will trigger an error message. This is a much smaller range than what Luanti supports. Also, no diagram can be drawn if the heat or humidity noise scale equals 0 or is very small, although this is legal in Luanti. This does not mean that your chosen settings won’t work in Luanti, just that LiBPoV can’t visualize them.</p>
|
<p>Heat/humidity <b>values above 1,000,000 or below −1,000,000</b> are <b>not supported</b> and will trigger an error message. This is a much smaller range than what Luanti supports. Also, no diagram can be drawn if the heat or humidity noise scale equals 0 or is very small, although this is legal in Luanti. This does not mean that your chosen settings won’t work in Luanti, just that LiBPoV can’t visualize them.</p>
|
||||||
|
|
||||||
<p>LiBPoV assumes that the <code>absvalue</code> flag of the heat/humidity noises is always <code>false</code>. So if your game/mod has set it to true, the diagram may still show a value range that is actually impossible.</p>
|
|
||||||
|
|
||||||
<h2>Credits / License</h2>
|
<h2>Credits / License</h2>
|
||||||
<p>LiBPoV is <b>free software</b>. See the <a href="./license.html">License</a> page for details.</p>
|
<p>LiBPoV is <b>free software</b>. See the <a href="./license.html">License</a> page for details.</p>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user