mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-22 13:19:44 +00:00
Fix Tileentities not casting shadows (#1024)
This commit is contained in:
1 parent
45a677030d
commit
9a621405ba
3 files changed
+17
-7
No files matched your search
@@ -59,6 +59,7 @@ public class ShadowRenderer {
|
||||
public static final FloatBuffer MODELVIEW_BUFFER = BufferUtils.createFloatBuffer(16);
|
||||
public static final Matrix4f PROJECTION = new Matrix4f();
|
||||
public static List<TileEntity> visibleTileEntities;
|
||||
public static List<TileEntity> globalTileEntities;
|
||||
public static boolean ACTIVE = false;
|
||||
private final float halfPlaneLength;
|
||||
private final float renderDistanceMultiplier;
|
||||
@@ -460,6 +461,7 @@ public class ShadowRenderer {
|
||||
MODELVIEW_BUFFER.clear().rewind();
|
||||
modelView.peek().getModel().get(MODELVIEW_BUFFER);
|
||||
GL11.glLoadMatrix(MODELVIEW_BUFFER);
|
||||
|
||||
for (TileEntity tileEntity : visibleTileEntities) {
|
||||
if (hasEntityFrustum && (culler.isCulled(tileEntity.xCoord - 1, tileEntity.yCoord - 1, tileEntity.zCoord - 1, tileEntity.xCoord + 1, tileEntity.yCoord + 1, tileEntity.zCoord + 1))) {
|
||||
continue;
|
||||
@@ -468,6 +470,15 @@ public class ShadowRenderer {
|
||||
|
||||
shadowTileEntities++;
|
||||
}
|
||||
for (TileEntity tileEntity : globalTileEntities) {
|
||||
if (hasEntityFrustum && (culler.isCulled(tileEntity.xCoord - 1, tileEntity.yCoord - 1, tileEntity.zCoord - 1, tileEntity.xCoord + 1, tileEntity.yCoord + 1, tileEntity.zCoord + 1))) {
|
||||
continue;
|
||||
}
|
||||
renderTileEntity(tileEntity, cameraX, cameraY, cameraZ, partialTicks);
|
||||
|
||||
shadowTileEntities++;
|
||||
}
|
||||
|
||||
GLStateManager.glPopMatrix();
|
||||
|
||||
renderedShadowTileEntities = shadowTileEntities;
|
||||
@@ -492,6 +503,7 @@ public class ShadowRenderer {
|
||||
// levelRenderer.setRenderBuffers(buffers);
|
||||
|
||||
visibleTileEntities = new ArrayList<>();
|
||||
globalTileEntities = new ArrayList<>();
|
||||
|
||||
// Create our camera
|
||||
final MatrixStack modelView = createShadowModelView(this.sunPathRotation, this.intervalSize);
|
||||
|
||||
Reference in new issue
Block a user