aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/chrisoft/trashyaddon/misc/AddonEntityOutlineShader.java
blob: af34df48f40e3ace98280087f707aae0b0d5cc76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.chrisoft.trashyaddon.misc;

import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.ESP;
import meteordevelopment.meteorclient.utils.render.postprocess.EntityShader;
import net.minecraft.entity.Entity;
import org.chrisoft.trashyaddon.commands.EntityHighlightCommand;

public class AddonEntityOutlineShader extends EntityShader {
    private static ESP esp;

    public AddonEntityOutlineShader() {
        init("outline");
    }

    @Override
    protected boolean shouldDraw() {
        if (esp == null) esp = Modules.get().get(ESP.class);
        //return esp.isShader();
        return true;
    }

    @Override
    public void endRender() {
        super.endRender();
    }

    @Override
    public boolean shouldDraw(Entity entity) {
        if (!shouldDraw()) return false;
        return EntityHighlightCommand.getEntityColor(entity) != null;
    }

    @Override
    protected void setUniforms() {
        shader.set("u_Width", esp.outlineWidth.get());
        shader.set("u_FillOpacity", esp.fillOpacity.get());
        shader.set("u_ShapeMode", esp.shapeMode.get().ordinal());
        shader.set("u_GlowMultiplier", esp.glowMultiplier.get());
    }
}