Skip to content

Commit

Permalink
Merge pull request #18 from thedocruby/patch-1
Browse files Browse the repository at this point in the history
Update config comments, preset
  • Loading branch information
vlad2305m authored Dec 5, 2021
2 parents b6716a5 + c666b81 commit 650ad60
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public enum ConfigPresets {

null, 10.0, null, null, null, null
)),
Dr_Rubisco_Signature((SoundPhysicsConfig c) -> changeConfig(c, true,
DrRubisco_Signature((SoundPhysicsConfig c) -> changeConfig(c, true,

0.7, 1.1, 1.0, 0.8,
1.2, 4.2, 1.1, 1.0,
1.0, 0.8, 1.0, 0.8,
1.0, 3.0, 1.0, 1.0,

false, 256, 16, false,

Expand Down Expand Up @@ -82,7 +82,7 @@ public enum ConfigPresets {
entry("field_27204", 2.3), entry("field_17734", 0.2), entry("field_17579", 0.3),
entry("field_28060", 1.8), entry("DEFAULT", 0.6)),

0.3, 10.0, true, true, 0.1, false
0.5, 10.0, true, true, 0.1, false

));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SoundPhysicsConfig implements ConfigData {
@Comment("Enable reverb?")
public boolean enabled = true;

@Comment("Don't forget to make this true when you change the config")
@Comment("Don't forget to make this true when you change the preset!")
public boolean reloadReverb = true;

@ConfigEntry.Gui.CollapsibleObject
Expand All @@ -36,32 +36,33 @@ public class SoundPhysicsConfig implements ConfigData {
public Misc Misc = new Misc();

public static class General{
@Comment("Affects how quiet a sound gets based on distance. Lower values mean distant sounds are louder. 1.0 is the physically correct value.\n0.2 - 1.0 or just don't set it to 0")
@Comment("Affects how quiet a sound gets based on distance. Lower values mean distant sounds are louder.\n1.0 is the physically correct value.\n0.2 - 1.0 or just don't set it to 0")
public double attenuationFactor = 1.0;
@Comment("The global volume of simulated reverberations.\n0.1 - 2.0")
public double globalReverbGain = 1.0;
@Comment("The brightness of reverberation. Higher values result in more high frequencies in reverberation. Lower values give a more muffled sound to the reverb.\n0.1 - 2.0")
@Comment("The brightness of reverberation.\nHigher values result in more high frequencies in reverberation.\nLower values give a more muffled sound to the reverb.\n0.1 - 2.0")
public double globalReverbBrightness = 1.0;
@Comment("The global amount of sound that will be absorbed when traveling through blocks.\n 0.1 - 4.0")
public double globalBlockAbsorption = 1.0;
@Comment("The global amount of sound reflectance energy of all blocks. Lower values result in more conservative reverb simulation with shorter reverb tails. Higher values result in more generous reverb simulation with higher reverb tails.\n0.1 - 4.0")
@Comment("The global amount of sound reflectance energy of all blocks.\nLower values result in more conservative reverb simulation with shorter reverb tails.\nHigher values result in more generous reverb simulation with higher reverb tails.\n0.1 - 4.0")
public double globalBlockReflectance = 1.0;
@Comment("Minecraft won't allow sounds to play past a certain distance. This parameter is a multiplier for how far away a sound source is allowed to be in order for it to actually play. Values too high can cause polyphony issues.\n1.0 - 6.0")
@Comment("Minecraft won't allow sounds to play past a certain distance;\nSoundPhysics makes that configurable by multiplying this parameter by the default distance.\nValues too high can cause polyphony issues.\n1.0 - 6.0")
public double soundDistanceAllowance = 4.0;
@Comment("A value controlling the amount that air absorbs high frequencies with distance. A value of 1.0 is physically correct for air with normal humidity and temperature. Higher values mean air will absorb more high frequencies with distance. 0 disables this effect.\n0.0 - 5.0")
public double airAbsorption = 1.0;
@Comment("How much sound is filtered when the player is underwater. 0.0 means no filter. 1.0 means fully filtered.\n0.0 - 1.0")
@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;
}

public static class Performance{
@Comment("If true, rain sound sources won't trace for sound occlusion. This can help performance during rain.")
@Comment("If true, rain sound sources won't trace for sound occlusion.\nThis can help performance during rain.")
public boolean skipRainOcclusionTracing = true;
@Comment("The number of rays to trace to determine reverberation for each sound source. More rays provides more consistent tracing results but takes more time to calculate. Decrease this value if you experience lag spikes when sounds play.\n8 - 64")
@Comment("The number of rays to trace to determine reverberation for each sound source.\nMore rays provides more consistent tracing results but takes more time to calculate.\nDecrease this value if you experience lag spikes when sounds play.")
@ConfigEntry.BoundedDiscrete(max = 512, min = 8)
public int environmentEvaluationRays = 256;
@Comment("The number of rays bounces to trace to determine reverberation for each sound source. More bounces provides more echo and sound ducting but takes more time to calculate. Decrease this value if you experience lag spikes when sounds play. Capped by max distance.\n4 - ?")
@Comment("The number of rays bounces to trace to determine reverberation for each sound source.\nMore bounces provides more echo and sound ducting but takes more time to calculate.\nDecrease this value if you experience lag spikes when sounds play. Capped by max distance.")
@ConfigEntry.BoundedDiscrete(max = 32, min = 2)
public int environmentEvaluationRayBounces = 4;
@Comment("If true, enables a simpler technique for determining when the player and a sound source share airspace. Might sometimes miss recognizing shared airspace, but it's faster to calculate.")
@Comment("If true, enables a simpler technique for determining when the player and a sound source share airspace.\nMight sometimes miss recognizing shared airspace, but it's faster to calculate.")
public boolean simplerSharedAirspaceSimulation = false;
}

Expand Down Expand Up @@ -90,18 +91,18 @@ public static class Material_Properties {
}

public static class Vlads_Tweaks {
@Comment("If sound hits non-full-square side, direct block occlusion is multiplied by this.\n0.0 - ")
@Comment("If sound hits non-full-square side, direct block occlusion is multiplied by this.\n0.0 - 1.0")
public double leakyBlocksOcclusionMultiplier = 0.15;
@Comment("The amount at which this is capped. 10 * block_occlusion is the theoretical limit")
public double maxDirectOcclusionFromBlocks = 10;
@Comment("Calculate direct occlusion as the minimum of 9 rays from vertices of a block")
public boolean _9RayDirectOcclusion = true;
@Comment("Whether to try calculating where the sound should come from based on reflections")
public boolean soundDirectionEvaluation = true;
@Comment("Maximum direction variance of incoming reflections allowed to redirect sound\n0.0-1.0")
public double maxDirVariance = 0.5;
@Comment("Skip redirecting non-occluded sounds (the ones you can see directly)")
public boolean notOccludedNoRedirect = true;
@Comment("Randomness of the perceived direction of incoming sounds\n0.0 means sounds come straight from the source.\n1.0 means sounds come from completely random directions\n0.0 - 1.0")
public double maxDirVariance = 0.0;
@Comment("Skip redirecting non-occluded sounds (the ones you can see directly).\nCan be inaccurate in some situations, especially when \"Sound direction reevaluation\" is enabled.")
public boolean notOccludedNoRedirect = false;
}

public static class Misc {
Expand All @@ -118,10 +119,7 @@ public static class Misc {
}

@ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.DROPDOWN)
@Comment("Soft presets (preserve some settings). Press reloadReverb to apply. Presets: [DEFAULT, RESET_MATERIALS, SP1_0_SOUND_OCCLUSION, Dr_Rubisco_Signature]. (LOAD_SUCCESS = null)")
public ConfigPresets preset = ConfigPresets.LOAD_SUCCESS;
@Comment("Soft presets (preserve some settings). Set \"Config has changed\" to true before saving.\nPresets: [DEFAULT, DrRubisco_Signature, SP1_0_SOUND_OCCLUSION]\nLOAD_SUCCESS is used for loading any saved config not defined by a preset.\nRESET_MATERIALS is for reseting material reflectance not changed by a soft config.")
public ConfigPresets preset = ConfigPresets.DrRubisco_Signature;

@ConfigEntry.Gui.Excluded
public boolean loaded = false;

}
}
10 changes: 5 additions & 5 deletions src/main/resources/assets/soundphysics/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"text.autoconfig.sound_physics.title": "Sound Physics Config",

"text.autoconfig.sound_physics.option.enabled": "Enable rendering?",
"text.autoconfig.sound_physics.option.reloadReverb": "!!!Check if changing config!!!",
"text.autoconfig.sound_physics.option.enabled": "Enable rendering",
"text.autoconfig.sound_physics.option.reloadReverb": "Config has changed",

"text.autoconfig.sound_physics.option.General": "General options:",
"text.autoconfig.sound_physics.option.Performance": "Performance options:",
Expand All @@ -15,7 +15,7 @@
"text.autoconfig.sound_physics.option.General.globalReverbBrightness": "Reverb brightness",
"text.autoconfig.sound_physics.option.General.globalBlockAbsorption": "Block passthrough sound absorption",
"text.autoconfig.sound_physics.option.General.globalBlockReflectance": "Block reflectance multiplier",
"text.autoconfig.sound_physics.option.General.soundDistanceAllowance": "Sound packet send radius 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.underwaterFilter": "Underwater filter strength",

Expand All @@ -29,7 +29,7 @@
"text.autoconfig.sound_physics.option.Vlads_Tweaks.leakyBlocksOcclusionMultiplier": "Leaky blocks occlusion multiplier",
"text.autoconfig.sound_physics.option.Vlads_Tweaks.maxDirectOcclusionFromBlocks": "Maximum direct occlusion",
"text.autoconfig.sound_physics.option.Vlads_Tweaks._9RayDirectOcclusion": "9 ray direct occlusion calculation",
"text.autoconfig.sound_physics.option.Vlads_Tweaks.soundDirectionEvaluation": "Sound direction reevaluation",
"text.autoconfig.sound_physics.option.Vlads_Tweaks.soundDirectionEvaluation": "Re-calculate sound direction",
"text.autoconfig.sound_physics.option.Vlads_Tweaks.maxDirVariance": "Max direction variance",
"text.autoconfig.sound_physics.option.Vlads_Tweaks.notOccludedNoRedirect": "Skip redirecting directly visible blocks",

Expand All @@ -40,4 +40,4 @@
"text.autoconfig.sound_physics.option.Misc.raytraceParticles": "Raytracing Particles",

"text.autoconfig.sound_physics.option.preset": "Preset"
}
}

0 comments on commit 650ad60

Please sign in to comment.