Update #24 - 1000s of optimizations, shared worlds on desktop

This commit is contained in:
lax1dude
2024-03-02 20:51:44 -08:00
parent a50c93cb75
commit 8ab65942c5
624 changed files with 8091 additions and 3620 deletions

View File

@ -11,7 +11,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL;
import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL;
import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL;

View File

@ -202,7 +202,7 @@ public class InstancedFontRenderer {
_wglVertexAttribDivisor(0, 0);
EaglercraftGPU.bindGLArrayBuffer(instancesBuffer);
_wglBufferData(GL_ARRAY_BUFFER, fontDataBuffer.remaining(), GL_STATIC_DRAW);
_wglBufferData(GL_ARRAY_BUFFER, fontDataBuffer.remaining(), GL_STREAM_DRAW);
_wglEnableVertexAttribArray(1);
_wglVertexAttribPointer(1, 2, GL_SHORT, false, 10, 0);

View File

@ -184,7 +184,7 @@ public class InstancedParticleRenderer {
_wglVertexAttribDivisor(0, 0);
EaglercraftGPU.bindGLArrayBuffer(instancesBuffer);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW);
_wglEnableVertexAttribArray(1);
_wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0);

View File

@ -4,8 +4,6 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL;
import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL;
import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL;

View File

@ -380,7 +380,7 @@ public class EaglerDeferredPipeline {
public void rebuild(EaglerDeferredConfig config) {
destroy();
DeferredStateManager.doCheckErrors = EagRuntime.getConfiguration().checkShaderGLErrors();
DeferredStateManager.doCheckErrors = EagRuntime.getConfiguration().isCheckShaderGLErrors();
DeferredStateManager.checkGLError("Pre: rebuild pipeline");
this.config = config;
this.currentWidth = -1;
@ -3302,7 +3302,7 @@ public class EaglerDeferredPipeline {
GlStateManager.bindTexture(bloomVBlurTexture);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE, GL_ZERO, GL_ONE);
GlStateManager.setBlendConstants(0.0f, 0.0f, 0.0f, 0.25f);
GlStateManager.setBlendConstants(0.0f, 0.0f, 0.0f, 0.15f);
TextureCopyUtil.blitTexture();
GlStateManager.disableBlend();

View File

@ -12,7 +12,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.PipelineShaderAccelParticleForward;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.PipelineShaderAccelParticleGBuffer;
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@ -92,7 +91,7 @@ public class ForwardAcceleratedEffectRenderer extends AbstractAcceleratedEffectR
_wglVertexAttribDivisor(0, 0);
EaglercraftGPU.bindGLArrayBuffer(instancesBuffer);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW);
_wglEnableVertexAttribArray(1);
_wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0);

View File

@ -91,7 +91,7 @@ public class GBufferAcceleratedEffectRenderer extends AbstractAcceleratedEffectR
_wglVertexAttribDivisor(0, 0);
EaglercraftGPU.bindGLArrayBuffer(instancesBuffer);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW);
_wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW);
_wglEnableVertexAttribArray(1);
_wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0);

View File

@ -4,12 +4,11 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ExtGLEnums.*;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL;
import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
@ -162,7 +161,7 @@ public class LensFlareMeshRenderer {
if(flareTex == null) {
throw new RuntimeException("Could not locate: " + streaksTextureLocation);
}
try(DataInputStream dis = new DataInputStream(new ByteArrayInputStream(flareTex))) {
try(DataInputStream dis = new DataInputStream(new EaglerInputStream(flareTex))) {
loadFlareTexture(copyBuffer, dis);
}catch(IOException ex) {
EagRuntime.freeByteBuffer(copyBuffer);
@ -175,7 +174,7 @@ public class LensFlareMeshRenderer {
if(flareTex == null) {
throw new RuntimeException("Could not locate: " + ghostsTextureLocation);
}
try(DataInputStream dis = new DataInputStream(new ByteArrayInputStream(flareTex))) {
try(DataInputStream dis = new DataInputStream(new EaglerInputStream(flareTex))) {
loadFlareTexture(copyBuffer, dis);
}catch(IOException ex) {
EagRuntime.freeByteBuffer(copyBuffer);

View File

@ -14,7 +14,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.minecraft.TextureAnimationCache;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.client.resources.data.AnimationFrame;
@ -187,11 +186,12 @@ public class EaglerTextureAtlasSpritePBR extends EaglerTextureAtlasSprite {
public String call() throws Exception {
StringBuilder stringbuilder = new StringBuilder();
for (int[] aint1 : aint) {
for (int k = 0; k < aint.length; ++k) {
if (stringbuilder.length() > 0) {
stringbuilder.append(", ");
}
int[] aint1 = aint[k];
stringbuilder.append(aint1 == null ? "null" : Integer.valueOf(aint1.length));
}

View File

@ -46,7 +46,8 @@ public class PBRTextureMapUtils {
}
try {
List<IResource> ress = resMgr.getAllResources(new ResourceLocation(domain, fname));
for(IResource res : ress) {
for(int k = 0, l = ress.size(); k < l; ++k) {
IResource res = ress.get(k);
if(res.getResourcePackName().equals(resourcePack)) {
ImageData toRet = TextureUtil.readBufferedImage(res.getInputStream());
if(ext.equals("_s")) {

View File

@ -1,7 +1,6 @@
package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture;
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;

View File

@ -1,7 +1,6 @@
package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture;
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;