Yeet more parts of the code

Changes to be committed:
	modified:   src/main/java/org/dimdev/dimdoors/client/MyRenderLayer.java
This commit is contained in:
SD 2020-09-26 20:13:30 +05:30
parent 3b95a8c801
commit d76adf7070
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5

View file

@ -60,26 +60,26 @@ public class MyRenderLayer extends RenderLayer {
.texture(new Texture(DetachedRiftBlockEntityRenderer.TESSERACT_PATH, false, false))
.alpha(Alpha.HALF_ALPHA)
.build(false));
public static RenderLayer getDimensionalPortal(int phase, EntranceRiftBlockEntity blockEntity) {
Direction orientation = blockEntity.getOrientation();
Texture tex = new Texture(WARP_PATH, false, false);
Vec3d offset = new Vec3d(orientation.getOpposite().getUnitVector());
return of("dimensional_portal",
VertexFormats.POSITION_COLOR,
7, 256,
false,
true,
RenderLayer.MultiPhaseParameters.builder()
.transparency(ADDITIVE_TRANSPARENCY)
.texture(tex)
.texturing(new DimensionalPortalTexturing(phase,
blockEntity,
blockEntity.getPos().getX() + offset.x,
blockEntity.getPos().getY() + offset.y,
blockEntity.getPos().getZ() + offset.z))
.fog(BLACK_FOG).build(false));
}
//
// public static RenderLayer getDimensionalPortal(int phase, EntranceRiftBlockEntity blockEntity) {
// Direction orientation = blockEntity.getOrientation();
// Texture tex = new Texture(WARP_PATH, false, false);
// Vec3d offset = new Vec3d(orientation.getOpposite().getUnitVector());
// return of("dimensional_portal",
// VertexFormats.POSITION_COLOR,
// 7, 256,
// false,
// true,
// RenderLayer.MultiPhaseParameters.builder()
// .transparency(ADDITIVE_TRANSPARENCY)
// .texture(tex)
// .texturing(new DimensionalPortalTexturing(phase,
// blockEntity,
// blockEntity.getPos().getX() + offset.x,
// blockEntity.getPos().getY() + offset.y,
// blockEntity.getPos().getZ() + offset.z))
// .fog(BLACK_FOG).build(false));
// }
public static RenderLayer getPortal(int layer) {
RenderPhase.Transparency transparency;
@ -95,39 +95,39 @@ public class MyRenderLayer extends RenderLayer {
return of("dimensional_portal", VertexFormats.POSITION_COLOR, 7, 256, false, true, RenderLayer.MultiPhaseParameters.builder().transparency(transparency).texture(texture).texturing(new RenderPhase.PortalTexturing(layer)).fog(BLACK_FOG).build(false));
}
public static class DimensionalPortalTexturing extends RenderPhase.Texturing {
public final int layer;
public DimensionalPortalTexturing(int layer, EntranceRiftBlockEntity blockEntity, double x, double y, double z) {
super("dimensional_portal_texturing", () -> {
float translationScale = 16 - layer;
float scale = 0.3625F;
float offset = Util.getMeasuringTimeNano() % 200000L / 200000.0F;
if (layer == 0) {
translationScale = 25.0F;
scale = 0.125F;
}
if (layer == 1) {
scale = 0.5F;
}
RenderSystem.matrixMode(GL11.GL_TEXTURE);
RenderSystem.pushMatrix();
RenderSystem.loadIdentity();
RenderSystem.translatef(0.1F, offset * translationScale, 0.1F);
RenderSystem.scalef(scale, scale, scale);
RenderSystem.translatef(0.5F, 0.5F, 0.5F);
RenderSystem.rotatef((layer * layer * 4321 + layer) * 9 * 2.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.scalef(4.5F - (float)layer / 4.0F, 4.5F - (float)layer / 4.0F, 1.0F);
RenderSystem.mulTextureByProjModelView();
RenderSystem.matrixMode(GL11.GL_MODELVIEW);
RenderSystem.setupEndPortalTexGen();
}, () -> {
RenderSystem.matrixMode(GL11.GL_TEXTURE);
RenderSystem.popMatrix();
RenderSystem.matrixMode(GL11.GL_MODELVIEW);
RenderSystem.clearTexGen();
});
this.layer = layer;
}
}
// public static class DimensionalPortalTexturing extends RenderPhase.Texturing {
// public final int layer;
//
// public DimensionalPortalTexturing(int layer, EntranceRiftBlockEntity blockEntity, double x, double y, double z) {
// super("dimensional_portal_texturing", () -> {
// float translationScale = 16 - layer;
// float scale = 0.3625F;
// float offset = Util.getMeasuringTimeNano() % 200000L / 200000.0F;
// if (layer == 0) {
// translationScale = 25.0F;
// scale = 0.125F;
// }
// if (layer == 1) {
// scale = 0.5F;
// }
// RenderSystem.matrixMode(GL11.GL_TEXTURE);
// RenderSystem.pushMatrix();
// RenderSystem.loadIdentity();
// RenderSystem.translatef(0.1F, offset * translationScale, 0.1F);
// RenderSystem.scalef(scale, scale, scale);
// RenderSystem.translatef(0.5F, 0.5F, 0.5F);
// RenderSystem.rotatef((layer * layer * 4321 + layer) * 9 * 2.0F, 0.0F, 0.0F, 1.0F);
// RenderSystem.scalef(4.5F - (float)layer / 4.0F, 4.5F - (float)layer / 4.0F, 1.0F);
// RenderSystem.mulTextureByProjModelView();
// RenderSystem.matrixMode(GL11.GL_MODELVIEW);
// RenderSystem.setupEndPortalTexGen();
// }, () -> {
// RenderSystem.matrixMode(GL11.GL_TEXTURE);
// RenderSystem.popMatrix();
// RenderSystem.matrixMode(GL11.GL_MODELVIEW);
// RenderSystem.clearTexGen();
// });
// this.layer = layer;
// }
// }
}