mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-27 23:46:01 +00:00
Add display list compilation/optimization (#1141)
This commit is contained in:
1 parent
55811b9d7b
commit
33de1de9c4
118 files changed
+11342
-670
No files matched your search
+2
-1
@@ -4,6 +4,7 @@ import com.gtnewhorizons.angelica.client.gui.FontConfigScreen;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.Element;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import jss.notfine.gui.GuiCustomMenu;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.flashyreese.mods.reeses_sodium_options.client.gui.frame.AbstractFrame;
|
||||
import me.flashyreese.mods.reeses_sodium_options.client.gui.frame.BasicFrame;
|
||||
import me.flashyreese.mods.reeses_sodium_options.client.gui.frame.components.SearchTextFieldComponent;
|
||||
@@ -104,7 +105,7 @@ public class ReeseSodiumVideoOptionsScreen extends SodiumOptionsGUI {
|
||||
|
||||
int cumulativeXShift = 0;
|
||||
|
||||
if (AngelicaConfig.enableIris) {
|
||||
if (Iris.enabled) {
|
||||
//int size = this.client.textRenderer.getWidth(new TranslatableText(IrisApi.getInstance().getMainScreenLanguageKey()));
|
||||
final String irisText = I18n.format(IrisApi.getInstance().getMainScreenLanguageKey());
|
||||
final int size = this.mc.fontRenderer.getStringWidth(irisText);
|
||||
|
||||
@@ -2,6 +2,7 @@ package me.jellysquid.mods.sodium.client.gui;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import jss.notfine.core.Settings;
|
||||
import jss.notfine.core.SettingsManager;
|
||||
@@ -52,7 +53,7 @@ public class SodiumGameOptionPages {
|
||||
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
|
||||
.build());
|
||||
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
final OptionImpl<GameSettings, Integer> maxShadowDistanceSlider = OptionImpl.createBuilder(int.class, vanillaOpts)
|
||||
.setName(I18n.format("options.iris.shadowDistance"))
|
||||
.setTooltip(I18n.format("options.iris.shadowDistance.sodium_tooltip"))
|
||||
@@ -264,8 +265,8 @@ public class SodiumGameOptionPages {
|
||||
)*/
|
||||
.add(Settings.MODE_SHADOWS.option)
|
||||
.add(Settings.MODE_VIGNETTE.option)
|
||||
.add(Settings.DYNAMIC_LIGHTS.option, AngelicaConfig.enableDynamicLights)
|
||||
.add(Settings.DYNAMIC_LIGHTS_SHADER_FORCE.option, AngelicaConfig.enableDynamicLights)
|
||||
.add(Settings.DYNAMIC_LIGHTS.option, DynamicLights.configEnabled)
|
||||
.add(Settings.DYNAMIC_LIGHTS_SHADER_FORCE.option, DynamicLights.configEnabled)
|
||||
.build());
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.GraphicsQuality;
|
||||
import net.coderbot.iris.Iris;
|
||||
@@ -105,7 +104,7 @@ public class SodiumGameOptions {
|
||||
}
|
||||
|
||||
Files.write(this.configPath, GSON.toJson(this).getBytes(StandardCharsets.UTF_8));
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
try {
|
||||
if (Iris.getIrisConfig() != null) {
|
||||
Iris.getIrisConfig().save();
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.gtnewhorizons.angelica.client.gui.ScrollableGuiScreen;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.Drawable;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.Element;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import jss.notfine.gui.GuiCustomMenu;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.Option;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionFlag;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionGroup;
|
||||
@@ -61,14 +61,14 @@ public class SodiumOptionsGUI extends ScrollableGuiScreen {
|
||||
this.pages.add(SodiumGameOptionPages.advanced());
|
||||
this.pages.add(SodiumGameOptionPages.performance());
|
||||
|
||||
if (AngelicaConfig.enableIris) {
|
||||
if (Iris.enabled) {
|
||||
shaderPacks = new OptionPage(I18n.format("options.iris.shaderPackSelection"), ImmutableList.of());
|
||||
this.pages.add(shaderPacks);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPage(OptionPage page) {
|
||||
if (AngelicaConfig.enableIris && page == shaderPacks) {
|
||||
if (Iris.enabled && page == shaderPacks) {
|
||||
mc.displayGuiScreen(new ShaderPackScreen(this));
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ import com.gtnewhorizon.gtnhlib.blockpos.BlockPos;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.ModelQuadView;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFlags;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import java.util.Arrays;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightPipeline;
|
||||
import me.jellysquid.mods.sodium.client.model.light.data.LightDataAccess;
|
||||
import me.jellysquid.mods.sodium.client.model.light.data.QuadLightData;
|
||||
@@ -45,7 +45,7 @@ public class FlatLightPipeline implements LightPipeline {
|
||||
}
|
||||
|
||||
Arrays.fill(out.lm, lightmap);
|
||||
final float brightness = (AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldDisableDirectionalShading())
|
||||
final float brightness = (Iris.enabled && BlockRenderingSettings.INSTANCE.shouldDisableDirectionalShading())
|
||||
? 1.0F : this.lightCache.getWorld().getBrightness(face, shade);
|
||||
Arrays.fill(out.br, brightness);
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import com.gtnewhorizon.gtnhlib.blockpos.BlockPos;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.ModelQuadView;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFlags;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightPipeline;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.jellysquid.mods.sodium.client.model.light.data.LightDataAccess;
|
||||
import me.jellysquid.mods.sodium.client.model.light.data.QuadLightData;
|
||||
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
|
||||
@@ -226,7 +226,7 @@ public class SmoothLightPipeline implements LightPipeline {
|
||||
}
|
||||
|
||||
private void applySidedBrightness(QuadLightData out, ModelQuadFacing face, boolean shade) {
|
||||
if(AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldDisableDirectionalShading()) {
|
||||
if(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldDisableDirectionalShading()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package me.jellysquid.mods.sodium.client.render;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.bytebuf.MemoryStack;
|
||||
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import net.coderbot.iris.Iris;
|
||||
import java.nio.FloatBuffer;
|
||||
import net.coderbot.iris.shadows.ShadowRenderingState;
|
||||
import org.joml.Matrix4f;
|
||||
@@ -18,7 +18,7 @@ public class GameRendererContext {
|
||||
*/
|
||||
public static FloatBuffer getModelViewProjectionMatrix(MatrixStack.Entry matrices, MemoryStack stack) {
|
||||
final FloatBuffer bufModelViewProjection = stack.mallocFloat(16);
|
||||
final Matrix4f projectionMatrix = (AngelicaConfig.enableIris && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) ? ShadowRenderingState.getShadowOrthoMatrix() : RenderingState.INSTANCE.getProjectionMatrix();
|
||||
final Matrix4f projectionMatrix = (Iris.enabled && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) ? ShadowRenderingState.getShadowOrthoMatrix() : RenderingState.INSTANCE.getProjectionMatrix();
|
||||
final Matrix4f matrix = new Matrix4f(projectionMatrix);
|
||||
matrix.mul(matrices.getModel());
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package me.jellysquid.mods.sodium.client.render;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.Camera;
|
||||
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
|
||||
import com.gtnewhorizons.angelica.compat.toremove.RenderLayer;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
|
||||
import net.coderbot.iris.Iris;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
||||
@@ -171,7 +171,7 @@ public class SodiumWorldRenderer {
|
||||
*/
|
||||
public void scheduleTerrainUpdate() {
|
||||
if (this.chunkRenderManager != null) {
|
||||
if(AngelicaConfig.enableIris) iris$ensureStateSwapped();
|
||||
if(Iris.enabled) iris$ensureStateSwapped();
|
||||
this.chunkRenderManager.markDirty();
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class SodiumWorldRenderer {
|
||||
boolean dirty = pos.x != this.lastCameraX || pos.y != this.lastCameraY || pos.z != this.lastCameraZ ||
|
||||
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fogDistance != this.lastFogDistance || fov != this.lastFov;
|
||||
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
iris$ensureStateSwapped();
|
||||
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
dirty = true;
|
||||
@@ -258,7 +258,7 @@ public class SodiumWorldRenderer {
|
||||
profiler.endSection();
|
||||
|
||||
SodiumGameOptions.EntityRenderDistance.setRenderDistanceMult(MathHelper.clamp_double((double) this.client.gameSettings.renderDistanceChunks / 8.0D, 1.0D, 2.5D) * (double) 1.0F * (SettingsManager.entityRenderScaleFactor));
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
ShadowRenderer.visibleTileEntities.addAll(this.chunkRenderManager.getVisibleTileEntities());
|
||||
ShadowRenderer.globalTileEntities.addAll(this.globalTileEntities);
|
||||
@@ -279,7 +279,7 @@ public class SodiumWorldRenderer {
|
||||
// or other factors as having clouds disabled.
|
||||
GLStateManager.enableCull();
|
||||
|
||||
if(AngelicaConfig.enableIris) iris$ensureStateSwapped();
|
||||
if(Iris.enabled) iris$ensureStateSwapped();
|
||||
// startDrawing/endDrawing are handled by 1.7 already
|
||||
// pass.startDrawing();
|
||||
|
||||
@@ -318,7 +318,7 @@ public class SodiumWorldRenderer {
|
||||
|
||||
final ChunkVertexType vertexFormat;
|
||||
|
||||
if(AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
if(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
vertexFormat = IrisModelVertexFormats.MODEL_VERTEX_XHFP;
|
||||
} else if (opts.advanced.useCompactVertexFormat) {
|
||||
vertexFormat = DefaultModelVertexFormats.MODEL_VERTEX_HFP;
|
||||
@@ -358,7 +358,7 @@ public class SodiumWorldRenderer {
|
||||
return;
|
||||
|
||||
try {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
final Block block = tileEntity.getWorldObj().getBlock(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
CapturedRenderingState.INSTANCE.setCurrentBlockEntity(Block.getIdFromBlock(block));
|
||||
GL20.glVertexAttrib2s(ProgramCreator.MC_ENTITY, (short)-1, (short)-1);
|
||||
@@ -376,7 +376,7 @@ public class SodiumWorldRenderer {
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
CapturedRenderingState.INSTANCE.setCurrentBlockEntity(-1);
|
||||
GbufferPrograms.endBlockEntities();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package me.jellysquid.mods.sodium.client.render.chunk;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.Camera;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.ChunkPos;
|
||||
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
|
||||
import net.coderbot.iris.Iris;
|
||||
import it.unimi.dsi.fastutil.ints.IntIterator;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
@@ -152,7 +152,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
|
||||
this.useBlockFaceCulling = SodiumClientMod.options().advanced.useBlockFaceCulling;
|
||||
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
this.chunkRenderListsSwap = new ChunkRenderList[BlockRenderPass.COUNT];
|
||||
this.tickableChunksSwap = new ObjectArrayList<>();
|
||||
this.visibleTileEntitiesSwap = new ObjectArrayList<>();
|
||||
@@ -252,7 +252,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
private void addChunk(ChunkRenderContainer<T> render) {
|
||||
boolean canRebuild = render.canRebuild();
|
||||
|
||||
if (AngelicaConfig.enableIris && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
if (Iris.enabled && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
canRebuild = false;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
}
|
||||
|
||||
private int computeVisibleFaces(ChunkRenderContainer<T> render) {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
// TODO: Enable chunk face culling during the shadow pass
|
||||
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
return(ChunkFaceFlags.ALL);
|
||||
@@ -366,9 +366,9 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
}
|
||||
|
||||
private void reset() {
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.rebuildQueue.clear();
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.importantRebuildQueue.clear();
|
||||
if(!AngelicaConfig.enableIris || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.sortQueue.clear();
|
||||
if(!Iris.enabled || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.rebuildQueue.clear();
|
||||
if(!Iris.enabled || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.importantRebuildQueue.clear();
|
||||
if(!Iris.enabled || !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) this.sortQueue.clear();
|
||||
|
||||
this.visibleTileEntities.clear();
|
||||
|
||||
@@ -510,7 +510,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
|
||||
final RenderDevice device = RenderDevice.INSTANCE;
|
||||
final CommandList commandList = device.createCommandList();
|
||||
if(AngelicaConfig.enableIris) this.backend.iris$begin(matrixStack, pass);
|
||||
if(Iris.enabled) this.backend.iris$begin(matrixStack, pass);
|
||||
else this.backend.begin(matrixStack);
|
||||
|
||||
// Ensure multidraw regions are ordered appropriately
|
||||
@@ -534,7 +534,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
}
|
||||
|
||||
public void updateChunks() {
|
||||
if (AngelicaConfig.enableIris && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) return;
|
||||
if (Iris.enabled && ShadowRenderingState.areShadowsCurrentlyBeingRendered()) return;
|
||||
this.builder.cleanupSectionCache();
|
||||
|
||||
Deque<CompletableFuture<ChunkBuildResult<T>>> futures = new ArrayDeque<>();
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.backends.multidraw;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayFIFOQueue;
|
||||
import net.coderbot.iris.Iris;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
@@ -196,7 +196,7 @@ public class MultidrawChunkRenderBackend extends ChunkRenderShaderBackend<Multid
|
||||
}
|
||||
|
||||
private GlVertexAttributeBinding[] getBindings() {
|
||||
if(AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
if(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
return new GlVertexAttributeBinding[] {
|
||||
new GlVertexAttributeBinding(ChunkShaderBindingPoints.POSITION, this.vertexFormat.getAttribute(ChunkMeshAttribute.POSITION)),
|
||||
new GlVertexAttributeBinding(ChunkShaderBindingPoints.COLOR, this.vertexFormat.getAttribute(ChunkMeshAttribute.COLOR)),
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.backends.oneshot;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import me.jellysquid.mods.sodium.client.gl.attribute.GlVertexAttributeBinding;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.jellysquid.mods.sodium.client.gl.attribute.GlVertexFormat;
|
||||
import me.jellysquid.mods.sodium.client.gl.buffer.GlBufferUsage;
|
||||
import me.jellysquid.mods.sodium.client.gl.buffer.GlMutableBuffer;
|
||||
@@ -87,7 +87,7 @@ public class ChunkOneshotGraphicsState extends ChunkGraphicsState {
|
||||
}
|
||||
|
||||
private GlVertexAttributeBinding[] getBindings(GlVertexFormat<ChunkMeshAttribute> vertexFormat) {
|
||||
if(AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
if(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseExtendedVertexFormat()) {
|
||||
return new GlVertexAttributeBinding[] {
|
||||
new GlVertexAttributeBinding(ChunkShaderBindingPoints.POSITION, vertexFormat.getAttribute(ChunkMeshAttribute.POSITION)),
|
||||
new GlVertexAttributeBinding(ChunkShaderBindingPoints.COLOR, vertexFormat.getAttribute(ChunkMeshAttribute.COLOR)),
|
||||
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.compile;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import net.coderbot.iris.Iris;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
@@ -59,7 +59,7 @@ public class ChunkBuildBuffers implements ChunkBuildBuffersExt {
|
||||
}
|
||||
}
|
||||
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
final Object2IntMap<Block> blockMatches = BlockRenderingSettings.INSTANCE.getBlockMatches();
|
||||
|
||||
if (blockMatches != null) {
|
||||
@@ -76,7 +76,7 @@ public class ChunkBuildBuffers implements ChunkBuildBuffersExt {
|
||||
|
||||
for (ModelQuadFacing facing : ModelQuadFacing.VALUES) {
|
||||
final ModelVertexSink sink = this.vertexType.createBufferWriter(this.buffersByLayer[i][facing.ordinal()], SodiumClientMod.isDirectMemoryAccessEnabled());
|
||||
if (AngelicaConfig.enableIris && sink instanceof ContextAwareVertexWriter) {
|
||||
if (Iris.enabled && sink instanceof ContextAwareVertexWriter) {
|
||||
((ContextAwareVertexWriter) sink).iris$setContextHolder(iris$contextHolder);
|
||||
}
|
||||
writers[facing.ordinal()] = new ChunkModelVertexTransformer(sink, this.offset);
|
||||
@@ -156,17 +156,17 @@ public class ChunkBuildBuffers implements ChunkBuildBuffersExt {
|
||||
|
||||
// Iris Compat
|
||||
public void iris$setLocalPos(int localPosX, int localPosY, int localPosZ) {
|
||||
if(!AngelicaConfig.enableIris) return;
|
||||
if(!Iris.enabled) return;
|
||||
this.iris$contextHolder.setLocalPos(localPosX, localPosY, localPosZ);
|
||||
}
|
||||
|
||||
public void iris$setMaterialId(Block block, short renderType) {
|
||||
if(!AngelicaConfig.enableIris) return;
|
||||
if(!Iris.enabled) return;
|
||||
this.iris$contextHolder.set(block, renderType);
|
||||
}
|
||||
|
||||
public void iris$resetBlockContext() {
|
||||
if(!AngelicaConfig.enableIris) return;
|
||||
if(!Iris.enabled) return;
|
||||
this.iris$contextHolder.reset();
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,7 +1,6 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.shader;
|
||||
|
||||
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import me.jellysquid.mods.sodium.client.gl.attribute.GlVertexFormat;
|
||||
import me.jellysquid.mods.sodium.client.gl.compat.FogHelper;
|
||||
@@ -52,7 +51,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
private ChunkProgram override;
|
||||
|
||||
public ChunkRenderShaderBackend(ChunkVertexType vertexType) {
|
||||
if (AngelicaConfig.enableIris) {
|
||||
if (Iris.enabled) {
|
||||
irisChunkProgramOverrides = new IrisChunkProgramOverrides();
|
||||
}
|
||||
|
||||
@@ -61,7 +60,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
}
|
||||
|
||||
public GlShader loadShaderRedirect(RenderDevice device, ShaderType type, ResourceLocation name, List<String> constants) {
|
||||
if (AngelicaConfig.enableIris && this.vertexType == IrisModelVertexFormats.MODEL_VERTEX_XHFP) {
|
||||
if (Iris.enabled && this.vertexType == IrisModelVertexFormats.MODEL_VERTEX_XHFP) {
|
||||
String shader = getShaderSource(ShaderLoader.getShaderPath(name, type));
|
||||
shader = shader.replace("v_LightCoord = a_LightCoord", "v_LightCoord = (iris_LightmapTextureMatrix * vec4(a_LightCoord, 0, 1)).xy");
|
||||
|
||||
@@ -78,7 +77,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
}
|
||||
|
||||
private ChunkProgram createShader(RenderDevice device, ChunkFogMode fogMode, GlVertexFormat<ChunkMeshAttribute> vertexFormat) {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
this.device = device;
|
||||
WorldRenderingPipeline worldRenderingPipeline = Iris.getPipelineManager().getPipelineNullable();
|
||||
SodiumTerrainPipeline sodiumTerrainPipeline = null;
|
||||
@@ -159,7 +158,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
@Override
|
||||
public void begin(MatrixStack matrixStack) {
|
||||
this.activeProgram = this.programs.get(FogHelper.getFogMode());
|
||||
if (AngelicaConfig.enableIris && override != null) {
|
||||
if (Iris.enabled && override != null) {
|
||||
this.activeProgram = override;
|
||||
}
|
||||
this.activeProgram.bind();
|
||||
@@ -170,7 +169,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
public void end(MatrixStack matrixStack) {
|
||||
this.activeProgram.unbind();
|
||||
this.activeProgram = null;
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
ProgramUniforms.clearActiveUniforms();
|
||||
ProgramSamplers.clearActiveSamplers();
|
||||
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::endSodiumTerrainRendering);
|
||||
@@ -179,7 +178,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
|
||||
|
||||
@Override
|
||||
public void delete() {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
if(Iris.enabled) {
|
||||
irisChunkProgramOverrides.deleteShaders();
|
||||
}
|
||||
for (ChunkProgram shader : this.programs.values()) {
|
||||
|
||||
+9
-8
@@ -6,6 +6,7 @@ import com.gtnewhorizons.angelica.compat.mojang.ChunkOcclusionDataBuilder;
|
||||
import com.gtnewhorizons.angelica.compat.toremove.RenderLayer;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
|
||||
import net.coderbot.iris.Iris;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaBlockSafetyRegistry;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
|
||||
import com.gtnewhorizons.angelica.utils.AnimationsRenderUtils;
|
||||
@@ -217,7 +218,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
pos.set(baseX + relX, baseY + relY, baseZ + relZ);
|
||||
buffers.setRenderOffset(pos.x - renderOffset.getX(), pos.y - renderOffset.getY(), pos.z - renderOffset.getZ());
|
||||
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setLocalPos(relX, relY, relZ);
|
||||
if(Iris.enabled) buffers.iris$setLocalPos(relX, relY, relZ);
|
||||
|
||||
if (rendersOffThread(block)) {
|
||||
// Do regular block rendering
|
||||
@@ -226,14 +227,14 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
if (ModStatus.isFluidLoggedLoaded) {
|
||||
if (fluid != null && canRenderInPass(fluid.getBlock(), pass)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(fluid.getBlock(), ExtendedDataHelper.FLUID_RENDER_TYPE);
|
||||
if(Iris.enabled) buffers.iris$setMaterialId(fluid.getBlock(), ExtendedDataHelper.FLUID_RENDER_TYPE);
|
||||
|
||||
cache.getBlockRenderer().renderFluidLogged(cache.getWorldSlice(), fluid, renderBlocks, pos, buffers.get(pass), seed);
|
||||
}
|
||||
}
|
||||
if (canRenderInPass(block, pass) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
if(Iris.enabled) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
|
||||
if (cache.getBlockRenderer().renderModel(cache.getWorldSlice(), renderBlocks, block, meta, pos, buffers.get(pass), true, seed)) {
|
||||
bounds.addBlock(relX, relY, relZ);
|
||||
@@ -251,7 +252,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (canRenderInPass(block, pass)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.FLUID_RENDER_TYPE);
|
||||
if(Iris.enabled) buffers.iris$setMaterialId(block, ExtendedDataHelper.FLUID_RENDER_TYPE);
|
||||
|
||||
if (cache.getFluidRenderer().render(slice, cache.getWorldSlice(), block, pos, buffers.get(pass))) {
|
||||
bounds.addBlock(relX, relY, relZ);
|
||||
@@ -260,7 +261,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
}
|
||||
}
|
||||
|
||||
if(AngelicaConfig.enableIris) buffers.iris$resetBlockContext();
|
||||
if(Iris.enabled) buffers.iris$resetBlockContext();
|
||||
|
||||
if (block.hasTileEntity(meta)) {
|
||||
final TileEntity entity = slice.getTileEntity(pos.x, pos.y, pos.z);
|
||||
@@ -355,14 +356,14 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
final int meta = slice.getBlockMetadataRelative(relX + 16, relY + 16, relZ + 16);
|
||||
|
||||
buffers.setRenderOffset(pos.x - renderOffset.getX(), pos.y - renderOffset.getY(), pos.z - renderOffset.getZ());
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setLocalPos(relX, relY, relZ);
|
||||
if(Iris.enabled) buffers.iris$setLocalPos(relX, relY, relZ);
|
||||
|
||||
// Do regular block rendering
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (canRenderInPass(block, pass) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
final long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
if(Iris.enabled) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
|
||||
if (cache.getBlockRenderer().renderModel(slice.getWorld(), rb, block, meta, pos, buffers.get(pass), true, seed)) {
|
||||
bounds.addBlock(relX, relY, relZ);
|
||||
@@ -370,7 +371,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
}
|
||||
}
|
||||
|
||||
if(AngelicaConfig.enableIris) buffers.iris$resetBlockContext();
|
||||
if(Iris.enabled) buffers.iris$resetBlockContext();
|
||||
}
|
||||
|
||||
if(rb instanceof ITexturesCache) {
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.ModelQuadViewMuta
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadOrientation;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.util.ModelQuadUtil;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import java.util.List;
|
||||
import net.coderbot.iris.Iris;
|
||||
import java.util.Random;
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightMode;
|
||||
@@ -97,7 +97,7 @@ public class BlockRenderer {
|
||||
|
||||
boolean rendered = false;
|
||||
|
||||
this.useSeparateAo = AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo();
|
||||
this.useSeparateAo = Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo();
|
||||
final int emitted = block.getLightValue(world, pos.x, pos.y, pos.z);
|
||||
|
||||
try {
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.ModelQuadView;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.ModelQuadViewMutable;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFacing;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.cel.model.quad.properties.ModelQuadFlags;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import java.util.Arrays;
|
||||
import net.coderbot.iris.Iris;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightMode;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightPipeline;
|
||||
import me.jellysquid.mods.sodium.client.model.light.LightPipelineProvider;
|
||||
@@ -89,7 +89,7 @@ public class FluidRenderer {
|
||||
}
|
||||
|
||||
public boolean render(IBlockAccess world, WorldSlice slice, Block block, BlockPos pos, ChunkModelBuffers buffers) {
|
||||
this.useSeparateAo = AngelicaConfig.enableIris && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo();
|
||||
this.useSeparateAo = Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo();
|
||||
|
||||
int posX = pos.x;
|
||||
int posY = pos.y;
|
||||
|
||||
Reference in new issue
Block a user