use of net.minecraft.client.shader.ShaderGroup in project sol-client-glassmc by danterusdev.
the class MixinEntityRenderer method addShaders.
@Inject(method = "updateCameraAndRender(FJ)V", at = @At(value = "INVOKE", target = "Lv1_8_9/net/minecraft/client/shader" + "/Framebuffer;bindFramebuffer(Z)V", shift = At.Shift.BEFORE))
public void addShaders(float partialTicks, long nanoTime, CallbackInfo callback) {
for (ShaderGroup group : Client.INSTANCE.bus.post(new PostProcessingEvent(PostProcessingEvent.Type.RENDER)).groups) {
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.loadIdentity();
group.loadShaderGroup(((AccessMinecraft) Minecraft.getMinecraft()).getTimerSC().renderPartialTicks);
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.shader.ShaderGroup in project sol-client-glassmc by danterusdev.
the class MotionBlurMod method update.
public void update() {
if (group == null) {
groupBlur = blur;
try {
group = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), RESOURCE_LOCATION);
group.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
} catch (JsonSyntaxException | IOException error) {
logger.error("Could not load motion blur", error);
}
}
if (groupBlur != blur) {
((AccessShaderGroup) group).getListShaders().forEach((shader) -> {
ShaderUniform blendFactor = shader.getShaderManager().getShaderUniform("BlendFactor");
if (blendFactor != null) {
blendFactor.set(blur);
}
});
groupBlur = blur;
}
}
use of net.minecraft.client.shader.ShaderGroup in project Vampirism by TeamLapen.
the class RenderHandler method reMakeBloodVisionShader.
private void reMakeBloodVisionShader() {
if (this.blurShader != null) {
this.blurShader.close();
}
ResourceLocation resourcelocationBlur = new ResourceLocation(REFERENCE.MODID, "shaders/blank.json");
try {
this.blurShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getMainRenderTarget(), resourcelocationBlur);
Framebuffer swap = this.blurShader.getTempTarget("swap");
blit0 = blurShader.addPass("blit", swap, this.mc.getMainRenderTarget());
blur1 = blurShader.addPass("blur", this.mc.getMainRenderTarget(), swap);
blur1.getEffect().safeGetUniform("BlurDir").set(1F, 0F);
blur2 = blurShader.addPass("blur", swap, this.mc.getMainRenderTarget());
blur2.getEffect().safeGetUniform("BlurDir").set(0F, 1F);
this.blurShader.resize(this.mc.getWindow().getWidth(), this.mc.getWindow().getHeight());
} catch (Exception e) {
LOGGER.warn("Failed to load blood vision blur shader", e);
this.blurShader = null;
}
}
use of net.minecraft.client.shader.ShaderGroup in project Client by Sol-Client.
the class MotionBlurMod method update.
public void update() {
if (group == null) {
groupBlur = blur;
try {
group = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), RESOURCE_LOCATION);
group.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
} catch (JsonSyntaxException | IOException error) {
logger.error("Could not load motion blur", error);
}
}
if (groupBlur != blur) {
((AccessShaderGroup) group).getListShaders().forEach((shader) -> {
ShaderUniform blendFactor = shader.getShaderManager().getShaderUniform("BlendFactor");
if (blendFactor != null) {
blendFactor.set(blur);
}
});
groupBlur = blur;
}
}
use of net.minecraft.client.shader.ShaderGroup in project Client by Sol-Client.
the class MixinEntityRenderer method addShaders.
@Inject(method = "updateCameraAndRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/shader" + "/Framebuffer;bindFramebuffer(Z)V", shift = At.Shift.BEFORE))
public void addShaders(float partialTicks, long nanoTime, CallbackInfo callback) {
for (ShaderGroup group : Client.INSTANCE.bus.post(new PostProcessingEvent(PostProcessingEvent.Type.RENDER)).groups) {
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.loadIdentity();
group.loadShaderGroup(AccessMinecraft.getInstance().getTimerSC().renderPartialTicks);
GlStateManager.popMatrix();
}
}
Aggregations