Compare commits

...
Author SHA1 Message Date
Alexdoru 70d15f2383 Set render distance for mob inside mod spawner to 16 blocks (#761)
* set render distance for mob inside mod spawner to 16 blocks

* add config in angelica

* add slider in video setting menu
2024-12-02 15:20:44 -10:00
kurrycatandDarren Eberly d66b5577f4 add missing GL calls in GLStateManager (#767)
Co-authored-by: Darren Eberly <[email protected]>
2024-12-02 09:12:44 -05:00
ah-OOG-ah e293f12fb8 Refresh Notfine options on world load (#760) 2024-12-01 00:03:21 +00:00
kurrycat b69eca6749 add missing Pipeline::syncProgram for glCallList (#762) 2024-11-30 10:38:00 -10:00
Jason Mitchell 03342f08c6 Update README.MD 2024-11-27 09:03:01 -08:00
ah-OOG-ah b85614f983 Null check (#756) 2024-11-26 22:19:05 +00:00
9 changed files with 97 additions and 32 deletions

No files matched your search

+4 -4
View File
@@ -8,19 +8,19 @@
* It's the angel that pulls you out of OptiFine's hell -Roadhog360 * It's the angel that pulls you out of OptiFine's hell -Roadhog360
## **Beta Quality - Here there be Dragons** ## **Beta Quality - Here there be Dragons**
* Shaders sneak preview - Please don't report issues yet, but please do submit fixes * Shaders - Beta
* Complementary & BSL mostly function, but have some bugs * Complementary & BSL mostly function, but have some bugs
* Sildurs, Seus, and any other shader probably doesn't work * Sildurs, Seus, and any other shader probably doesn't work
# Required Dependencies # Required Dependencies
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.14 * [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.19
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.4.2 * [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.5.20
* NOTE: Some mods are not required, but a specific version is required if present - see: `Permanent Incompatibilities` below. * NOTE: Some mods are not required, but a specific version is required if present - see: `Permanent Incompatibilities` below.
# Known (temporary) Incompatibilities # Known (temporary) Incompatibilities
* Forge Relocation - Currently non Thread Safe; safe if not in use * Forge Relocation - Currently non Thread Safe; safe if not in use
* ProjectRed Frames - Currently non Thread Safe; safe if not in use' * ProjectRed Frames - Currently non Thread Safe; safe if not in use
# Potential Incompatibilities # Potential Incompatibilities
* EndlessIDs - Compat commits have been made, might work, might not - not fully tested * EndlessIDs - Compat commits have been made, might work, might not - not fully tested
@@ -148,4 +148,9 @@ public class AngelicaConfig {
@Config.RangeInt(min = 64, max = 1024) @Config.RangeInt(min = 64, max = 1024)
public static int itemRendererDisplayListCacheSize; public static int itemRendererDisplayListCacheSize;
@Config.Comment("Render distance for the spinning mob inside mod spawners")
@Config.DefaultDouble(16D)
@Config.RangeDouble(min = 16D, max = 64D)
public static double mobSpawnerRenderDistance;
} }
@@ -69,6 +69,7 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.AbstractMap; import java.util.AbstractMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -960,32 +961,52 @@ public class GLStateManager {
glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j); glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j);
} }
public static void glDrawArrays(int mode, int first, int count) { public static void trySyncProgram() {
// Iris -- TODO: This doesn't seem to work and is related to matchPass()
if(AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
}
GL11.glDrawArrays(mode, first, count);
}
public static void glDrawBuffer(int mode) {
GL11.glDrawBuffer(mode);
}
public static void glDrawElements(int mode, IntBuffer indices) {
if(AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
}
GL11.glDrawElements(mode, indices);
}
public static void glBegin(int mode) {
if (AngelicaConfig.enableIris) { if (AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram); Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
} }
}
public static void glBegin(int mode) {
trySyncProgram();
GL11.glBegin(mode); GL11.glBegin(mode);
} }
public static void glDrawElements(int mode, ByteBuffer indices) {
trySyncProgram();
GL11.glDrawElements(mode, indices);
}
public static void glDrawElements(int mode, IntBuffer indices) {
trySyncProgram();
GL11.glDrawElements(mode, indices);
}
public static void glDrawElements(int mode, ShortBuffer indices) {
trySyncProgram();
GL11.glDrawElements(mode, indices);
}
public static void glDrawElements(int mode, int indices_count, int type, long indices_buffer_offset) {
trySyncProgram();
GL11.glDrawElements(mode, indices_count, type, indices_buffer_offset);
}
public static void glDrawElements(int mode, int count, int type, ByteBuffer indices) {
trySyncProgram();
GL11.glDrawElements(mode, count, type, indices);
}
public static void glDrawBuffer(int mode) {
trySyncProgram();
GL11.glDrawBuffer(mode);
}
public static void glDrawArrays(int mode, int first, int count) {
trySyncProgram();
GL11.glDrawArrays(mode, first, count);
}
public static void glLogicOp(int opcode) { public static void glLogicOp(int opcode) {
GL11.glLogicOp(opcode); GL11.glLogicOp(opcode);
} }
@@ -1240,6 +1261,7 @@ public class GLStateManager {
if(list < 0) { if(list < 0) {
VBOManager.get(list).render(); VBOManager.get(list).render();
} else { } else {
trySyncProgram();
GL11.glCallList(list); GL11.glCallList(list);
if(glListChanges.containsKey(list)) { if(glListChanges.containsKey(list)) {
for(Map.Entry<IStateStack<?>, ISettableState<?>> entry : glListChanges.get(list)) { for(Map.Entry<IStateStack<?>, ISettableState<?>> entry : glListChanges.get(list)) {
@@ -137,6 +137,7 @@ public enum Mixins {
,"sodium.MixinRenderGlobal" ,"sodium.MixinRenderGlobal"
,"sodium.MixinWorldClient" ,"sodium.MixinWorldClient"
,"sodium.MixinTileEntity" ,"sodium.MixinTileEntity"
,"sodium.MixinTileEntityMobSpawner"
,"sodium.MixinEffectRenderer" ,"sodium.MixinEffectRenderer"
,"sodium.MixinTileEntityRendererDispatcher" ,"sodium.MixinTileEntityRendererDispatcher"
,"sodium.MixinLongHashMap" ,"sodium.MixinLongHashMap"
@@ -1,19 +1,23 @@
package jss.notfine.proxy; package jss.notfine.proxy;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import jss.notfine.config.NotFineConfig; import jss.notfine.config.NotFineConfig;
import jss.notfine.core.Settings; import jss.notfine.core.Settings;
import jss.notfine.core.SettingsManager; import jss.notfine.core.SettingsManager;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.WorldEvent;
public class ClientProxy extends CommonProxy { public class ClientProxy extends CommonProxy {
@Override @Override
public void preInit(FMLPreInitializationEvent event) { public void preInit(FMLPreInitializationEvent event) {
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
if(!NotFineConfig.allowAdvancedOpenGL) { if(!NotFineConfig.allowAdvancedOpenGL) {
Minecraft.getMinecraft().gameSettings.advancedOpengl = false; Minecraft.getMinecraft().gameSettings.advancedOpengl = false;
} }
@@ -29,12 +33,13 @@ public class ClientProxy extends CommonProxy {
} }
} }
@Override
public void init(FMLInitializationEvent event) { }
@Override @Override
public void postInit(FMLPostInitializationEvent event) { public void postInit(FMLPostInitializationEvent event) {
SettingsManager.settingsFile.loadSettings(); SettingsManager.settingsFile.loadSettings();
} }
@SubscribeEvent
public void worldLoad(WorldEvent.Load event) {
SettingsManager.graphicsUpdated();
}
} }
@@ -164,6 +164,15 @@ public class SodiumGameOptionPages {
.setImpact(OptionImpact.MEDIUM) .setImpact(OptionImpact.MEDIUM)
.build() .build()
) )
.add(
OptionImpl.createBuilder(int.class, angelicaOpts)
.setName(I18n.format("options.angelica.mobSpawnerRenderDistance"))
.setTooltip(I18n.format("options.angelica.mobSpawnerRenderDistance.tooltip"))
.setControl(option -> new SliderControl(option, 16, 64, 1, ControlValueFormatter.number()))
.setBinding((options, value) -> AngelicaConfig.mobSpawnerRenderDistance = value, options -> (int) AngelicaConfig.mobSpawnerRenderDistance)
.setImpact(OptionImpact.MEDIUM)
.build()
)
.build()); .build());
return new OptionPage(I18n.format("stat.generalButton"), ImmutableList.copyOf(groups)); return new OptionPage(I18n.format("stat.generalButton"), ImmutableList.copyOf(groups));
@@ -178,8 +187,10 @@ public class SodiumGameOptionPages {
.setTooltip(I18n.format("sodium.options.graphics_quality.tooltip")) .setTooltip(I18n.format("sodium.options.graphics_quality.tooltip"))
.setControl(option -> new CyclingControl<>(option, GraphicsMode.class)) .setControl(option -> new CyclingControl<>(option, GraphicsMode.class))
.setBinding( .setBinding(
(opts, value) -> { opts.fancyGraphics = value.isFancy(); (opts, value) -> {
SettingsManager.graphicsUpdated(); }, opts.fancyGraphics = value.isFancy();
SettingsManager.graphicsUpdated();
},
opts -> GraphicsMode.fromBoolean(opts.fancyGraphics)) opts -> GraphicsMode.fromBoolean(opts.fancyGraphics))
.setImpact(OptionImpact.HIGH) .setImpact(OptionImpact.HIGH)
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
@@ -137,6 +137,8 @@ options.dynamic_lights_shader_force=Dynamic Lights - Forced With Shaders
options.dynamic_lights_shader_force.tooltip=Enabled - Dynamic Lights are shown even when a shader is active, Disabled - Dynamic Lights are disabled when a shader is active. options.dynamic_lights_shader_force.tooltip=Enabled - Dynamic Lights are shown even when a shader is active, Disabled - Dynamic Lights are disabled when a shader is active.
options.angelica.droppedItemLimit=Dropped Item Render Limit options.angelica.droppedItemLimit=Dropped Item Render Limit
options.angelica.droppedItemLimit.tooltip=The maximum number of dropped items that will be rendered. Lower values can improve performance. options.angelica.droppedItemLimit.tooltip=The maximum number of dropped items that will be rendered. Lower values can improve performance.
options.angelica.mobSpawnerRenderDistance=Mod spawner render distance
options.angelica.mobSpawnerRenderDistance.tooltip=Render distance for the spinning mob inside mod spawners
options.angelica.itemdisplaylistcount=Item Renderer Display List Cache Size options.angelica.itemdisplaylistcount=Item Renderer Display List Cache Size
options.angelica.itemdisplaylistcount.tooltip=The maximum number of display lists to cache in the optimized item renderer. Higher values will increase performance but increase VRAM usage. options.angelica.itemdisplaylistcount.tooltip=The maximum number of display lists to cache in the optimized item renderer. Higher values will increase performance but increase VRAM usage.
pack.iris.select.title=Select pack.iris.select.title=Select
@@ -34,6 +34,8 @@ public class MixinMinecraft {
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;update()V", shift = At.Shift.AFTER, remap = false) at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;update()V", shift = At.Shift.AFTER, remap = false)
) )
private void angelica$trackFrametimes(CallbackInfo ci) { private void angelica$trackFrametimes(CallbackInfo ci) {
if (AngelicaMod.proxy == null) return;
long time = System.nanoTime(); long time = System.nanoTime();
AngelicaMod.proxy.putFrametime(time - angelica$lastFrameTime); AngelicaMod.proxy.putFrametime(time - angelica$lastFrameTime);
angelica$lastFrameTime = time; angelica$lastFrameTime = time;
@@ -0,0 +1,17 @@
package com.gtnewhorizons.angelica.mixins.early.sodium;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityMobSpawner;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(TileEntityMobSpawner.class)
public class MixinTileEntityMobSpawner extends TileEntity {
@Override
public double getMaxRenderDistanceSquared() {
final double d = AngelicaConfig.mobSpawnerRenderDistance;
return d * d;
}
}