Skip to content

Commit

Permalink
Remove hack from LightCoordAttribute.
Browse files Browse the repository at this point in the history
You can't translate to world space via a model transform.
  • Loading branch information
covers1624 committed Mar 2, 2024
1 parent 30e6cb8 commit 751420a
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class LightCoordAttribute extends VertexAttribute<LC[]> {
public static final AttributeKey<LC[]> attributeKey = AttributeKey.create("light_coord", LC[]::new);

private final Vector3 vec = new Vector3();//for computation
private final Vector3 pos = new Vector3();

private LC[] lcRef;

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

pos.set(ccrs.lightMatrix.pos);
ccrs.pipeline.addDependency(ccrs.sideAttrib);
ccrs.pipeline.addRequirement(Transformation.operationIndex);
return true;
Expand All @@ -40,7 +38,7 @@ public void operate(CCRenderState ccrs) {
if (lcRef != null) {
ccrs.lc.set(lcRef[ccrs.vertexIndex]);
} else {
ccrs.lc.compute(vec.set(ccrs.vert.vec).subtract(pos), ccrs.side);
ccrs.lc.compute(vec.set(ccrs.vert.vec), ccrs.side);
}
}
}

0 comments on commit 751420a

Please sign in to comment.