use of net.minecraft.client.gl.ShaderEffect in project BleachHack by BleachDrinker420.
the class ShaderRender method onWorldRender.
@BleachSubscribe
public void onWorldRender(EventRenderShader event) {
if (lastShader == null || lastWidth != mc.getWindow().getFramebufferWidth() || lastHeight != mc.getWindow().getFramebufferHeight() || !shaders.get(getSetting(0).asMode().getMode()).equals(lastId)) {
lastId = shaders.get(getSetting(0).asMode().getMode());
lastWidth = mc.getWindow().getFramebufferWidth();
lastHeight = mc.getWindow().getFramebufferHeight();
try {
if (lastShader != null) {
lastShader.close();
}
lastShader = new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), lastId);
lastShader.setupDimensions(mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
} catch (JsonSyntaxException | IOException e) {
e.printStackTrace();
}
}
event.setEffect(lastShader);
}
use of net.minecraft.client.gl.ShaderEffect in project BleachHack by BleachDrinker420.
the class ShaderLoader method loadEffect.
public static ShaderEffect loadEffect(Framebuffer framebuffer, Identifier id) throws JsonSyntaxException, IOException {
ResourceManager resMang = MinecraftClient.getInstance().getResourceManager();
TextureManager texMang = MinecraftClient.getInstance().getTextureManager();
return new ShaderEffect(texMang, new OpenResourceManager(resMang), framebuffer, id);
}
use of net.minecraft.client.gl.ShaderEffect in project BleachHack by BleachDrinker420.
the class BlockHighlight method onEnable.
@Override
public void onEnable(boolean inWorld) {
super.onEnable(inWorld);
try {
shader = new ShaderEffectWrapper(new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), new Identifier("bleachhack", "shaders/post/entity_outline.json")));
colorVertexer = new ColorVertexConsumerProvider(shader.getFramebuffer("main"), BleachCoreShaders::getColorOverlayShader);
} catch (JsonSyntaxException | IOException e) {
e.printStackTrace();
setEnabled(false);
}
}
use of net.minecraft.client.gl.ShaderEffect in project KiwiClient by TangyKiwi.
the class ESP method onEnable.
@Override
public void onEnable() {
super.onEnable();
try {
shader = new ShaderEffectWrapper(new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), new Identifier("kiwiclient", "shaders/post/entity_outline.json")));
colorVertexer = new ColorVertexConsumerProvider(shader.getFramebuffer("main"), ShaderCore::getColorOverlayShader);
} catch (JsonSyntaxException | IOException e) {
e.printStackTrace();
super.onDisable();
}
}
use of net.minecraft.client.gl.ShaderEffect in project Client by MatHax.
the class GameRendererMixin method renderShader.
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawEntityOutlinesFramebuffer()V", ordinal = 0))
private void renderShader(float tickDelta, long startTime, boolean tick, CallbackInfo ci) {
ShaderEffect shader = Modules.get().get(Rendering.class).getShaderEffect();
if (shader != null) {
shader.setupDimensions(client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight());
shader.render(tickDelta);
}
}
Aggregations