Skip to content

Commit

Permalink
Revert "Prepare for humidity absorption"
Browse files Browse the repository at this point in the history
This reverts commit f553373.
  • Loading branch information
thedocruby committed Dec 18, 2021
1 parent f553373 commit 042ac73
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,27 @@

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<String, MaterialData> 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;
if (globalBlockAbsorption != null) general.globalBlockAbsorption = globalBlockAbsorption;
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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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,

Expand All @@ -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,

Expand All @@ -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,

Expand Down Expand Up @@ -117,7 +117,7 @@ public enum ConfigPresets {
//<editor-fold desc="SUPER_REVERB,">
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,

Expand All @@ -129,7 +129,7 @@ public enum ConfigPresets {
//<editor-fold desc="LUSH_REVERB,">
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,

Expand All @@ -147,7 +147,7 @@ public enum ConfigPresets {
//<editor-fold desc="NO_ABSORPTION,">
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,

Expand All @@ -158,7 +158,7 @@ public enum ConfigPresets {
//<editor-fold desc="LOW_FREQ,">
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,

Expand All @@ -169,7 +169,7 @@ public enum ConfigPresets {
//<editor-fold desc="HIGH_FREQ,">
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,

Expand All @@ -180,7 +180,7 @@ public enum ConfigPresets {
//<editor-fold desc="FOG,">
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,

Expand All @@ -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,

Expand All @@ -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,

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/assets/soundphysics/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 042ac73

Please sign in to comment.