Skip to content

Commit 94c894a

Browse files
committed
Add mega hack to disable CCRS lighting, for Multipart quad baking.
In Multipart we need to build baked quads without lighting, via the existing code paths which usually would emit lighting data. Its common for part implemented code to call `ccrs.reset()` prior to doing any rendering. This resets any attempt at disabling lighting. This hack is the easiest way to prevent these. This auto-baking is going away next mc version anyway.
1 parent d6667cb commit 94c894a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/codechicken/lib/render/CCRenderState.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public class CCRenderState {
8080
*/
8181
public LightMatrix lightMatrix = new LightMatrix();
8282

83+
// TODO, REALLY SERIOUSLY NUKE THIS.
84+
// This was added as a workaround for Multipart to actually seriously disable the lighting engine,
85+
// when building BakedQuads for parts which don't do it themselves.
86+
@Deprecated (forRemoval = true)
87+
public boolean hackyReallyDontComputeLighting;
88+
8389
//vertex outputs
8490
public final Vertex5 vert = new Vertex5();
8591
public final Vector3 normal = new Vector3();
@@ -161,7 +167,7 @@ public void bind(RenderType renderType, MultiBufferSource getter, Matrix4 mat) {
161167
public void reset() {
162168
model = null;
163169
pipeline.reset();
164-
computeLighting = true;
170+
computeLighting = !hackyReallyDontComputeLighting;
165171
colour = baseColour = alphaOverride = -1;
166172
}
167173

src/main/java/codechicken/lib/render/pipeline/CCRenderPipeline.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void rebuild() {
5757
if (renderState.cFmt.hasColor) {
5858
addAttribute(renderState.colourAttrib);
5959
}
60-
if (renderState.computeLighting) {
60+
if (renderState.computeLighting && !renderState.hackyReallyDontComputeLighting) {
6161
addAttribute(renderState.lightingAttrib);
6262
}
6363

0 commit comments

Comments
 (0)