Added GameTime uniform value.
This commit is contained in:
parent
1e26de6a00
commit
b294225872
1 changed files with 9 additions and 9 deletions
|
@ -6,6 +6,8 @@ import net.minecraft.client.gl.PostProcessShader;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
|
||||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||||
import org.dimdev.dimdoors.ModConfig;
|
import org.dimdev.dimdoors.ModConfig;
|
||||||
import org.dimdev.dimdoors.world.level.component.PlayerModifiersComponent;
|
import org.dimdev.dimdoors.world.level.component.PlayerModifiersComponent;
|
||||||
|
@ -22,9 +24,9 @@ public class PostProcessShaderMixin {
|
||||||
|
|
||||||
@Shadow @Final private JsonEffectGlShader program;
|
@Shadow @Final private JsonEffectGlShader program;
|
||||||
|
|
||||||
@Inject(method = "Lnet/minecraft/client/gl/PostProcessShader;render(F)V", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "render(F)V", at = @At("HEAD"), cancellable = true)
|
||||||
public void render(float time, CallbackInfo cir) {
|
public void render(float time, CallbackInfo cir) {
|
||||||
if(program.getName().equals("fray")) {
|
program.getUniformByNameOrDummy("GameTime").set(RenderSystem.getShaderGameTime());
|
||||||
|
|
||||||
if (PlayerModifiersComponent.getFray(getCameraPlayer()) > config.fray.grayScreenFray) {
|
if (PlayerModifiersComponent.getFray(getCameraPlayer()) > config.fray.grayScreenFray) {
|
||||||
float overlayOpacity = (config.fray.grayScreenFray - PlayerModifiersComponent.getFray(getCameraPlayer())) / (config.fray.grayScreenFray - (float) config.fray.maxFray);
|
float overlayOpacity = (config.fray.grayScreenFray - PlayerModifiersComponent.getFray(getCameraPlayer())) / (config.fray.grayScreenFray - (float) config.fray.maxFray);
|
||||||
|
@ -32,8 +34,6 @@ public class PostProcessShaderMixin {
|
||||||
} else {
|
} else {
|
||||||
program.getUniformByNameOrDummy("FrayIntensity").set(0.0f);
|
program.getUniformByNameOrDummy("FrayIntensity").set(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlayerEntity getCameraPlayer() {
|
private PlayerEntity getCameraPlayer() {
|
||||||
|
|
Loading…
Reference in a new issue