Search in sources :

Example 1 with Shader

use of net.minecraft.client.shader.Shader in project cosmos by momentumdevelopment.

the class ESPModule method onUpdate.

@Override
public void onUpdate() {
    if (mode.getValue().equals(Mode.GLOW)) {
        // set all entities in the world glowing
        mc.world.loadedEntityList.forEach(entity -> {
            if (entity != null && !entity.equals(mc.player) && hasHighlight(entity)) {
                entity.setGlowing(true);
            }
        });
        // get the shaders
        ShaderGroup outlineShaderGroup = ((IRenderGlobal) mc.renderGlobal).getEntityOutlineShader();
        List<Shader> shaders = ((IShaderGroup) outlineShaderGroup).getListShaders();
        // update the shader radius
        shaders.forEach(shader -> {
            ShaderUniform outlineRadius = shader.getShaderManager().getShaderUniform("Radius");
            if (outlineRadius != null) {
                outlineRadius.set(width.getValue().floatValue());
            }
        });
    }
}
Also used : IShaderGroup(cope.cosmos.asm.mixins.accessor.IShaderGroup) ShaderGroup(net.minecraft.client.shader.ShaderGroup) IRenderGlobal(cope.cosmos.asm.mixins.accessor.IRenderGlobal) IShaderGroup(cope.cosmos.asm.mixins.accessor.IShaderGroup) Shader(net.minecraft.client.shader.Shader) DotShader(cope.cosmos.client.shader.shaders.DotShader) OutlineShader(cope.cosmos.client.shader.shaders.OutlineShader) RainbowOutlineShader(cope.cosmos.client.shader.shaders.RainbowOutlineShader) ShaderUniform(net.minecraft.client.shader.ShaderUniform)

Aggregations

IRenderGlobal (cope.cosmos.asm.mixins.accessor.IRenderGlobal)1 IShaderGroup (cope.cosmos.asm.mixins.accessor.IShaderGroup)1 DotShader (cope.cosmos.client.shader.shaders.DotShader)1 OutlineShader (cope.cosmos.client.shader.shaders.OutlineShader)1 RainbowOutlineShader (cope.cosmos.client.shader.shaders.RainbowOutlineShader)1 Shader (net.minecraft.client.shader.Shader)1 ShaderGroup (net.minecraft.client.shader.ShaderGroup)1 ShaderUniform (net.minecraft.client.shader.ShaderUniform)1