Compare commits

...
Author SHA1 Message Date
makamys 3e6aa461c6 Fix crash when Sodium is disabled 2024-03-27 09:06:48 -07:00
Moses Miller d236689e6a Allow the user to select more gui scales (#399) 2024-03-25 09:19:35 -07:00
Caedis d15bbb56ee Add void fog option (default false) (#398) 2024-03-24 19:48:09 -07:00
Jason Mitchell f4355bd4c4 More readable 2024-03-23 21:14:11 -07:00
makamys 5dbd244d72 Readme tweaks (#391)
* [skip ci] Add logo to readme

* [skip ci] README: add CurseForge and Modrinth links
2024-03-20 16:48:06 -07:00
Jason Mitchell 367c82a225 [ci skip] Add CF/MN project info 2024-03-18 08:19:07 -07:00
Jason Mitchell 852bcbb38b Check before casting.
Fixes https://github.com/GTNewHorizons/Angelica/issues/388
2024-03-16 11:24:38 -07:00
ah-OOG-ah 464af945b2 Fix AIOBE in debug screen and NPE on world join (#385)
* Fix AIIOBE

* Fix NPE

* Actually fix
2024-03-15 21:42:38 -04:00
makamys 996b3df9cb Use vanilla field to count number of chunk updates
Fixes D-Tools compat
2024-03-15 15:23:48 -07:00
makamys 22d28abce6 Use ByteBuffer overload when indirect buffer is in client memory
Fixes #373
2024-03-15 15:23:37 -07:00
Jason Mitchell 636b616f64 Stop blacklisting bartworks. (#369)
Needs https://github.com/GTNewHorizons/bartworks/commit/50dfbb44acdd28bc183dc58b9cd40d5ba5121685
2024-03-09 09:27:22 -08:00
Caedis 14b7178419 Initialize toggle keybind when registering (#366)
* Initialize toggle keybind when registering

* Add comment
2024-03-08 15:26:36 -08:00
Caedis 22bf48c093 Potential fix for splash screen crashes (#363)
* Move framebuffer static initializor to getter

* missed one

* Revert "missed one"

This reverts commit 97027c1372.

* Revert "Move framebuffer static initializor to getter"

This reverts commit 6ef65735ff.

* Initialize HudCaching on world join

* run it on the client only

* remove unused imports
2024-03-08 12:40:51 -06:00
Caedis 4600bca2d0 Mixin to override FOV multiplier instead of using the forge event (#361)
* Mixin to speed check instead of using fov event

* scratch that, override return value entirely

* Revert "scratch that, override return value entirely"

This reverts commit 20a379d766.

* Revert "Mixin to speed check instead of using fov event"

This reverts commit 22db36d677.

* Change to lowest priority event so it is ran last (hopefully)
2024-03-08 10:26:34 -06:00
Jason Mitchell fcb9536d93 Don't blacklist gregtech from the render thread (#356) 2024-03-03 15:20:04 -08:00
28 changed files with 149 additions and 84 deletions

No files matched your search

+4 -1
View File
@@ -1,4 +1,7 @@
# Angelica
# Angelica<img src="img/logo-readme.png" align="right">
<sup>**[CurseForge](https://www.curseforge.com/minecraft/mc-mods/angelica) | [Modrinth](https://modrinth.com/mod/angelica)**</sup>
* The little Angle [sic] that supports shaders while saving your fps from a certain death -boubou
* Is it obtuse, or accute? -Caedis
* It's a cute angle -mitchej123
+4 -4
View File
@@ -132,7 +132,7 @@ usesMavenPublishing = true
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
modrinthProjectId = angelica
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
@@ -141,13 +141,13 @@ modrinthProjectId =
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
modrinthRelations = required-project:gtnhlib;required-project:unimixins
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
curseForgeProjectId = 988067
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
@@ -155,7 +155,7 @@ curseForgeProjectId =
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
curseForgeRelations = requiredDependency:gtnhlib;requiredDependency:unimixins
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
magick convert logo-1x.png -scale 200% \( +clone -background black -shadow 60x6+0+0 \) +swap -background none -layers merge logo-readme.png
+1 -1
View File
@@ -16,5 +16,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.18'
}
@@ -24,8 +24,8 @@ public class VertexFormatElement {
this.byteSize = type.getSize() * count;
}
public void setupBufferState(long l, int i) {
this.usage.setupBufferState(this.count, this.type.getGlType(), i, l, this.index);
public void setupBufferState(long offset, int stride) {
this.usage.setupBufferState(this.count, this.type.getGlType(), stride, offset, this.index);
}
public void clearBufferState() {
@@ -33,32 +33,32 @@ public class VertexFormatElement {
}
public enum Usage {
POSITION("Position", (i, j, k, l, m) -> {
GL11.glVertexPointer(i, j, k, l);
POSITION("Position", (size, type, stride, pointer, index) -> {
GL11.glVertexPointer(size, type, stride, pointer);
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
}, (i) -> GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY)),
NORMAL("Normal", (i, j, k, l, m) -> {
GL11.glNormalPointer(j, k, l);
}, index -> GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY)),
NORMAL("Normal", (size, type, stride, pointer, index) -> {
GL11.glNormalPointer(type, stride, pointer);
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
}, (i) -> GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY)),
COLOR("Vertex Color", (i, j, k, l, m) -> {
GL11.glColorPointer(i, j, k, l);
}, index -> GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY)),
COLOR("Vertex Color", (size, type, stride, pointer, index) -> {
GL11.glColorPointer(size, type, stride, pointer);
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
}, i -> GL11.glDisableClientState(GL11.GL_COLOR_ARRAY)),
UV("UV", (i, j, k, l, m) -> {
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + m);
GL11.glTexCoordPointer(i, j, k, l);
}, index -> GL11.glDisableClientState(GL11.GL_COLOR_ARRAY)),
UV("UV", (size, type, stride, pointer, index) -> {
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + index);
GL11.glTexCoordPointer(size, type, stride, pointer);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GL13.glClientActiveTexture(GL13.GL_TEXTURE0);
}, i -> {
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + i);
}, index -> {
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + index);
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GL13.glClientActiveTexture(GL13.GL_TEXTURE0);
}),
PADDING("Padding", (i, j, k, l, m) -> {}, i-> {}),
GENERIC("Generic", (i, j, k, l, m) -> {
GL20.glEnableVertexAttribArray(m);
GL20.glVertexAttribPointer(m, i, j, false, k, l);
PADDING("Padding", (size, type, stride, pointer, index) -> {}, index-> {}),
GENERIC("Generic", (size, type, stride, pointer, index) -> {
GL20.glEnableVertexAttribArray(index);
GL20.glVertexAttribPointer(index, size, type, false, stride, pointer);
}, GL20::glDisableVertexAttribArray);
@Getter private final String name;
@@ -71,16 +71,16 @@ public class VertexFormatElement {
this.clearState = clearState;
}
private void setupBufferState(int i, int j, int k, long l, int m) {
this.setupState.setupBufferState(i, j, k, l, m);
private void setupBufferState(int size, int type, int stride, long pointer, int index) {
this.setupState.setupBufferState(size, type, stride, pointer, index);
}
public void clearBufferState(int i) {
this.clearState.accept(i);
public void clearBufferState(int index) {
this.clearState.accept(index);
}
interface SetupState {
void setupBufferState(int i, int j, int k, long l, int m);
void setupBufferState(int size, int type, int stride, long pointer, int index);
}
}
@@ -3,6 +3,8 @@ package com.gtnewhorizons.angelica.hudcaching;
import java.util.ArrayList;
import java.util.List;
import cpw.mods.fml.common.eventhandler.EventPriority;
import net.minecraftforge.event.world.WorldEvent;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL30;
@@ -27,16 +29,14 @@ import net.minecraft.client.shader.Framebuffer;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.client.GuiIngameForge;
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
// See LICENSE+HUDCaching.md for license information.
public class HUDCaching {
private static final Minecraft mc = Minecraft.getMinecraft();
public static Framebuffer framebuffer;
static {
framebuffer = new Framebuffer(0, 0, true);
framebuffer.setFramebufferColor(0, 0, 0, 0);
}
private static boolean dirty = true;
public static boolean renderingCacheOverride;
@@ -63,9 +63,13 @@ public class HUDCaching {
private final List<Long> updateTimeList = new ArrayList<>(21);
private static boolean isEnabled = true;
private static final KeyBinding toggle = new KeyBinding("Toggle HUDCaching", 0, "Debug");
// moved initialization to when its registered to avoid an empty Debug category, which can cause crashes when
// opening the controls menu and hudcaching is disabled in the config
private static KeyBinding toggle;
public static void registerKeyBindings() {
toggle = new KeyBinding("Toggle HUDCaching", 0, "Debug");
ClientRegistry.registerKeyBinding(toggle);
}
@@ -86,7 +90,7 @@ public class HUDCaching {
@SubscribeEvent
public void onKeypress(InputEvent.KeyInputEvent event) {
if (toggle.isPressed()) {
if (toggle != null && toggle.isPressed()) {
isEnabled = !isEnabled;
final String msg = isEnabled ? "Enabled HUDCaching" : "Disabled HUDCaching";
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(msg));
@@ -102,10 +106,20 @@ public class HUDCaching {
}
}
// highest so it runs before the GLSM load event
@SubscribeEvent(priority = EventPriority.HIGH)
public void onJoinWorld(WorldEvent.Load event) {
if (event.world.isRemote){
LOGGER.info("World loaded - Initializing HUDCaching");
HUDCaching.framebuffer = new Framebuffer(0, 0, true);
HUDCaching.framebuffer.setFramebufferColor(0, 0, 0, 0);
}
}
@SuppressWarnings("unused")
public static void renderCachedHud(EntityRenderer renderer, GuiIngame ingame, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
if (!OpenGlHelper.isFramebufferEnabled() || !isEnabled) {
if (!OpenGlHelper.isFramebufferEnabled() || !isEnabled || framebuffer == null) {
ingame.renderGameOverlay(partialTicks, hasScreen, mouseX, mouseY);
return;
}
@@ -1,9 +1,13 @@
package com.gtnewhorizons.angelica.mixins.early.angelica;
import com.gtnewhorizons.angelica.rendering.RenderingState;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import jss.notfine.core.Settings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.WorldProvider;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -22,4 +26,9 @@ public abstract class MixinEntityRenderer {
viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks
);
}
@WrapOperation(method = "setupFog", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldProvider;getWorldHasVoidParticles()Z"))
private boolean angelica$wrapVoidFog(WorldProvider provider, Operation<Boolean> original){
return ((boolean)Settings.VOID_FOG.option.getStore()) ? original.call(provider) : false;
}
}
@@ -25,11 +25,6 @@ public class MixinMinecraft {
}
}
@Redirect(method="runGameLoop", at=@At(value="FIELD", target="Lnet/minecraft/client/renderer/WorldRenderer;chunksUpdated:I", ordinal=0))
private int sodium$chunksUpdated() {
return ((IRenderGlobalExt)this.renderGlobal).getChunksSubmitted();
}
@Redirect(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z"))
private boolean sodium$overrideFancyGrass(GameSettings gameSettings) {
return SodiumClientMod.options().quality.grassQuality.isFancy();
@@ -60,11 +60,6 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
this.renderer.scheduleTerrainUpdate();
}
@Override
public int getChunksSubmitted() {
return this.renderer.getChunksSubmitted();
}
@Inject(method="<init>", at=@At("RETURN"))
private void sodium$initRenderer(Minecraft mc, CallbackInfo ci) {
this.renderer = SodiumWorldRenderer.create(mc);
@@ -2,6 +2,5 @@ package com.gtnewhorizons.angelica.mixins.interfaces;
public interface IRenderGlobalExt {
void scheduleTerrainUpdate();
int getChunksSubmitted();
}
@@ -78,13 +78,15 @@ public class ClientProxy extends CommonProxy {
LOGGER.info("World loaded - Enabling GLSM Cache");
}
// Register all blocks. Because blockids are unique to a world, this must be done each load
GameData.getBlockRegistry().forEach(o -> {
final Block b = (Block) o;
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
});
if(AngelicaConfig.enableSodium) {
// Register all blocks. Because blockids are unique to a world, this must be done each load
GameData.getBlockRegistry().forEach(o -> {
final Block b = (Block) o;
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
});
}
}
@@ -210,9 +212,9 @@ public class ClientProxy extends CommonProxy {
event.left.set(i + 4, String.format("lc: %d b: %s bl: %d sl: %d rl: %d",
chunk.getTopFilledSegment() + 15,
chunk.getBiomeGenForWorldCoords(bX & 15, bZ & 15, mc.theWorld.getWorldChunkManager()).biomeName,
chunk.getSavedLightValue(EnumSkyBlock.Block, bX & 15, bY, bZ & 15),
chunk.getSavedLightValue(EnumSkyBlock.Sky, bX & 15, bY, bZ & 15),
chunk.getBlockLightValue(bX & 15, bY, bZ & 15, 0)));
chunk.getSavedLightValue(EnumSkyBlock.Block, bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15),
chunk.getSavedLightValue(EnumSkyBlock.Sky, bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15),
chunk.getBlockLightValue(bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15, 0)));
}
}
event.setCanceled(true);
@@ -276,7 +278,8 @@ public class ClientProxy extends CommonProxy {
}
}
@SubscribeEvent
// This is a bit of a hack to prevent the FOV from being modified by other mods
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onFOVModifierUpdate(FOVUpdateEvent event) {
if (!(boolean)Settings.DYNAMIC_FOV.option.getStore()){
event.newfov = 1.0F;
@@ -37,7 +37,9 @@ public class AngelicaBlockSafetyRegistry {
&& (isbrh.getClass().isAnnotationPresent(ThreadSafeISBRH.class)
|| isbrh instanceof ThreadSafeISBRHFactory);
} else {
canBeOffThread = !(block.getClass().getName().startsWith("gregtech.")) && !(block.getClass().getName().startsWith("com.github.bartimaeusnek."));
// Check blacklist here
// !(block.getClass().getName().startsWith("com.github.bartimaeusnek."));
canBeOffThread = true;
}
final long stamp = LOCK.writeLock();
@@ -21,10 +21,10 @@ public class AnimationsRenderUtils {
if (textureAtlasSprite != null && textureAtlasSprite.hasAnimationMetadata()) {
// null if called by anything but chunk render cache update (for example to get blocks rendered as items in
// inventory)
if (blockAccess instanceof ITexturesCache) {
((ITexturesCache) blockAccess).getRenderedTextures().add(textureAtlasSprite);
} else {
((IPatchedTextureAtlasSprite) textureAtlasSprite).markNeedsAnimationUpdate();
if (blockAccess instanceof ITexturesCache texturesCache) {
texturesCache.getRenderedTextures().add(textureAtlasSprite);
} else if(textureAtlasSprite instanceof IPatchedTextureAtlasSprite patchedSprite){
patchedSprite.markNeedsAnimationUpdate();
}
}
}
+2 -1
View File
@@ -113,7 +113,8 @@ public enum Settings {
public void applyChanges() {
RenderStars.reloadStarRenderList(Minecraft.getMinecraft().renderGlobal);
}
};
},
VOID_FOG(new NotFineOptionTickBox(false, OptionImpact.LOW));
public final NotFineOption option;
@@ -162,6 +162,7 @@ public class NotFineGameOptionPages {
.add(Settings.CLOUD_SCALE.option)
.add(Settings.MODE_CLOUD_TRANSLUCENCY.option)
.add(Settings.TOTAL_STARS.option)
.add(Settings.VOID_FOG.option)
.build());
return new OptionPage(I18n.format("options.button.sky"), ImmutableList.copyOf(groups));
}
@@ -1,10 +1,12 @@
package me.jellysquid.mods.sodium.client.gl.device;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
public interface DrawCommandList extends AutoCloseable {
void multiDrawArrays(IntBuffer first, IntBuffer count);
void multiDrawArraysIndirect(ByteBuffer pointer, int count, int stride);
void multiDrawArraysIndirect(long pointer, int count, int stride);
void endTessellating();
@@ -197,6 +197,12 @@ public class GLRenderDevice implements RenderDevice {
GL14.glMultiDrawArrays(primitiveType.getId(), first, count);
}
@Override
public void multiDrawArraysIndirect(ByteBuffer pointer, int count, int stride) {
final GlPrimitiveType primitiveType = GLRenderDevice.this.activeTessellation.getPrimitiveType();
GlFunctions.INDIRECT_DRAW.glMultiDrawArraysIndirect(primitiveType.getId(), pointer, count, stride);
}
@Override
public void multiDrawArraysIndirect(long pointer, int count, int stride) {
final GlPrimitiveType primitiveType = GLRenderDevice.this.activeTessellation.getPrimitiveType();
@@ -1,23 +1,40 @@
package me.jellysquid.mods.sodium.client.gl.func;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.ARBMultiDrawIndirect;
import org.lwjgl.opengl.ContextCapabilities;
import org.lwjgl.opengl.GL43;
public enum GlIndirectMultiDrawFunctions {
CORE {
@Override
public void glMultiDrawArraysIndirect(int mode, ByteBuffer indirect, int primcount, int stride) {
GL43.glMultiDrawArraysIndirect(mode, indirect, primcount, stride);
}
@Override
public void glMultiDrawArraysIndirect(int mode, long indirect, int primcount, int stride) {
GL43.glMultiDrawArraysIndirect(mode, indirect, primcount, stride);
}
},
ARB {
@Override
public void glMultiDrawArraysIndirect(int mode, ByteBuffer indirect, int primcount, int stride) {
ARBMultiDrawIndirect.glMultiDrawArraysIndirect(mode, indirect, primcount, stride);
}
@Override
public void glMultiDrawArraysIndirect(int mode, long indirect, int primcount, int stride) {
ARBMultiDrawIndirect.glMultiDrawArraysIndirect(mode, indirect, primcount, stride);
}
},
UNSUPPORTED {
@Override
public void glMultiDrawArraysIndirect(int mode, ByteBuffer indirect, int primcount, int stride) {
throw new UnsupportedOperationException();
}
@Override
public void glMultiDrawArraysIndirect(int mode, long indirect, int primcount, int stride) {
throw new UnsupportedOperationException();
@@ -34,5 +51,7 @@ public enum GlIndirectMultiDrawFunctions {
}
}
public abstract void glMultiDrawArraysIndirect(int mode, ByteBuffer indirect, int primcount, int stride);
public abstract void glMultiDrawArraysIndirect(int mode, long indirect, int primcount, int stride);
}
@@ -89,14 +89,15 @@ public class SodiumGameOptionPages {
.setBinding((opts, value) -> opts.clouds = value, (opts) -> opts.clouds)
.setImpact(OptionImpact.LOW)
.build());
firstGroupBuilder.add(Settings.VOID_FOG.option);
groups.add(firstGroupBuilder.build());
int maxGuiScale = Math.max(3, Math.min(Minecraft.getMinecraft().displayWidth / 320, Minecraft.getMinecraft().displayHeight / 240));
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(int.class, vanillaOpts)
.setName(I18n.format("options.guiScale"))
.setTooltip(I18n.format("sodium.options.gui_scale.tooltip"))
.setControl(option -> new SliderControl(option, 0, 3, 1, ControlValueFormatter.guiScale()))
.setControl(option -> new SliderControl(option, 0, maxGuiScale, 1, ControlValueFormatter.guiScale()))
.setBinding((opts, value) -> {
opts.guiScale = value;
// Resizing our window
@@ -124,10 +124,6 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
}
}
public int getChunksSubmitted() {
return this.chunkRenderManager != null ? this.chunkRenderManager.getAndResetSubmitted() : 0;
}
private void loadWorld(WorldClient world) {
this.world = world;
@@ -37,6 +37,7 @@ import me.jellysquid.mods.sodium.common.util.IdTable;
import me.jellysquid.mods.sodium.common.util.collections.FutureDequeDrain;
import net.coderbot.iris.shadows.ShadowRenderingState;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraftforge.common.util.ForgeDirection;
@@ -97,7 +98,6 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
@Getter
private int submitted;
private int totalSubmitted;
private final boolean translucencySorting;
@@ -580,7 +580,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
sortedAnything = true;
submitted++;
}
totalSubmitted += submitted;
WorldRenderer.chunksUpdated += submitted;
this.dirty |= submitted > 0;
@@ -596,13 +596,6 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
}
}
public int getAndResetSubmitted() {
// Return how many chunks were submitted since the last call to this method
final int submitted = totalSubmitted;
totalSubmitted = 0;
return submitted;
}
public void markDirty() {
this.dirty = true;
}
@@ -42,6 +42,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.Util;
import org.lwjgl.opengl.GL11;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
@@ -238,20 +239,39 @@ public class MultidrawChunkRenderBackend extends ChunkRenderShaderBackend<Multid
commandList.uploadData(this.commandBuffer, this.commandClientBufferBuilder.getBuffer());
}
long pointer = this.commandBuffer == null ? this.commandClientBufferBuilder.getBufferAddress() : 0L;
long pointer = 0L;
ByteBuffer pointerBuffer;
int originalPointerBufferPos = 0;
if (this.commandBuffer != null) {
pointerBuffer = null;
} else {
pointerBuffer = this.commandClientBufferBuilder.getBuffer();
originalPointerBufferPos = pointerBuffer.position();
}
for (ChunkRegion<?> region : this.pendingBatches) {
final ChunkDrawCallBatcher batch = region.getDrawBatcher();
if (!batch.isEmpty()) {
try (DrawCommandList drawCommandList = commandList.beginTessellating(region.getTessellation())) {
drawCommandList.multiDrawArraysIndirect(pointer, batch.getCount(), 0 /* tightly packed */);
if(pointerBuffer == null) {
drawCommandList.multiDrawArraysIndirect(pointer, batch.getCount(), 0 /* tightly packed */);
} else {
drawCommandList.multiDrawArraysIndirect(pointerBuffer, batch.getCount(), 0 /* tightly packed */);
}
}
}
pointer += batch.getArrayLength();
if(pointerBuffer == null) {
pointer += batch.getArrayLength();
} else {
pointerBuffer.position(pointerBuffer.position() + batch.getArrayLength());
}
}
if (pointerBuffer != null)
pointerBuffer.position(originalPointerBufferPos);
this.pendingBatches.clear();
}
@@ -52,3 +52,4 @@ options.title.particle=Partikeleinstellungen
options.title.sky=Atmosphäreneinstellungen
options.title.video=Grafikeinstellungen
options.total_stars=Sternendichte
options.void_fog=Void Fog
@@ -36,3 +36,4 @@ options.title.particle=Particle Settings
options.title.sky=Atmosphere Settings
options.title.video=Video Settings
options.total_stars=Star Density
options.void_fog=Void Fog
@@ -66,3 +66,4 @@ options.title.particle=Ustawienia cząsteczek
options.title.sky=Ustawienia atmosfery
options.title.video=Ustawienia graficzne
options.total_stars=Gęstość gwiazd
options.void_fog=Void Fog
@@ -36,3 +36,4 @@ options.title.particle=粒子设置
options.title.sky=大气设置
options.title.video=视频设置
options.total_stars=星星密度
options.void_fog=Void Fog