mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 12:34:11 +01:00
Remove force diffuse
- The batching engine may run in parallel, meaning the force diffuse state will not be read correctly - ModelTransformers only process vertices that will be rendered in the world - Add 0.6.1 to the issue template
This commit is contained in:
parent
aa08ef1430
commit
e1af5b2533
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -59,6 +59,7 @@ body:
|
||||
label: Mod Version
|
||||
description: The version of the mod you were using when the bug occured
|
||||
options:
|
||||
- "0.6.1"
|
||||
- "0.6.0"
|
||||
- "0.5.1"
|
||||
- "0.5.0a"
|
||||
|
@ -7,16 +7,12 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public final class OptifineHandler {
|
||||
public static final String OPTIFINE_ROOT_PACKAGE = "net.optifine";
|
||||
public static final String SHADER_PACKAGE = "net.optifine.shaders";
|
||||
|
||||
private static final ThreadLocal<MutableInt> FORCE_DIFFUSE = ThreadLocal.withInitial(MutableInt::new);
|
||||
|
||||
private static boolean isOptifineInstalled;
|
||||
private static boolean isUsingShaders;
|
||||
private static BooleanSupplier shadowPassSupplier;
|
||||
@ -99,23 +95,4 @@ public final class OptifineHandler {
|
||||
public static boolean isShadowPass() {
|
||||
return shadowPassSupplier.getAsBoolean();
|
||||
}
|
||||
|
||||
public static void pushForceDiffuse() {
|
||||
if (isOptifineInstalled) {
|
||||
FORCE_DIFFUSE.get().increment();
|
||||
}
|
||||
}
|
||||
|
||||
public static void popForceDiffuse() {
|
||||
if (isOptifineInstalled) {
|
||||
FORCE_DIFFUSE.get().decrement();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldApplyDiffuse() {
|
||||
if (isOptifineInstalled) {
|
||||
return !isUsingShaders || (FORCE_DIFFUSE.get().intValue() > 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class BatchedMaterialGroup implements MaterialGroup {
|
||||
|
||||
for (BatchedMaterial<?> material : materials.values()) {
|
||||
for (CPUInstancer<?> instancer : material.models.values()) {
|
||||
instancer.sbb.context.outputColorDiffuse = !consumer.hasOverlay() && OptifineHandler.shouldApplyDiffuse();
|
||||
instancer.sbb.context.outputColorDiffuse = !consumer.hasOverlay() && !OptifineHandler.isUsingShaders();
|
||||
instancer.submitTasks(stack, pool, consumer);
|
||||
}
|
||||
}
|
||||
|
@ -47,12 +47,9 @@ public class ModelTransformer {
|
||||
normalMat = params.normal.copy();
|
||||
}
|
||||
|
||||
DiffuseLightCalculator diffuseCalculator = params.diffuseCalculator;
|
||||
if (diffuseCalculator == null) {
|
||||
diffuseCalculator = DiffuseLightCalculator.forCurrentLevel();
|
||||
}
|
||||
final DiffuseLightCalculator diffuseCalculator = DiffuseLightCalculator.forCurrentLevel();
|
||||
|
||||
int vertexCount = reader.getVertexCount();
|
||||
final int vertexCount = reader.getVertexCount();
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
float x = reader.getX(i);
|
||||
float y = reader.getY(i);
|
||||
@ -173,9 +170,6 @@ public class ModelTransformer {
|
||||
public boolean useParamLight;
|
||||
public int packedLightCoords;
|
||||
|
||||
// Diffuse
|
||||
public DiffuseLightCalculator diffuseCalculator;
|
||||
|
||||
public Params() {
|
||||
model = new Matrix4f();
|
||||
normal = new Matrix3f();
|
||||
@ -193,7 +187,6 @@ public class ModelTransformer {
|
||||
overlay = OverlayTexture.NO_OVERLAY;
|
||||
useParamLight = false;
|
||||
packedLightCoords = LightTexture.FULL_BRIGHT;
|
||||
diffuseCalculator = null;
|
||||
}
|
||||
|
||||
public void load(Params from) {
|
||||
@ -208,7 +201,6 @@ public class ModelTransformer {
|
||||
overlay = from.overlay;
|
||||
useParamLight = from.useParamLight;
|
||||
packedLightCoords = from.packedLightCoords;
|
||||
diffuseCalculator = from.diffuseCalculator;
|
||||
}
|
||||
|
||||
public Params color(int r, int g, int b, int a) {
|
||||
|
Loading…
Reference in New Issue
Block a user