Some general fixes
This commit is contained in:
@@ -17,7 +17,7 @@ It should be automatically included when pulling the full mod.
|
||||
LZ4 for Java (data compression)\
|
||||
https://github.com/lz4/lz4-java
|
||||
|
||||
Json & Toml for Java (config handling)\
|
||||
NightConfig for Json & Toml (config handling)\
|
||||
https://github.com/TheElectronWill/night-config
|
||||
|
||||
SVG Salamander for SVG's\
|
||||
|
||||
@@ -59,7 +59,7 @@ public class BaseJFrame extends JFrame {
|
||||
// Creates a list with all the options in it
|
||||
List<String> langsToChoose = new ArrayList<>();
|
||||
try(
|
||||
final InputStreamReader isr = new InputStreamReader(JarUtils.accessFile("assets/lod/lang"), StandardCharsets.UTF_8);
|
||||
final InputStreamReader isr = new InputStreamReader(JarUtils.accessFile("assets/distanthorizons/lang"), StandardCharsets.UTF_8);
|
||||
final BufferedReader br = new BufferedReader(isr)
|
||||
) {
|
||||
List<Object> col = Collections.unmodifiableList(new ArrayList<>(Arrays.asList(br.lines().toArray())));
|
||||
@@ -87,11 +87,11 @@ public class BaseJFrame extends JFrame {
|
||||
// Try to set the icons for them
|
||||
try {
|
||||
lightMode = new JButton(new ImageIcon(
|
||||
new FlatSVGIcon(JarUtils.accessFile("assets/lod/textures/jar/themeLight.svg")).getImage() // Get the image
|
||||
new FlatSVGIcon(JarUtils.accessFile("assets/distanthorizons/textures/jar/themeLight.svg")).getImage() // Get the image
|
||||
.getScaledInstance(themeButtonSize, themeButtonSize, Image.SCALE_DEFAULT) // Scale it to the correct size
|
||||
));
|
||||
darkMode = new JButton(new ImageIcon(
|
||||
new FlatSVGIcon(JarUtils.accessFile("assets/lod/textures/jar/themeDark.svg")).getImage() // Get the image
|
||||
new FlatSVGIcon(JarUtils.accessFile("assets/distanthorizons/textures/jar/themeDark.svg")).getImage() // Get the image
|
||||
.getScaledInstance(themeButtonSize, themeButtonSize, Image.SCALE_DEFAULT) // Scale it to the correct size
|
||||
));
|
||||
} catch (Exception e) {e.printStackTrace();}
|
||||
@@ -139,8 +139,7 @@ public class BaseJFrame extends JFrame {
|
||||
// This part of the code is taken from the official java docs at https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||
|
||||
// Specify the look and feel to use by defining the LOOKANDFEEL constant
|
||||
// Valid values are: null (use the default), "Metal", "System", "Motif",
|
||||
// and "GTK"
|
||||
// Valid values are: null (use the default), "Metal", "System", "Motif", and "GTK"
|
||||
final static String LOOKANDFEEL = "GTK";
|
||||
private static void initLookAndFeel() {
|
||||
String lookAndFeel = null;
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
"distanthorizons.config.client.advanced.graphics.noiseTextureSettings.noiseDropoff":
|
||||
"Noise Dropoff",
|
||||
"distanthorizons.config.client.advanced.graphics.noiseTextureSettings.noiseDropoff.@tooltip":
|
||||
"How far should the noise texture render before it fades away? \n\n0.0 - the noise texture will render the entire LOD render distance. \n3.0 - the noise texture will fade away at 1/3 of the LOD render distance. ",
|
||||
"Defines how far should the noise texture render before it fades away. (in blocks). \nSet to 0 to disable noise from fading away.",
|
||||
|
||||
|
||||
"distanthorizons.config.client.advanced.graphics.advancedGraphics":
|
||||
|
||||
@@ -104,9 +104,9 @@ void main()
|
||||
vec3 vertexNormal = normalize(cross(dFdx(vPos.xyz), dFdy(vPos.xyz)));
|
||||
// This bit of code is required to fix the vertex position problem cus of floats in the verted world position varuable
|
||||
vec3 fixedVPos = vec3(
|
||||
vPos.x - vertexNormal.x * 0.001,
|
||||
vPos.y - vertexNormal.y * 0.001,
|
||||
vPos.z - vertexNormal.z * 0.001
|
||||
vPos.x - vertexNormal.x * 0.001,
|
||||
vPos.y - vertexNormal.y * 0.001,
|
||||
vPos.z - vertexNormal.z * 0.001
|
||||
);
|
||||
|
||||
|
||||
@@ -116,9 +116,9 @@ void main()
|
||||
|
||||
// Random value for each position
|
||||
float randomValue = rand(vec3(
|
||||
quantize(fixedVPos.x, noiseSteps),
|
||||
quantize(fixedVPos.y, noiseSteps),
|
||||
quantize(fixedVPos.z, noiseSteps)
|
||||
quantize(fixedVPos.x, noiseSteps),
|
||||
quantize(fixedVPos.y, noiseSteps),
|
||||
quantize(fixedVPos.z, noiseSteps)
|
||||
))
|
||||
* 2. * noiseAmplification - noiseAmplification;
|
||||
|
||||
@@ -129,22 +129,22 @@ void main()
|
||||
|
||||
// Clamps it and turns it back into a vec4
|
||||
if (noiseDropoff == 0)
|
||||
fragColor = vec4(
|
||||
clamp(newCol.r, 0., 1.),
|
||||
clamp(newCol.g, 0., 1.),
|
||||
clamp(newCol.b, 0., 1.),
|
||||
fragColor.w
|
||||
);
|
||||
fragColor = vec4(
|
||||
clamp(newCol.r, 0., 1.),
|
||||
clamp(newCol.g, 0., 1.),
|
||||
clamp(newCol.b, 0., 1.),
|
||||
fragColor.w
|
||||
);
|
||||
else
|
||||
fragColor = mix(
|
||||
vec4(
|
||||
clamp(newCol.r, 0., 1.),
|
||||
clamp(newCol.g, 0., 1.),
|
||||
clamp(newCol.b, 0., 1.),
|
||||
fragColor.w
|
||||
), fragColor,
|
||||
clamp(length(vertexWorldPos) / noiseDropoff, 0., 1.) // The further away it gets, the less noise gets applied
|
||||
);
|
||||
fragColor = mix(
|
||||
vec4(
|
||||
clamp(newCol.r, 0., 1.),
|
||||
clamp(newCol.g, 0., 1.),
|
||||
clamp(newCol.b, 0., 1.),
|
||||
fragColor.w
|
||||
), fragColor,
|
||||
clamp(length(vertexWorldPos) / noiseDropoff, 0., 1.) // The further away it gets, the less noise gets applied
|
||||
);
|
||||
|
||||
// For testing
|
||||
// if (fragColor.r != 69420.) {
|
||||
@@ -167,15 +167,15 @@ void main()
|
||||
|
||||
float horizontalDist = length(vertexWorldPos.xz) * fogScale;
|
||||
float heightDist = calculateHeightFogDepth(
|
||||
vertexWorldPos.y, vertexYPos) * fogVerticalScale;
|
||||
vertexWorldPos.y, vertexYPos) * fogVerticalScale;
|
||||
float farDist = calculateFarFogDepth(horizontalDist,
|
||||
length(vertexWorldPos.xyz) * fogScale, nearFogStart);
|
||||
length(vertexWorldPos.xyz) * fogScale, nearFogStart);
|
||||
|
||||
float nearFogThickness = getNearFogThickness(horizontalDist);
|
||||
float farFogThickness = getFarFogThickness(farDist);
|
||||
float heightFogThickness = getHeightFogThickness(heightDist);
|
||||
float mixedFogThickness = clamp(mixFogThickness(
|
||||
nearFogThickness, farFogThickness, heightFogThickness), 0.0, 1.0);
|
||||
nearFogThickness, farFogThickness, heightFogThickness), 0.0, 1.0);
|
||||
|
||||
fragColor = mix(fragColor, vec4(fogColor.rgb, 1.0), mixedFogThickness);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user