Working on projector bug.
This commit is contained in:
@@ -77,12 +77,11 @@ public final class ProjectorDepthRenderer {
|
||||
private static final float PROJECTOR_FAR = ProjectorBlockEntity.MAX_RENDER_DISTANCE;
|
||||
private static final int HALF_FRUSTUM_WIDTH = (ProjectorBlockEntity.MAX_WIDTH - 1) / 2;
|
||||
private static final int FRUSTUM_HEIGHT = ProjectorBlockEntity.MAX_HEIGHT - 1;
|
||||
private static final Matrix4f DEPTH_CAMERA_PROJECTION_MATRIX = (new Matrix4f()).frustum(-HALF_FRUSTUM_WIDTH, HALF_FRUSTUM_WIDTH, FRUSTUM_HEIGHT, 0, PROJECTOR_NEAR, PROJECTOR_FAR);
|
||||
/*getFrustumMatrix(
|
||||
private static final Matrix4f DEPTH_CAMERA_PROJECTION_MATRIX = getFrustumMatrix(
|
||||
PROJECTOR_NEAR, PROJECTOR_FAR,
|
||||
ProjectorBlockEntity.MAX_GOOD_RENDER_DISTANCE,
|
||||
-HALF_FRUSTUM_WIDTH, HALF_FRUSTUM_WIDTH,
|
||||
FRUSTUM_HEIGHT, 0);*/
|
||||
FRUSTUM_HEIGHT, 0);
|
||||
|
||||
private static final Cache<ProjectorBlockEntity, RenderInfo> RENDER_INFO = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(Duration.ofSeconds(5))
|
||||
@@ -412,12 +411,11 @@ public final class ProjectorDepthRenderer {
|
||||
}
|
||||
|
||||
private static void prepareOrthographicRendering(final Minecraft minecraft) {
|
||||
float half_width = minecraft.getWindow().getWidth()/2f;
|
||||
float half_height = minecraft.getWindow().getHeight()/2f;
|
||||
final Matrix4f screenProjectionMatrix = (new Matrix4f()).setOrtho(0, minecraft.getWindow().getWidth(), 0, minecraft.getWindow().getHeight(), 1000, 3000);
|
||||
float f = 3000 - 1000;
|
||||
final Matrix4f screenProjectionMatrix = new Matrix4f(2.0F / minecraft.getWindow().getWidth(), 0f, 0f, -1f, 0f, 2.0f / -minecraft.getWindow().getHeight(), 0f, 1f, 0f, 0f, -2.0f / f, -(3000 + 1000) / f, 0f, 0f, 0f, 1f);
|
||||
/*new Matrix4f().orthoSymmetric(
|
||||
minecraft.getWindow().getWidth(),
|
||||
minecraft.getWindow().getHeight(),
|
||||
-minecraft.getWindow().getHeight(),
|
||||
0, 5000
|
||||
);*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user