Fix PBR specular & normal textures getting ignored (#874)

* Fix PBR textures not loading

- Stack was being overfilled by MemoryStack
- Added tons of logging for ignored important exceptions
- Added missing interface on mixin (should it be moved to gtnhlib?)

* Move PBR debug to angelica config

* Free malloc'd memory
This commit is contained in:
RecursivePineapple authored and GitHub committed 2025-02-18 18:34:38 +00:00
1 parent 67c8628aeb
commit 81d03ea552
6 files changed
+26 -8

No files matched your search

@@ -1,9 +1,11 @@
package net.coderbot.iris.texture.pbr;
import com.gtnewhorizons.angelica.compat.mojang.AutoClosableAbstractTexture;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.mixins.interfaces.TextureAtlasSpriteAccessor;
import com.gtnewhorizons.angelica.mixins.interfaces.TextureMapAccessor;
import lombok.Getter;
import net.coderbot.iris.Iris;
import net.coderbot.iris.texture.util.TextureExporter;
import net.coderbot.iris.texture.util.TextureManipulationUtil;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -88,7 +90,7 @@ public class PBRAtlasTexture extends AutoClosableAbstractTexture {
}
}
if (PBRTextureManager.DEBUG) {
if (AngelicaConfig.enablePBRDebug) {
TextureExporter.exportTextures("pbr_debug/atlas", id.getResourceDomain() + "_" + id.getResourcePath().replaceAll("/", "_"), glId, mipLevel, atlasWidth, atlasHeight);
}
}
@@ -98,6 +100,7 @@ public class PBRAtlasTexture extends AutoClosableAbstractTexture {
upload(atlasWidth, atlasHeight, mipLevel, anisotropicFiltering);
return true;
} catch (Throwable t) {
Iris.logger.error("Could not upload PBR texture", t);
return false;
}
}