From 042ac733a69071301803f48462cb61bd5aa68d58 Mon Sep 17 00:00:00 2001 From: "Dr. Rubisco" Date: Fri, 17 Dec 2021 20:53:33 -0500 Subject: [PATCH] Revert "Prepare for humidity absorption" This reverts commit f55337302b0b2d15eb7680ac73dae85210431542. --- .../config/PrecomputedConfig.java | 4 +--- .../config/SoundPhysicsConfig.java | 2 -- .../config/presets/ConfigChanger.java | 7 +++--- .../config/presets/ConfigPresets.java | 24 +++++++++---------- .../assets/soundphysics/lang/en_us.json | 1 - 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/sonicether/soundphysics/config/PrecomputedConfig.java b/src/main/java/com/sonicether/soundphysics/config/PrecomputedConfig.java index d7a37d0f..329182a1 100644 --- a/src/main/java/com/sonicether/soundphysics/config/PrecomputedConfig.java +++ b/src/main/java/com/sonicether/soundphysics/config/PrecomputedConfig.java @@ -26,8 +26,7 @@ public class PrecomputedConfig { public final float globalReverbBrightness; public final double globalBlockAbsorption; public final double globalBlockReflectance; - public final float airAbsorption; // todo Is this the one? - public final boolean humidityToggle; + public final float airAbsorption;//todo Is this the one? public final double underwaterFilter; public final boolean skipRainOcclusionTracing; @@ -71,7 +70,6 @@ public PrecomputedConfig(SoundPhysicsConfig c) throws CloneNotSupportedException soundDistanceAllowance = c.General.soundDistanceAllowance; globalBlockReflectance = c.General.globalBlockReflectance; airAbsorption = (float) c.General.airAbsorption; - humidityToggle = c.General.humidityToggle; underwaterFilter = 1 - c.General.underwaterFilter; skipRainOcclusionTracing = c.Performance.skipRainOcclusionTracing; diff --git a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java index 56eabb78..90b0b13b 100644 --- a/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java +++ b/src/main/java/com/sonicether/soundphysics/config/SoundPhysicsConfig.java @@ -48,8 +48,6 @@ public static class General{ public double soundDistanceAllowance = 4.0; @Comment("Represents how aggressively air absorbs high frequencies over distance.\nA value of 1.0 is physically correct for air with normal humidity and temperature.\nHigher values mean air will absorb more high frequencies with distance.\nA value of 0.0 disables this effect.") public double airAbsorption = 1.0; - @Comment("If enabled, the humidity of the environment will affect the air absorption.") - public boolean humidityToggle = true; @Comment("How much sound is filtered when the player is underwater.\n0.0 means no filter. 1.0 means fully filtered.\n0.0 - 1.0") public double underwaterFilter = 0.8; } diff --git a/src/main/java/com/sonicether/soundphysics/config/presets/ConfigChanger.java b/src/main/java/com/sonicether/soundphysics/config/presets/ConfigChanger.java index 98a3bfac..b9ea2357 100644 --- a/src/main/java/com/sonicether/soundphysics/config/presets/ConfigChanger.java +++ b/src/main/java/com/sonicether/soundphysics/config/presets/ConfigChanger.java @@ -9,20 +9,20 @@ public class ConfigChanger { public static void changeConfig(SoundPhysicsConfig config, @Nullable Boolean enabled, - @Nullable Double attenuationFactor, @Nullable Double globalReverbGain, @Nullable Double globalReverbBrightness, @Nullable Double globalBlockAbsorption, @Nullable Double globalBlockReflectance, @Nullable Double soundDistanceAllowance, @Nullable Double airAbsorption, @Nullable Boolean humidityToggle, @Nullable Double underwaterFilter, + @Nullable Double attenuationFactor, @Nullable Double globalReverbGain, @Nullable Double globalReverbBrightness, @Nullable Double globalBlockAbsorption, @Nullable Double globalBlockReflectance, @Nullable Double soundDistanceAllowance, @Nullable Double airAbsorption, @Nullable Double underwaterFilter, @Nullable Boolean skipRainOcclusionTracing, @Nullable Integer environmentEvaluationRays, @Nullable Integer environmentEvaluationRayBounces, @Nullable Boolean simplerSharedAirspaceSimulation, @Nullable Map materialProperties, @Nullable Integer continuousRefreshRate, @Nullable Double maxDirectOcclusionFromBlocks, @Nullable Boolean _9RayDirectOcclusion, @Nullable Boolean soundDirectionEvaluation, @Nullable Double directRaysDirEvalMultiplier, @Nullable Boolean notOccludedNoRedirect ) { if (enabled != null) config.enabled = enabled; - setGeneral(config.General, attenuationFactor, globalReverbGain, globalReverbBrightness, globalBlockAbsorption, globalBlockReflectance, soundDistanceAllowance, airAbsorption, humidityToggle, underwaterFilter); + setGeneral(config.General, attenuationFactor, globalReverbGain, globalReverbBrightness, globalBlockAbsorption, globalBlockReflectance, soundDistanceAllowance, airAbsorption, underwaterFilter); setPerformance(config.Performance, skipRainOcclusionTracing, environmentEvaluationRays, environmentEvaluationRayBounces, simplerSharedAirspaceSimulation); setMaterial_Properties(config.Materials, materialProperties); setVlads_Tweaks(config.Vlads_Tweaks, continuousRefreshRate, maxDirectOcclusionFromBlocks, _9RayDirectOcclusion, soundDirectionEvaluation, directRaysDirEvalMultiplier, notOccludedNoRedirect); config.preset = ConfigPresets.LOAD_SUCCESS; } - public static void setGeneral(SoundPhysicsConfig.General general, @Nullable Double attenuationFactor, @Nullable Double globalReverbGain, @Nullable Double globalReverbBrightness, @Nullable Double globalBlockAbsorption, @Nullable Double globalBlockReflectance, @Nullable Double soundDistanceAllowance, @Nullable Double airAbsorption, @Nullable Boolean humidityToggle, @Nullable Double underwaterFilter) { + public static void setGeneral(SoundPhysicsConfig.General general, @Nullable Double attenuationFactor, @Nullable Double globalReverbGain, @Nullable Double globalReverbBrightness, @Nullable Double globalBlockAbsorption, @Nullable Double globalBlockReflectance, @Nullable Double soundDistanceAllowance, @Nullable Double airAbsorption, @Nullable Double underwaterFilter) { if (attenuationFactor != null) general.attenuationFactor = attenuationFactor; if (globalReverbGain != null) general.globalReverbGain = globalReverbGain; if (globalReverbBrightness != null) general.globalReverbBrightness = globalReverbBrightness; @@ -30,7 +30,6 @@ public static void setGeneral(SoundPhysicsConfig.General general, @Nullable Doub if (globalBlockReflectance != null) general.globalBlockReflectance = globalBlockReflectance; if (soundDistanceAllowance != null) general.soundDistanceAllowance = soundDistanceAllowance; if (airAbsorption != null) general.airAbsorption = airAbsorption; - if (humidityToggle != null) general.humidityToggle = humidityToggle; if (underwaterFilter != null) general.underwaterFilter = underwaterFilter; } diff --git a/src/main/java/com/sonicether/soundphysics/config/presets/ConfigPresets.java b/src/main/java/com/sonicether/soundphysics/config/presets/ConfigPresets.java index 90bde219..4ba0d88d 100644 --- a/src/main/java/com/sonicether/soundphysics/config/presets/ConfigPresets.java +++ b/src/main/java/com/sonicether/soundphysics/config/presets/ConfigPresets.java @@ -20,7 +20,7 @@ public enum ConfigPresets { DEFAULT_BALANCED("Balanced (Base)", (SoundPhysicsConfig c) -> changeConfig(c, true, 1.0, 1.0, 1.0, 1.0, - 1.0, 4.0, 1.0, true, 0.8, + 1.0, 4.0, 1.0, 0.8, true, 224, 12, false, @@ -32,7 +32,7 @@ public enum ConfigPresets { DEFAULT_PERFORMANCE("Performance (Base)", (SoundPhysicsConfig c) -> changeConfig(c, true, 1.0, 1.0, 1.0, 1.0, - 1.0, 4.0, 1.0, true, 0.8, + 1.0, 4.0, 1.0, 0.8, true, 96, 6, true, @@ -44,7 +44,7 @@ public enum ConfigPresets { DEFAULT_QUALITY("Quality (Base)", (SoundPhysicsConfig c) -> changeConfig(c, true, 1.0, 1.0, 1.0, 1.0, - 1.0, 4.0, 1.0, true, 0.8, + 1.0, 4.0, 1.0, 0.8, false, 512, 24, false, @@ -56,7 +56,7 @@ public enum ConfigPresets { THEDOCRUBY("Dr. Rubisco's Signature Sound", (SoundPhysicsConfig c) -> changeConfig(c, true, 1.0, 0.8, 1.0, 0.8, - 1.0, 3.5, 1.0, true, 0.8, + 1.0, 3.5, 1.0, 0.8, true, 256, 16, false, @@ -117,7 +117,7 @@ public enum ConfigPresets { // SUPER_REVERB("Super Reverb", (SoundPhysicsConfig c) -> changeConfig(c, true, null, 1.8, null, null, - 4.0, null, null, null, null, + 4.0, null, null, null, null, null, null, null, @@ -129,7 +129,7 @@ public enum ConfigPresets { // LUSH_REVERB("More Lush Cave Reverb", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, null, null, - null, null, null, null, null, + null, null, null, null, null, null, null, null, @@ -147,7 +147,7 @@ public enum ConfigPresets { // NO_ABSORPTION("No Absorption", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, null, 0.0, - null, null, 0.0, false, null, + null, null, 0.0, null, null, null, null, null, @@ -158,7 +158,7 @@ public enum ConfigPresets { // LOW_FREQ("Bass Boost", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, 0.2, null, - null, null, 2.0, null, null, + null, null, 2.0, null, null, null, null, null, @@ -169,7 +169,7 @@ public enum ConfigPresets { // HIGH_FREQ("Treble Boost", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, 1.8, null, - null, null, 0.5, null, null, + null, null, 0.5, null, null, null, null, null, @@ -180,7 +180,7 @@ public enum ConfigPresets { // FOG("Foggy Air", (SoundPhysicsConfig c) -> changeConfig(c, true, 2.5, null, null, null, - null, null, 25.0, true, null, + null, null, 25.0, null, null, null, null, null, @@ -192,7 +192,7 @@ public enum ConfigPresets { TOTAL_OCCLUSION("Total Occlusion", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, null, 10.0, - null, null, null, null, null, + null, null, null, null, null, null, null, null, @@ -204,7 +204,7 @@ public enum ConfigPresets { RESET_MATERIALS("Clear Material Properties", (SoundPhysicsConfig c) -> changeConfig(c, true, null, null, null, null, - null, null, null, null, null, + null, null, null, null, null, null, null, null, diff --git a/src/main/resources/assets/soundphysics/lang/en_us.json b/src/main/resources/assets/soundphysics/lang/en_us.json index 5565e953..bbeda61c 100644 --- a/src/main/resources/assets/soundphysics/lang/en_us.json +++ b/src/main/resources/assets/soundphysics/lang/en_us.json @@ -16,7 +16,6 @@ "text.autoconfig.sound_physics.option.General.globalBlockReflectance": "Block reflectance multiplier", "text.autoconfig.sound_physics.option.General.soundDistanceAllowance": "Sound max distance multiplier", "text.autoconfig.sound_physics.option.General.airAbsorption": "Sound absorption by air", - "text.autoconfig.sound_physics.option.General.humidityToggle": "Humidity Absorption Toggle", "text.autoconfig.sound_physics.option.General.underwaterFilter": "Underwater filter strength", "text.autoconfig.sound_physics.option.Performance.skipRainOcclusionTracing": "Skip tracing for rain sounds",