use of net.minecraft.client.gl.ShaderEffect in project meteor-rejects by AntiCope.
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);
}
}
use of net.minecraft.client.gl.ShaderEffect in project meteor-rejects by AntiCope.
the class Rendering method onChanged.
public void onChanged(Shader s) {
String name;
if (s == Shader.Vibrant)
name = "color_convolve";
else if (s == Shader.Scanline)
name = "scan_pincushion";
else
name = s.toString().toLowerCase();
Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name));
try {
ShaderEffect shader = new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
this.shader = shader;
} catch (IOException e) {
this.shader = null;
}
}
use of net.minecraft.client.gl.ShaderEffect in project Client by MatHax.
the class Rendering method onChanged.
public void onChanged(Shader s) {
String name;
if (s == Shader.Vibrant)
name = "color_convolve";
else if (s == Shader.Scanline)
name = "scan_pincushion";
else
name = s.toString().toLowerCase();
Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name));
try {
ShaderEffect shader = new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
this.shader = shader;
} catch (IOException e) {
this.shader = null;
}
}
use of net.minecraft.client.gl.ShaderEffect in project Hypnotic-Client by Hypnotic-Development.
the class StorageESP method onBlockEntityRenderPre.
@EventTarget
public void onBlockEntityRenderPre(EventBlockEntityRender.PreAll event) throws JsonSyntaxException, IOException {
if (mode.is("Shader")) {
if (mc.getWindow().getFramebufferWidth() != lastWidth || mc.getWindow().getFramebufferHeight() != lastHeight || lastShaderWidth != shaderWidth.getValue() || shaderUnloaded) {
try {
ShaderEffect shader = ShaderEffectLoader.load(mc.getFramebuffer(), "storageesp-shader", String.format(Locale.ENGLISH, IOUtils.toString(getClass().getResource("/assets/hypnotic/shaders/mc_outline.ujson"), StandardCharsets.UTF_8), shaderWidth.getValue() / 2, shaderWidth.getValue() / 4));
shader.setupDimensions(mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
lastWidth = mc.getWindow().getFramebufferWidth();
lastHeight = mc.getWindow().getFramebufferHeight();
lastShaderWidth = shaderWidth.getValue();
shaderUnloaded = false;
OutlineShaderManager.loadShader(shader);
} catch (JsonSyntaxException | IOException e) {
e.printStackTrace();
}
}
} else if (!shaderUnloaded) {
OutlineShaderManager.loadDefaultShader();
shaderUnloaded = true;
}
}
use of net.minecraft.client.gl.ShaderEffect in project Hypnotic-Client by Hypnotic-Development.
the class ESP method eventRender3D.
@EventTarget
public void eventRender3D(EventRender3D event) {
for (Entity entity : mc.world.getEntities()) {
if (shouldRenderEntity(entity) && entity != mc.player) {
Vec3d renderPos = RenderUtils.getEntityRenderPosition(entity, event.getTickDelta());
Box bb = new Box(renderPos.x - entity.getWidth() + 0.25, renderPos.y, renderPos.z - entity.getWidth() + 0.25, renderPos.x + entity.getWidth() - 0.25, renderPos.y + entity.getHeight() + 0.1, renderPos.z + entity.getWidth() - 0.25);
if (mode.is("Box-Fill"))
RenderUtils.drawEntityBox(event.getMatrices(), entity, renderPos.x, renderPos.y, renderPos.z, getEntityColor(entity, 80));
if (mode.is("Box"))
RenderUtils.drawOutlineBox(event.getMatrices(), bb, getEntityColor(entity, 80), true);
}
}
if (mc.getWindow().getFramebufferWidth() != lastWidth || mc.getWindow().getFramebufferHeight() != lastHeight || lastShaderWidth != shaderWidth.getValue() || shaderUnloaded) {
try {
ShaderEffect shader = ShaderEffectLoader.load(mc.getFramebuffer(), "esp-shader", String.format(Locale.ENGLISH, IOUtils.toString(getClass().getResource("/assets/hypnotic/shaders/mc_outline.ujson"), StandardCharsets.UTF_8), shaderWidth.getValue() / 2, shaderWidth.getValue() / 4));
shader.setupDimensions(mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
lastWidth = mc.getWindow().getFramebufferWidth();
lastHeight = mc.getWindow().getFramebufferHeight();
lastShaderWidth = shaderWidth.getValue();
shaderUnloaded = false;
OutlineShaderManager.loadShader(shader);
} catch (JsonSyntaxException | IOException e) {
e.printStackTrace();
}
}
}
Aggregations