Skip to content

Commit 751420a

Browse files
committed
Remove hack from LightCoordAttribute.
You can't translate to world space via a model transform.
1 parent 30e6cb8 commit 751420a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: src/main/java/codechicken/lib/render/pipeline/attribute/LightCoordAttribute.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public class LightCoordAttribute extends VertexAttribute<LC[]> {
1414
public static final AttributeKey<LC[]> attributeKey = AttributeKey.create("light_coord", LC[]::new);
1515

1616
private final Vector3 vec = new Vector3();//for computation
17-
private final Vector3 pos = new Vector3();
1817

1918
private LC[] lcRef;
2019

@@ -29,7 +28,6 @@ public boolean load(CCRenderState ccrs) {
2928
return lcRef != null;
3029
}
3130

32-
pos.set(ccrs.lightMatrix.pos);
3331
ccrs.pipeline.addDependency(ccrs.sideAttrib);
3432
ccrs.pipeline.addRequirement(Transformation.operationIndex);
3533
return true;
@@ -40,7 +38,7 @@ public void operate(CCRenderState ccrs) {
4038
if (lcRef != null) {
4139
ccrs.lc.set(lcRef[ccrs.vertexIndex]);
4240
} else {
43-
ccrs.lc.compute(vec.set(ccrs.vert.vec).subtract(pos), ccrs.side);
41+
ccrs.lc.compute(vec.set(ccrs.vert.vec), ccrs.side);
4442
}
4543
}
4644
}

0 commit comments

Comments
 (0)