- Fixed custom rendered models rendering full bright when supposed to render full dark
This commit is contained in:
simibubi 2021-07-11 01:14:38 +02:00
parent 3f57eeacb4
commit 2821fd7135
4 changed files with 8 additions and 7 deletions

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false org.gradle.daemon = false
# mod version info # mod version info
mod_version = 0.3.2 mod_version = 0.3.2a
minecraft_version = 1.16.5 minecraft_version = 1.16.5
forge_version = 36.1.32 forge_version = 36.1.32

View file

@ -56,7 +56,7 @@ public class Create {
public static final String ID = "create"; public static final String ID = "create";
public static final String NAME = "Create"; public static final String NAME = "Create";
public static final String VERSION = "0.3.2"; public static final String VERSION = "0.3.2a";
public static final Logger LOGGER = LogManager.getLogger(); public static final Logger LOGGER = LogManager.getLogger();

View file

@ -49,6 +49,7 @@ public class SuperByteBuffer {
// Vertex Lighting // Vertex Lighting
private boolean useWorldLight; private boolean useWorldLight;
private boolean hybridLight; private boolean hybridLight;
private boolean useCustomLightCoords;
private int packedLightCoords; private int packedLightCoords;
private Matrix4f lightTransform; private Matrix4f lightTransform;
@ -100,7 +101,6 @@ public class SuperByteBuffer {
WORLD_LIGHT_CACHE.clear(); WORLD_LIGHT_CACHE.clear();
} }
boolean hasDefaultLight = packedLightCoords != 0;
float f = .5f; float f = .5f;
int vertexCount = template.getVertexCount(); int vertexCount = template.getVertexCount();
for (int i = 0; i < vertexCount; i++) { for (int i = 0; i < vertexCount; i++) {
@ -177,10 +177,9 @@ public class SuperByteBuffer {
} }
light = getLight(Minecraft.getInstance().world, lightPos); light = getLight(Minecraft.getInstance().world, lightPos);
if (hasDefaultLight) { if (useCustomLightCoords)
light = maxLight(light, packedLightCoords); light = maxLight(light, packedLightCoords);
} } else if (useCustomLightCoords) {
} else if (hasDefaultLight) {
light = packedLightCoords; light = packedLightCoords;
} else { } else {
light = template.getLight(i); light = template.getLight(i);
@ -213,6 +212,7 @@ public class SuperByteBuffer {
hasOverlay = false; hasOverlay = false;
overlay = OverlayTexture.DEFAULT_UV; overlay = OverlayTexture.DEFAULT_UV;
useWorldLight = false; useWorldLight = false;
useCustomLightCoords = false;
hybridLight = false; hybridLight = false;
packedLightCoords = 0; packedLightCoords = 0;
lightTransform = null; lightTransform = null;
@ -368,6 +368,7 @@ public class SuperByteBuffer {
} }
public SuperByteBuffer light(int packedLightCoords) { public SuperByteBuffer light(int packedLightCoords) {
useCustomLightCoords = true;
this.packedLightCoords = packedLightCoords; this.packedLightCoords = packedLightCoords;
return this; return this;
} }

View file

@ -5,7 +5,7 @@ license="MIT"
[[mods]] [[mods]]
modId="create" modId="create"
version="v0.3.2 for 1.16.5" version="v0.3.2a for 1.16.5"
displayName="Create" displayName="Create"
#updateJSONURL="" #updateJSONURL=""
displayURL="https://www.curseforge.com/minecraft/mc-mods/create" displayURL="https://www.curseforge.com/minecraft/mc-mods/create"