Compare commits

..
Author SHA1 Message Date
Dakotah fe065803aa THIS ADDS FEATURE REQUEST ISSUE TO GITHUB (#514)
* Add feature request template

* Add feature request template

* Add labels to feature request template automatically

* switch labels to enhancement
2024-05-30 16:30:09 -07:00
ah-OOG-ah f94268c384 Add null check to FluidRenderer (#513)
* Add null check to FluidRenderer

* Update FluidRenderer.java
2024-05-30 17:56:32 -04:00
jss2a98aj f7a8b0f3bf Cloud scaling, distance, and some fixes 2024-05-24 22:16:41 -07:00
embeddedt 8893cf2291 Mark chunk graph as dirty when FOV changes (#506) 2024-05-24 15:59:46 -04:00
11 changed files with 99 additions and 33 deletions

No files matched your search

@@ -0,0 +1,33 @@
name: Feature Request
description: "Request a feature."
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: "Please use this form to request features. We ask you check if it was already requested though"
- type: input
id: discord
attributes:
label: Your GTNH Discord Username
description: Leave empty if you don't have one, but this will make it harder to contact you if we need additional info.
placeholder: "Example: Wumpus#1234"
- type: textarea
id: request
attributes:
label: Feature Request
description: "Relevant information, as well as relevant images"
placeholder: "Example: https://mclo.gs/ OR submit the file to github by dragging it to this textbox."
validations:
required: true
- type: checkboxes
id: final
attributes:
label: Final Checklist
description: Certify that you read things
options:
- label: "I have searched the issues and haven't found a similar issue."
required: true
- label: "I have read the known incompatibilities and this is not related to one of those."
required: true
- label: "This issue is not related to a feature that is disabed by default - Shaders, MCPF, etc. [They'll be enabled when they're ready for testing]"
required: true
@@ -7,6 +7,7 @@ import net.minecraft.entity.EntityLivingBase;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(EntityRenderer.class)
@@ -23,4 +24,9 @@ public abstract class MixinEntityRenderer {
);
}
@ModifyArg(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lorg/lwjgl/util/glu/Project;gluPerspective(FFFF)V", ordinal = 0), index = 0)
private float captureFov(float fov) {
RenderingState.INSTANCE.setFov(fov);
return fov;
}
}
@@ -64,6 +64,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
private VertexBuffer vbo;
private int cloudMode = -1;
private int renderDistance = -1;
private int cloudElevation = -1;
private int scaleMult = -1;
private DynamicTexture COLOR_TEX = null;
@@ -82,9 +84,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
return instance;
}
private int getScale() {
return cloudMode == 2 ? 12 : 8;
return (cloudMode == 2 ? 12 : 8) * scaleMult;
}
private float ceilToScale(float value) {
@@ -139,11 +140,12 @@ public class CloudRenderer implements IResourceManagerReloadListener {
tessellator.pos(sectX0, 0, sectZ1).tex(u0, v1).color(bCol, bCol, bCol, ALPHA).endVertex();
if (fancy) {
final int height = HEIGHT * scaleMult;
// Top
tessellator.pos(sectX0, HEIGHT, sectZ0).tex(u0, v0).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX0, HEIGHT, sectZ1).tex(u0, v1).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX1, HEIGHT, sectZ1).tex(u1, v1).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX1, HEIGHT, sectZ0).tex(u1, v0).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX0, height, sectZ0).tex(u0, v0).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX0, height, sectZ1).tex(u0, v1).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX1, height, sectZ1).tex(u1, v1).color(1, 1, 1, ALPHA).endVertex();
tessellator.pos(sectX1, height, sectZ0).tex(u1, v0).color(1, 1, 1, ALPHA).endVertex();
float slice;
float sliceCoord0;
@@ -157,8 +159,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
if (slice > -CULL_DIST) {
slice += INSET;
tessellator.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, height, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, height, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
slice -= INSET;
}
@@ -168,8 +170,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
if (slice <= CULL_DIST) {
slice -= INSET;
tessellator.pos(slice, 0, sectZ0).tex(sliceCoord0, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, HEIGHT, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, HEIGHT, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, height, sectZ0).tex(sliceCoord1, v0).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, height, sectZ1).tex(sliceCoord1, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
tessellator.pos(slice, 0, sectZ1).tex(sliceCoord0, v1).color(0.9F, 0.9F, 0.9F, ALPHA).endVertex();
slice += INSET;
}
@@ -183,8 +185,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
if (slice > -CULL_DIST) {
slice += INSET;
tessellator.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX0, height, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX1, height, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
slice -= INSET;
}
@@ -194,8 +196,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
if (slice <= CULL_DIST) {
slice -= INSET;
tessellator.pos(sectX1, 0, slice).tex(u1, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX1, HEIGHT, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX0, HEIGHT, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX1, height, slice).tex(u1, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX0, height, slice).tex(u0, sliceCoord1).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
tessellator.pos(sectX0, 0, slice).tex(u0, sliceCoord0).color(0.8F, 0.8F, 0.8F, ALPHA).endVertex();
slice += INSET;
}
@@ -238,21 +240,32 @@ public class CloudRenderer implements IResourceManagerReloadListener {
public void checkSettings() {
GraphicsQualityOff cloudGraphicsQuality = (GraphicsQualityOff)Settings.MODE_CLOUDS.option.getStore();
final int cloudQualitySetting = cloudGraphicsQuality == GraphicsQualityOff.FANCY
final int cloudQualitySetting = cloudGraphicsQuality == GraphicsQualityOff.FANCY
|| cloudGraphicsQuality == GraphicsQualityOff.DEFAULT && mc.gameSettings.fancyGraphics ? 2 : 1;
boolean newEnabled = mc.gameSettings.shouldRenderClouds()
final boolean newEnabled = mc.gameSettings.shouldRenderClouds()
&& mc.theWorld != null
&& mc.theWorld.provider.isSurfaceWorld();
final int targetDistance = Math.max(mc.gameSettings.renderDistanceChunks, (int)Settings.RENDER_DISTANCE_CLOUDS.option.getStore());
final int cloudScaleMult = (int)Settings.CLOUD_SCALE.option.getStore();
if (isBuilt()
&& (!newEnabled
|| cloudQualitySetting != cloudMode
|| mc.gameSettings.renderDistanceChunks != renderDistance)) {
|| targetDistance != renderDistance
|| cloudScaleMult != scaleMult)) {
dispose();
}
cloudMode = cloudQualitySetting;
renderDistance = mc.gameSettings.renderDistanceChunks;
renderDistance = targetDistance;
scaleMult = cloudScaleMult;
cloudElevation = mc.theWorld == null ? 128 : (int)mc.theWorld.provider.getCloudHeight();
//Allows the setting to work with RFG and similar without hardcoding.
//The minimum height check is so stuff like Aether cloud height doesn't get messed up.
if(cloudElevation >= 96) {
cloudElevation = (int)Settings.CLOUD_HEIGHT.option.getStore();
}
if (newEnabled && !isBuilt()) {
build();
@@ -268,7 +281,7 @@ public class CloudRenderer implements IResourceManagerReloadListener {
double totalOffset = cloudTicks + partialTicks;
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks + totalOffset * 0.03;
double y = mc.theWorld.provider.getCloudHeight() - (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks) + 0.33;
double y = cloudElevation - (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks) + 0.33;
double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
int scale = getScale();
@@ -2,6 +2,7 @@ package com.gtnewhorizons.angelica.rendering;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import lombok.Getter;
import lombok.Setter;
import org.joml.Matrix4f;
import org.joml.Vector3d;
import org.lwjgl.BufferUtils;
@@ -21,6 +22,9 @@ public class RenderingState {
private final Matrix4f projectionMatrix = new Matrix4f().identity();
@Getter
private final Matrix4f modelViewMatrix = new Matrix4f().identity();
@Getter
@Setter
private float fov;
public void setCameraPosition(double x, double y, double z) {
+3 -4
View File
@@ -40,7 +40,7 @@ public enum Settings {
SettingsManager.cloudsUpdated();
}
},
CLOUD_SCALE(new NotFineOptionSlider(4, 2, 20, 1, null)),
CLOUD_SCALE(new NotFineOptionSlider(1, 1, 3, 1, null)),
DOWNFALL_DISTANCE(new NotFineOptionCycling<>(DownfallQuality.DEFAULT, OptionImpact.MEDIUM)) {
@Override
public void applyChanges() {
@@ -112,7 +112,7 @@ public enum Settings {
},
PARTICLES_ENC_TABLE(new NotFineOptionSlider(1, 0, 16, 1, OptionImpact.LOW)),
PARTICLES_VOID(new NotFineOptionTickBox(true, OptionImpact.LOW)),
RENDER_DISTANCE_CLOUDS(new NotFineOptionSlider(4, 4, 64, 2, OptionImpact.VARIES)) {
RENDER_DISTANCE_CLOUDS(new NotFineOptionSlider(4, 4, 64, 1, OptionImpact.VARIES)) {
@Override
public void applyChanges() {
SettingsManager.cloudsUpdated();
@@ -172,8 +172,7 @@ public enum Settings {
@Override
public Control<Integer> getControl() {
//TODO: Don't hardcode CLOUD_SCALE check.
return new SliderControl(this, min, max, step, setting != Settings.CLOUD_SCALE ? ControlValueFormatter.number() : NotFineControlValueFormatter.multiplied(0.25f));
return new SliderControl(this, min, max, step, ControlValueFormatter.number());
}
@Override
@@ -57,8 +57,8 @@ public class SettingsManager {
public static void cloudsUpdated() {
if(Settings.MODE_CLOUDS.option.getStore() != GraphicsQualityOff.OFF) {
minimumFarPlaneDistance = 32 * (int)Settings.RENDER_DISTANCE_CLOUDS.option.getStore();
minimumFarPlaneDistance += Math.abs((int)Settings.CLOUD_HEIGHT.option.getStore());
minimumFarPlaneDistance = 32 * ((int)Settings.RENDER_DISTANCE_CLOUDS.option.getStore());
minimumFarPlaneDistance += (int)Settings.CLOUD_HEIGHT.option.getStore();
mc.gameSettings.clouds = true;
} else {
minimumFarPlaneDistance = 128;
@@ -206,9 +206,9 @@ public class NotFineGameOptionPages {
.add(Settings.MODE_SKY.option)
.add(Settings.MODE_SUN_MOON.option)
.add(Settings.MODE_CLOUDS.option)
//.add(Settings.RENDER_DISTANCE_CLOUDS.option)
.add(Settings.RENDER_DISTANCE_CLOUDS.option)
.add(Settings.CLOUD_HEIGHT.option)
//.add(Settings.CLOUD_SCALE.option)
.add(Settings.CLOUD_SCALE.option)
.add(Settings.MODE_CLOUD_TRANSLUCENCY.option)
.add(Settings.MODE_STARS.option)
.add(Settings.TOTAL_STARS.option)
@@ -81,9 +81,9 @@ public class SodiumGameOptionPages {
firstGroupBuilder.add(Settings.MODE_LIGHT_FLICKER.option)
.add(Settings.MODE_SKY.option)
.add(Settings.MODE_SUN_MOON.option)
//.add(Settings.RENDER_DISTANCE_CLOUDS.option)
.add(Settings.RENDER_DISTANCE_CLOUDS.option)
.add(Settings.CLOUD_HEIGHT.option)
//.add(Settings.CLOUD_SCALE.option)
.add(Settings.CLOUD_SCALE.option)
.add(Settings.MODE_CLOUD_TRANSLUCENCY.option)
.add(Settings.MODE_STARS.option)
.add(Settings.TOTAL_STARS.option)
@@ -7,6 +7,7 @@ import com.gtnewhorizons.angelica.compat.toremove.RenderLayer;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import com.gtnewhorizons.angelica.rendering.RenderingState;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import it.unimi.dsi.fastutil.longs.LongSet;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
@@ -64,6 +65,7 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
private int renderDistance;
private double lastCameraX, lastCameraY, lastCameraZ;
private float lastFov;
private double lastCameraPitch, lastCameraYaw;
private float lastFogDistance;
@@ -213,8 +215,10 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
float fogDistance = FogHelper.getFogCutoff();
float fov = RenderingState.INSTANCE.getFov();
boolean dirty = pos.x != this.lastCameraX || pos.y != this.lastCameraY || pos.z != this.lastCameraZ ||
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fogDistance != this.lastFogDistance;
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fogDistance != this.lastFogDistance || fov != this.lastFov;
if(AngelicaConfig.enableIris) {
iris$ensureStateSwapped();
@@ -232,6 +236,7 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
this.lastCameraPitch = pitch;
this.lastCameraYaw = yaw;
this.lastFogDistance = fogDistance;
this.lastFov = fov;
profiler.endStartSection("chunk_update");
@@ -45,6 +45,7 @@ public class FluidRenderer {
private final QuadLightData quadLightData = new QuadLightData();
private boolean useSeparateAo;
private final int[] quadColors = new int[4];
private final TextureAtlasSprite missingTex = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraft:missing");
public FluidRenderer(LightPipelineProvider lpp) {
int normal = Norm3b.pack(0.0f, 1.0f, 0.0f);
@@ -95,7 +96,7 @@ public class FluidRenderer {
int posZ = pos.z;
Fluid fluid = ((IFluidBlock) block).getFluid();
if(fluid == null) return false;
if (fluid == null) return false;
// Check for occluded sides; if everything is occluded, don't render
boolean sfUp = this.isFluidOccluded(world, posX, posY, posZ, ForgeDirection.UP, fluid);
@@ -117,6 +118,11 @@ public class FluidRenderer {
(TextureAtlasSprite) fluid.getFlowingIcon(),
null
};
// Because some mods are wack and return null textures here
sprites[0] = sprites[0] == null ? missingTex : sprites[0];
sprites[1] = sprites[1] == null ? missingTex : sprites[1];
boolean hc = fluid.getColor() != 0xffffffff;
boolean rendered = false;
@@ -10,7 +10,7 @@ options.graphics.smart=Smart
options.graphics.ultra=Ultra
options.off=Off
options.on=On
options.cloud_height=Cloud Height
options.cloud_height=Cloud Elevation
options.cloud_scale=Cloud Scale
options.gui_background=Background
options.downfall_distance=Weather Effects
@@ -33,7 +33,7 @@ options.mode_water=Water
options.mode_vignette=Vignette
options.particles_enc_table=Enchantment Particles
options.particles_void=Void Particles
options.render_distance_clouds=Cloud Render Distance
options.render_distance_clouds=Minimum Cloud Distance
options.title.detail=Detail Settings
options.title.other=Other Settings
options.title.particle=Particle Settings