Common and version specific shader packages #10
No files matched your search
+20
@@ -10,6 +10,10 @@ public class CapturedRenderingState {
|
|||||||
|
|
||||||
private static final Vector3d ZERO_VECTOR_3d = new Vector3d();
|
private static final Vector3d ZERO_VECTOR_3d = new Vector3d();
|
||||||
|
|
||||||
|
// Used for 1.7.10
|
||||||
|
private final Vector3d cameraPosition = new Vector3d();
|
||||||
|
private float fov;
|
||||||
|
|
||||||
private Matrix4f gbufferModelView;
|
private Matrix4f gbufferModelView;
|
||||||
private Matrix4f gbufferProjection;
|
private Matrix4f gbufferProjection;
|
||||||
private Vector3d fogColor;
|
private Vector3d fogColor;
|
||||||
@@ -28,6 +32,22 @@ public class CapturedRenderingState {
|
|||||||
private CapturedRenderingState() {
|
private CapturedRenderingState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public float getFov() {
|
||||||
|
return fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFov(float fov) {
|
||||||
|
this.fov = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCameraPosition(double x, double y, double z) {
|
||||||
|
cameraPosition.set(x, y, z);
|
||||||
|
}
|
||||||
|
public Vector3d getCameraPosition() {
|
||||||
|
return cameraPosition;
|
||||||
|
}
|
||||||
|
|
||||||
public Matrix4f getGbufferModelView() {
|
public Matrix4f getGbufferModelView() {
|
||||||
return gbufferModelView;
|
return gbufferModelView;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public class IrisExclusiveUniforms {
|
|||||||
|
|
||||||
public static class WorldInfoUniforms {
|
public static class WorldInfoUniforms {
|
||||||
public static void addWorldInfoUniforms(UniformHolder uniforms) {
|
public static void addWorldInfoUniforms(UniformHolder uniforms) {
|
||||||
// TODO: Use level.dimensionType() coordinates for 1.18!
|
|
||||||
uniforms.uniform1i(UniformUpdateFrequency.PER_FRAME, "bedrockLevel", MINECRAFT_SHIM::getBedrockLevel);
|
uniforms.uniform1i(UniformUpdateFrequency.PER_FRAME, "bedrockLevel", MINECRAFT_SHIM::getBedrockLevel);
|
||||||
uniforms.uniform1f(UniformUpdateFrequency.PER_FRAME, "cloudHeight", MINECRAFT_SHIM::getCloudHeight);
|
uniforms.uniform1f(UniformUpdateFrequency.PER_FRAME, "cloudHeight", MINECRAFT_SHIM::getCloudHeight);
|
||||||
uniforms.uniform1i(UniformUpdateFrequency.PER_FRAME, "heightLimit", MINECRAFT_SHIM::getHeightLimit);
|
uniforms.uniform1i(UniformUpdateFrequency.PER_FRAME, "heightLimit", MINECRAFT_SHIM::getHeightLimit);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class CeleritasArchaicMixinPlugin implements IMixinConfigPlugin {
|
|||||||
LOGGER.error("Error reading path", e);
|
LOGGER.error("Error reading path", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.info("Found {} mixin classes", possibleMixinClasses.size());
|
LOGGER.info("Found {} mixin classes", possibleMixinClasses);
|
||||||
for (var fs : fileSystemsToClose) {
|
for (var fs : fileSystemsToClose) {
|
||||||
try {
|
try {
|
||||||
fs.close();
|
fs.close();
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.taumc.celeritas.mixin.shaders;
|
||||||
|
|
||||||
|
import net.irisshaders.iris.uniforms.CapturedRenderingState;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(EntityRenderer.class)
|
||||||
|
public class MixinEntryRenderer {
|
||||||
|
@Inject(method = "setupCameraTransform", at = @At(value = "TAIL"))
|
||||||
|
private void celeritas$captureCameraMatrix(float partialTicks, int startTime, CallbackInfo ci) {
|
||||||
|
final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
final EntityLivingBase viewEntity = mc.renderViewEntity;
|
||||||
|
|
||||||
|
CapturedRenderingState.INSTANCE.setCameraPosition(
|
||||||
|
viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * partialTicks,
|
||||||
|
viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks,
|
||||||
|
viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ModifyArg(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lorg/lwjgl/util/glu/Project;gluPerspective(FFFF)V", ordinal = 0, remap = false), index = 0)
|
||||||
|
private float celeritas$captureFov(float fov) {
|
||||||
|
CapturedRenderingState.INSTANCE.setFov(fov);
|
||||||
|
return fov;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package org.taumc.celeritas.mixin;
|
package org.taumc.celeritas.mixin.shaders;
|
||||||
|
|
||||||
import net.irisshaders.iris.Iris;
|
import net.irisshaders.iris.Iris;
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
@@ -14,7 +14,7 @@ public class MixinGameSettings {
|
|||||||
private static boolean iris$initialized;
|
private static boolean iris$initialized;
|
||||||
|
|
||||||
@Inject(method="Lnet/minecraft/client/settings/GameSettings;loadOptions()V", at=@At("HEAD"))
|
@Inject(method="Lnet/minecraft/client/settings/GameSettings;loadOptions()V", at=@At("HEAD"))
|
||||||
private void angelica$InitializeShaders(CallbackInfo ci) {
|
private void celeritas$InitializeShaders(CallbackInfo ci) {
|
||||||
if (iris$initialized) {
|
if (iris$initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user