Визуальная часть Призраки на Excellent Recode

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
9 Май 2023
Сообщения
68
Реакции
1
Выберите загрузчик игры
  1. OptiFine
Короче говоря сделал призраки, хз возможно похоже на нурик, но правда не ебу :CoolCat:
Надеюсь что пастерам хватит ума просто засунуть нужную часть в AuraComponent :BlessRNG:
сс -
photo_5231309723633055948_x.jpg




Призраки:
Expand Collapse Copy
package wtf.comet.client.managers.component.impl.aura;

import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Namespaced;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.mojang.blaze3d.matrix.MatrixStack;
import net.mojang.blaze3d.systems.RenderSystem;
import org.joml.Vector2f;
import wtf.comet.client.api.events.orbit.EventHandler;
import wtf.comet.client.managers.component.Component;
import wtf.comet.client.managers.events.render.Render2DEvent;
import wtf.comet.client.managers.module.impl.client.Theme;
import wtf.comet.client.managers.module.impl.combat.KillAura;
import wtf.comet.client.utils.animation.Animation;
import wtf.comet.client.utils.animation.util.Easings;
import wtf.comet.client.utils.render.color.ColorUtil;
import wtf.comet.client.utils.render.draw.GLUtil;
import wtf.comet.client.utils.render.draw.Project;
import wtf.comet.client.utils.render.draw.RectUtil;
import wtf.comet.client.utils.render.draw.RenderUtil3D;

import java.util.ArrayList;
import java.util.List;

public class AuraComponent extends Component {
    // Это вам не надо :(, тут был просто квадратик :P
    private final Namespaced bloomTexture = new Namespaced("texture/bloom.png");
    public LivingEntity target;
    public final Animation markerAnimation = new Animation();
    private final Vector2f markerPosition = new Vector2f();
    private final List<Float> sparkTrail = new ArrayList<>();
    private final Animation damageAnimation = new Animation();

    @EventHandler
    public void onEvent(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        markerAnimation.update();
        damageAnimation.update();
        if (aura.target() != null) {
            if (target != aura.target()) {
                target = aura.target();
                markerAnimation.run(1, 1, Easings.LINEAR, true);
            }
        }
        markerAnimation.run(aura.target() == null ? 0 : 1, 0.35, Easings.QUAD_IN_OUT, true);
        if (markerAnimation.getValue() == 0.0) {
            target = null;
        }
        if (target == null) {
            sparkTrail.clear();
            return;
        }
        auraProcess(event);
    }

    private void auraProcess(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        drawPrizrakiEbat(event.getMatrix());
    }

    private boolean isParticleOccluded(Vector3d cameraPos, Vector3d particlePos, AxisAlignedBB targetBB) {
        return false;
    }

    public void drawPrizrakiEbat(MatrixStack matrix) {
        matrix.push();
        float alphaPC = markerAnimation.get();
        if (alphaPC == 0.0F || target == null) {
            matrix.pop();
            return;
        }

        Vector3d vec = RenderUtil3D.interpolate(target, mc.getRenderPartialTicks());
        double baseX = vec.x;
        double baseY = vec.y + target.getHeight() / 2f;
        double baseZ = vec.z;
        // ебать настройка для призраков =0,
        final double radius = 0.55f;
        final float speed = 30f;
        final double distanceStep = 1.5;
        final int trailLength = 300;
        //Конец (((
        long time = System.currentTimeMillis();
        float hurtPC = (float) Math.sin(target.hurtTime * (1F * Math.PI / 25F));
        Vector3d cameraPos = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
        RenderSystem.disableDepthTest();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.depthMask(false);
        RenderSystem.blendFuncSeparate(770, 771, 1, 0);
        mc.getTextureManager().bindTexture(bloomTexture);

        for (int i = 0; i < trailLength; i++) {
            double angle = 0.1f * (time - i * distanceStep) / speed;
            double s = Math.sin(angle) * radius;
            double c = Math.cos(angle) * radius;

            double[][] points = new double[][]{
                    {baseX + s, baseY + c, baseZ - c},
                    {baseX - s, baseY + s, baseZ - c},
                    {baseX - s, baseY - s, baseZ + c}
            };

            float progress = (float) i / trailLength;
            float sizeFactor = (float) Math.pow(1.0f - progress, 1.1F);

            for (double[] pos : points) {
                Vector3d particlePos = new Vector3d(pos[0], pos[1], pos[2]);
                if (isParticleOccluded(cameraPos, particlePos, target.getBoundingBox())) continue;
                Vector2f marker = Project.project2D(particlePos.x, particlePos.y, particlePos.z);
                if (marker.x == Float.MAX_VALUE) continue;
                double distance = cameraPos.distanceTo(particlePos);
                //вот тут размер если что
                float distanceScale = (float) (85.0f / Math.max(0, distance));
                //Конец (((
                float pulse = 1f + 0 * (float) Math.sin(time / 0.01 + i);
                float finalSize = distanceScale * sizeFactor * pulse;
                float alphaTrail = alphaPC * (1f - progress * progress) * 0.4f;
                int baseColor = ColorUtil.multBright(Theme.getInstance().clientColor(), 1.2f);
                int red = ColorUtil.getColor(255, 0, 0);
                int finalColor = ColorUtil.overCol(ColorUtil.multAlpha(baseColor, alphaTrail), ColorUtil.multAlpha(red, alphaTrail), hurtPC);
                float rotation = (float) (time / 5.0 + i * 5) % 180;
                matrix.push();
                matrix.translate(marker.x, marker.y, 0);
                GLUtil.rotate(matrix, 0, 0, Vector3f.ZP.rotationDegrees(rotation), () -> RectUtil.drawRect(matrix, -finalSize / 2f, -finalSize / 2f, finalSize, finalSize, finalColor, true, true));
                matrix.pop();
            }
        }

        RenderSystem.enableDepthTest();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableBlend();
        RenderSystem.depthMask(true);
        matrix.pop();
    }
}
Одобрите плиз
 

Вложения

  • bloom.png
    bloom.png
    4.7 KB · Просмотры: 260
Последнее редактирование:
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Короче говоря сделал призраки, хз возможно похоже на нурик, но правда не ебу :CoolCat:
Надеюсь что пастерам хватит ума просто засунуть нужную часть в AuraComponent :BlessRNG:
сс - Посмотреть вложение 312513



Призраки:
Expand Collapse Copy
package wtf.comet.client.managers.component.impl.aura;

import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Namespaced;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.mojang.blaze3d.matrix.MatrixStack;
import net.mojang.blaze3d.systems.RenderSystem;
import org.joml.Vector2f;
import wtf.comet.client.api.events.orbit.EventHandler;
import wtf.comet.client.managers.component.Component;
import wtf.comet.client.managers.events.render.Render2DEvent;
import wtf.comet.client.managers.module.impl.client.Theme;
import wtf.comet.client.managers.module.impl.combat.KillAura;
import wtf.comet.client.utils.animation.Animation;
import wtf.comet.client.utils.animation.util.Easings;
import wtf.comet.client.utils.render.color.ColorUtil;
import wtf.comet.client.utils.render.draw.GLUtil;
import wtf.comet.client.utils.render.draw.Project;
import wtf.comet.client.utils.render.draw.RectUtil;
import wtf.comet.client.utils.render.draw.RenderUtil3D;

import java.util.ArrayList;
import java.util.List;

public class AuraComponent extends Component {
    // Это вам не надо :(, тут был просто квадратик :P
    private final Namespaced bloomTexture = new Namespaced("texture/bloom.png");
    public LivingEntity target;
    public final Animation markerAnimation = new Animation();
    private final Vector2f markerPosition = new Vector2f();
    private final List<Float> sparkTrail = new ArrayList<>();
    private final Animation damageAnimation = new Animation();

    @EventHandler
    public void onEvent(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        markerAnimation.update();
        damageAnimation.update();
        if (aura.target() != null) {
            if (target != aura.target()) {
                target = aura.target();
                markerAnimation.run(1, 1, Easings.LINEAR, true);
            }
        }
        markerAnimation.run(aura.target() == null ? 0 : 1, 0.35, Easings.QUAD_IN_OUT, true);
        if (markerAnimation.getValue() == 0.0) {
            target = null;
        }
        if (target == null) {
            sparkTrail.clear();
            return;
        }
        auraProcess(event);
    }

    private void auraProcess(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        drawPrizrakiEbat(event.getMatrix());
    }

    private boolean isParticleOccluded(Vector3d cameraPos, Vector3d particlePos, AxisAlignedBB targetBB) {
        return false;
    }

    public void drawPrizrakiEbat(MatrixStack matrix) {
        matrix.push();
        float alphaPC = markerAnimation.get();
        if (alphaPC == 0.0F || target == null) {
            matrix.pop();
            return;
        }

        Vector3d vec = RenderUtil3D.interpolate(target, mc.getRenderPartialTicks());
        double baseX = vec.x;
        double baseY = vec.y + target.getHeight() / 2f;
        double baseZ = vec.z;
        // ебать настройка для призраков =0,
        final double radius = 0.55f;
        final float speed = 30f;
        final double distanceStep = 1.5;
        final int trailLength = 300;
        //Конец (((
        long time = System.currentTimeMillis();
        float hurtPC = (float) Math.sin(target.hurtTime * (1F * Math.PI / 25F));
        Vector3d cameraPos = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
        RenderSystem.disableDepthTest();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.depthMask(false);
        RenderSystem.blendFuncSeparate(770, 771, 1, 0);
        mc.getTextureManager().bindTexture(bloomTexture);

        for (int i = 0; i < trailLength; i++) {
            double angle = 0.1f * (time - i * distanceStep) / speed;
            double s = Math.sin(angle) * radius;
            double c = Math.cos(angle) * radius;

            double[][] points = new double[][]{
                    {baseX + s, baseY + c, baseZ - c},
                    {baseX - s, baseY + s, baseZ - c},
                    {baseX - s, baseY - s, baseZ + c}
            };

            float progress = (float) i / trailLength;
            float sizeFactor = (float) Math.pow(1.0f - progress, 1.1F);

            for (double[] pos : points) {
                Vector3d particlePos = new Vector3d(pos[0], pos[1], pos[2]);
                if (isParticleOccluded(cameraPos, particlePos, target.getBoundingBox())) continue;
                Vector2f marker = Project.project2D(particlePos.x, particlePos.y, particlePos.z);
                if (marker.x == Float.MAX_VALUE) continue;
                double distance = cameraPos.distanceTo(particlePos);
                //вот тут размер если что
                float distanceScale = (float) (85.0f / Math.max(0, distance));
                //Конец (((
                float pulse = 1f + 0 * (float) Math.sin(time / 0.01 + i);
                float finalSize = distanceScale * sizeFactor * pulse;
                float alphaTrail = alphaPC * (1f - progress * progress) * 0.4f;
                int baseColor = ColorUtil.multBright(Theme.getInstance().clientColor(), 1.2f);
                int red = ColorUtil.getColor(255, 0, 0);
                int finalColor = ColorUtil.overCol(ColorUtil.multAlpha(baseColor, alphaTrail), ColorUtil.multAlpha(red, alphaTrail), hurtPC);
                float rotation = (float) (time / 5.0 + i * 5) % 180;
                matrix.push();
                matrix.translate(marker.x, marker.y, 0);
                GLUtil.rotate(matrix, 0, 0, Vector3f.ZP.rotationDegrees(rotation), () -> RectUtil.drawRect(matrix, -finalSize / 2f, -finalSize / 2f, finalSize, finalSize, finalColor, true, true));
                matrix.pop();
            }
        }

        RenderSystem.enableDepthTest();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableBlend();
        RenderSystem.depthMask(true);
        matrix.pop();
    }
}
Одобрите плиз
кайф на 1.21.4 перенесу скину вам :summyrose:
 
кайф на 1.21.4 перенесу скину вам :summyrose:
давай только на mcp чтобы я вставил и все лень писать
Короче говоря сделал призраки, хз возможно похоже на нурик, но правда не ебу :CoolCat:
Надеюсь что пастерам хватит ума просто засунуть нужную часть в AuraComponent :BlessRNG:
сс - Посмотреть вложение 312513



Призраки:
Expand Collapse Copy
package wtf.comet.client.managers.component.impl.aura;

import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Namespaced;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.mojang.blaze3d.matrix.MatrixStack;
import net.mojang.blaze3d.systems.RenderSystem;
import org.joml.Vector2f;
import wtf.comet.client.api.events.orbit.EventHandler;
import wtf.comet.client.managers.component.Component;
import wtf.comet.client.managers.events.render.Render2DEvent;
import wtf.comet.client.managers.module.impl.client.Theme;
import wtf.comet.client.managers.module.impl.combat.KillAura;
import wtf.comet.client.utils.animation.Animation;
import wtf.comet.client.utils.animation.util.Easings;
import wtf.comet.client.utils.render.color.ColorUtil;
import wtf.comet.client.utils.render.draw.GLUtil;
import wtf.comet.client.utils.render.draw.Project;
import wtf.comet.client.utils.render.draw.RectUtil;
import wtf.comet.client.utils.render.draw.RenderUtil3D;

import java.util.ArrayList;
import java.util.List;

public class AuraComponent extends Component {
    // Это вам не надо :(, тут был просто квадратик :P
    private final Namespaced bloomTexture = new Namespaced("texture/bloom.png");
    public LivingEntity target;
    public final Animation markerAnimation = new Animation();
    private final Vector2f markerPosition = new Vector2f();
    private final List<Float> sparkTrail = new ArrayList<>();
    private final Animation damageAnimation = new Animation();

    @EventHandler
    public void onEvent(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        markerAnimation.update();
        damageAnimation.update();
        if (aura.target() != null) {
            if (target != aura.target()) {
                target = aura.target();
                markerAnimation.run(1, 1, Easings.LINEAR, true);
            }
        }
        markerAnimation.run(aura.target() == null ? 0 : 1, 0.35, Easings.QUAD_IN_OUT, true);
        if (markerAnimation.getValue() == 0.0) {
            target = null;
        }
        if (target == null) {
            sparkTrail.clear();
            return;
        }
        auraProcess(event);
    }

    private void auraProcess(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        drawPrizrakiEbat(event.getMatrix());
    }

    private boolean isParticleOccluded(Vector3d cameraPos, Vector3d particlePos, AxisAlignedBB targetBB) {
        return false;
    }

    public void drawPrizrakiEbat(MatrixStack matrix) {
        matrix.push();
        float alphaPC = markerAnimation.get();
        if (alphaPC == 0.0F || target == null) {
            matrix.pop();
            return;
        }

        Vector3d vec = RenderUtil3D.interpolate(target, mc.getRenderPartialTicks());
        double baseX = vec.x;
        double baseY = vec.y + target.getHeight() / 2f;
        double baseZ = vec.z;
        // ебать настройка для призраков =0,
        final double radius = 0.55f;
        final float speed = 30f;
        final double distanceStep = 1.5;
        final int trailLength = 300;
        //Конец (((
        long time = System.currentTimeMillis();
        float hurtPC = (float) Math.sin(target.hurtTime * (1F * Math.PI / 25F));
        Vector3d cameraPos = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
        RenderSystem.disableDepthTest();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.depthMask(false);
        RenderSystem.blendFuncSeparate(770, 771, 1, 0);
        mc.getTextureManager().bindTexture(bloomTexture);

        for (int i = 0; i < trailLength; i++) {
            double angle = 0.1f * (time - i * distanceStep) / speed;
            double s = Math.sin(angle) * radius;
            double c = Math.cos(angle) * radius;

            double[][] points = new double[][]{
                    {baseX + s, baseY + c, baseZ - c},
                    {baseX - s, baseY + s, baseZ - c},
                    {baseX - s, baseY - s, baseZ + c}
            };

            float progress = (float) i / trailLength;
            float sizeFactor = (float) Math.pow(1.0f - progress, 1.1F);

            for (double[] pos : points) {
                Vector3d particlePos = new Vector3d(pos[0], pos[1], pos[2]);
                if (isParticleOccluded(cameraPos, particlePos, target.getBoundingBox())) continue;
                Vector2f marker = Project.project2D(particlePos.x, particlePos.y, particlePos.z);
                if (marker.x == Float.MAX_VALUE) continue;
                double distance = cameraPos.distanceTo(particlePos);
                //вот тут размер если что
                float distanceScale = (float) (85.0f / Math.max(0, distance));
                //Конец (((
                float pulse = 1f + 0 * (float) Math.sin(time / 0.01 + i);
                float finalSize = distanceScale * sizeFactor * pulse;
                float alphaTrail = alphaPC * (1f - progress * progress) * 0.4f;
                int baseColor = ColorUtil.multBright(Theme.getInstance().clientColor(), 1.2f);
                int red = ColorUtil.getColor(255, 0, 0);
                int finalColor = ColorUtil.overCol(ColorUtil.multAlpha(baseColor, alphaTrail), ColorUtil.multAlpha(red, alphaTrail), hurtPC);
                float rotation = (float) (time / 5.0 + i * 5) % 180;
                matrix.push();
                matrix.translate(marker.x, marker.y, 0);
                GLUtil.rotate(matrix, 0, 0, Vector3f.ZP.rotationDegrees(rotation), () -> RectUtil.drawRect(matrix, -finalSize / 2f, -finalSize / 2f, finalSize, finalSize, finalColor, true, true));
                matrix.pop();
            }
        }

        RenderSystem.enableDepthTest();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableBlend();
        RenderSystem.depthMask(true);
        matrix.pop();
    }
}
Одобрите плиз
а в чем проблема зделать проверку видимости относительно камеры??
 
Короче говоря сделал призраки, хз возможно похоже на нурик, но правда не ебу :CoolCat:
Надеюсь что пастерам хватит ума просто засунуть нужную часть в AuraComponent :BlessRNG:
сс - Посмотреть вложение 312513



Призраки:
Expand Collapse Copy
package wtf.comet.client.managers.component.impl.aura;

import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Namespaced;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.mojang.blaze3d.matrix.MatrixStack;
import net.mojang.blaze3d.systems.RenderSystem;
import org.joml.Vector2f;
import wtf.comet.client.api.events.orbit.EventHandler;
import wtf.comet.client.managers.component.Component;
import wtf.comet.client.managers.events.render.Render2DEvent;
import wtf.comet.client.managers.module.impl.client.Theme;
import wtf.comet.client.managers.module.impl.combat.KillAura;
import wtf.comet.client.utils.animation.Animation;
import wtf.comet.client.utils.animation.util.Easings;
import wtf.comet.client.utils.render.color.ColorUtil;
import wtf.comet.client.utils.render.draw.GLUtil;
import wtf.comet.client.utils.render.draw.Project;
import wtf.comet.client.utils.render.draw.RectUtil;
import wtf.comet.client.utils.render.draw.RenderUtil3D;

import java.util.ArrayList;
import java.util.List;

public class AuraComponent extends Component {
    // Это вам не надо :(, тут был просто квадратик :P
    private final Namespaced bloomTexture = new Namespaced("texture/bloom.png");
    public LivingEntity target;
    public final Animation markerAnimation = new Animation();
    private final Vector2f markerPosition = new Vector2f();
    private final List<Float> sparkTrail = new ArrayList<>();
    private final Animation damageAnimation = new Animation();

    @EventHandler
    public void onEvent(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        markerAnimation.update();
        damageAnimation.update();
        if (aura.target() != null) {
            if (target != aura.target()) {
                target = aura.target();
                markerAnimation.run(1, 1, Easings.LINEAR, true);
            }
        }
        markerAnimation.run(aura.target() == null ? 0 : 1, 0.35, Easings.QUAD_IN_OUT, true);
        if (markerAnimation.getValue() == 0.0) {
            target = null;
        }
        if (target == null) {
            sparkTrail.clear();
            return;
        }
        auraProcess(event);
    }

    private void auraProcess(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        drawPrizrakiEbat(event.getMatrix());
    }

    private boolean isParticleOccluded(Vector3d cameraPos, Vector3d particlePos, AxisAlignedBB targetBB) {
        return false;
    }

    public void drawPrizrakiEbat(MatrixStack matrix) {
        matrix.push();
        float alphaPC = markerAnimation.get();
        if (alphaPC == 0.0F || target == null) {
            matrix.pop();
            return;
        }

        Vector3d vec = RenderUtil3D.interpolate(target, mc.getRenderPartialTicks());
        double baseX = vec.x;
        double baseY = vec.y + target.getHeight() / 2f;
        double baseZ = vec.z;
        // ебать настройка для призраков =0,
        final double radius = 0.55f;
        final float speed = 30f;
        final double distanceStep = 1.5;
        final int trailLength = 300;
        //Конец (((
        long time = System.currentTimeMillis();
        float hurtPC = (float) Math.sin(target.hurtTime * (1F * Math.PI / 25F));
        Vector3d cameraPos = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
        RenderSystem.disableDepthTest();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.depthMask(false);
        RenderSystem.blendFuncSeparate(770, 771, 1, 0);
        mc.getTextureManager().bindTexture(bloomTexture);

        for (int i = 0; i < trailLength; i++) {
            double angle = 0.1f * (time - i * distanceStep) / speed;
            double s = Math.sin(angle) * radius;
            double c = Math.cos(angle) * radius;

            double[][] points = new double[][]{
                    {baseX + s, baseY + c, baseZ - c},
                    {baseX - s, baseY + s, baseZ - c},
                    {baseX - s, baseY - s, baseZ + c}
            };

            float progress = (float) i / trailLength;
            float sizeFactor = (float) Math.pow(1.0f - progress, 1.1F);

            for (double[] pos : points) {
                Vector3d particlePos = new Vector3d(pos[0], pos[1], pos[2]);
                if (isParticleOccluded(cameraPos, particlePos, target.getBoundingBox())) continue;
                Vector2f marker = Project.project2D(particlePos.x, particlePos.y, particlePos.z);
                if (marker.x == Float.MAX_VALUE) continue;
                double distance = cameraPos.distanceTo(particlePos);
                //вот тут размер если что
                float distanceScale = (float) (85.0f / Math.max(0, distance));
                //Конец (((
                float pulse = 1f + 0 * (float) Math.sin(time / 0.01 + i);
                float finalSize = distanceScale * sizeFactor * pulse;
                float alphaTrail = alphaPC * (1f - progress * progress) * 0.4f;
                int baseColor = ColorUtil.multBright(Theme.getInstance().clientColor(), 1.2f);
                int red = ColorUtil.getColor(255, 0, 0);
                int finalColor = ColorUtil.overCol(ColorUtil.multAlpha(baseColor, alphaTrail), ColorUtil.multAlpha(red, alphaTrail), hurtPC);
                float rotation = (float) (time / 5.0 + i * 5) % 180;
                matrix.push();
                matrix.translate(marker.x, marker.y, 0);
                GLUtil.rotate(matrix, 0, 0, Vector3f.ZP.rotationDegrees(rotation), () -> RectUtil.drawRect(matrix, -finalSize / 2f, -finalSize / 2f, finalSize, finalSize, finalColor, true, true));
                matrix.pop();
            }
        }

        RenderSystem.enableDepthTest();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableBlend();
        RenderSystem.depthMask(true);
        matrix.pop();
    }
}
Одобрите плиз
рендерить в 2Д 😨😰😱👻💀🤖
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Последнее редактирование:
Короче говоря сделал призраки, хз возможно похоже на нурик, но правда не ебу :CoolCat:
Надеюсь что пастерам хватит ума просто засунуть нужную часть в AuraComponent :BlessRNG:
сс - Посмотреть вложение 312513



Призраки:
Expand Collapse Copy
package wtf.comet.client.managers.component.impl.aura;

import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Namespaced;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.mojang.blaze3d.matrix.MatrixStack;
import net.mojang.blaze3d.systems.RenderSystem;
import org.joml.Vector2f;
import wtf.comet.client.api.events.orbit.EventHandler;
import wtf.comet.client.managers.component.Component;
import wtf.comet.client.managers.events.render.Render2DEvent;
import wtf.comet.client.managers.module.impl.client.Theme;
import wtf.comet.client.managers.module.impl.combat.KillAura;
import wtf.comet.client.utils.animation.Animation;
import wtf.comet.client.utils.animation.util.Easings;
import wtf.comet.client.utils.render.color.ColorUtil;
import wtf.comet.client.utils.render.draw.GLUtil;
import wtf.comet.client.utils.render.draw.Project;
import wtf.comet.client.utils.render.draw.RectUtil;
import wtf.comet.client.utils.render.draw.RenderUtil3D;

import java.util.ArrayList;
import java.util.List;

public class AuraComponent extends Component {
    // Это вам не надо :(, тут был просто квадратик :P
    private final Namespaced bloomTexture = new Namespaced("texture/bloom.png");
    public LivingEntity target;
    public final Animation markerAnimation = new Animation();
    private final Vector2f markerPosition = new Vector2f();
    private final List<Float> sparkTrail = new ArrayList<>();
    private final Animation damageAnimation = new Animation();

    @EventHandler
    public void onEvent(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        markerAnimation.update();
        damageAnimation.update();
        if (aura.target() != null) {
            if (target != aura.target()) {
                target = aura.target();
                markerAnimation.run(1, 1, Easings.LINEAR, true);
            }
        }
        markerAnimation.run(aura.target() == null ? 0 : 1, 0.35, Easings.QUAD_IN_OUT, true);
        if (markerAnimation.getValue() == 0.0) {
            target = null;
        }
        if (target == null) {
            sparkTrail.clear();
            return;
        }
        auraProcess(event);
    }

    private void auraProcess(Render2DEvent event) {
        KillAura aura = KillAura.getInstance();
        drawPrizrakiEbat(event.getMatrix());
    }

    private boolean isParticleOccluded(Vector3d cameraPos, Vector3d particlePos, AxisAlignedBB targetBB) {
        return false;
    }

    public void drawPrizrakiEbat(MatrixStack matrix) {
        matrix.push();
        float alphaPC = markerAnimation.get();
        if (alphaPC == 0.0F || target == null) {
            matrix.pop();
            return;
        }

        Vector3d vec = RenderUtil3D.interpolate(target, mc.getRenderPartialTicks());
        double baseX = vec.x;
        double baseY = vec.y + target.getHeight() / 2f;
        double baseZ = vec.z;
        // ебать настройка для призраков =0,
        final double radius = 0.55f;
        final float speed = 30f;
        final double distanceStep = 1.5;
        final int trailLength = 300;
        //Конец (((
        long time = System.currentTimeMillis();
        float hurtPC = (float) Math.sin(target.hurtTime * (1F * Math.PI / 25F));
        Vector3d cameraPos = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
        RenderSystem.disableDepthTest();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.depthMask(false);
        RenderSystem.blendFuncSeparate(770, 771, 1, 0);
        mc.getTextureManager().bindTexture(bloomTexture);

        for (int i = 0; i < trailLength; i++) {
            double angle = 0.1f * (time - i * distanceStep) / speed;
            double s = Math.sin(angle) * radius;
            double c = Math.cos(angle) * radius;

            double[][] points = new double[][]{
                    {baseX + s, baseY + c, baseZ - c},
                    {baseX - s, baseY + s, baseZ - c},
                    {baseX - s, baseY - s, baseZ + c}
            };

            float progress = (float) i / trailLength;
            float sizeFactor = (float) Math.pow(1.0f - progress, 1.1F);

            for (double[] pos : points) {
                Vector3d particlePos = new Vector3d(pos[0], pos[1], pos[2]);
                if (isParticleOccluded(cameraPos, particlePos, target.getBoundingBox())) continue;
                Vector2f marker = Project.project2D(particlePos.x, particlePos.y, particlePos.z);
                if (marker.x == Float.MAX_VALUE) continue;
                double distance = cameraPos.distanceTo(particlePos);
                //вот тут размер если что
                float distanceScale = (float) (85.0f / Math.max(0, distance));
                //Конец (((
                float pulse = 1f + 0 * (float) Math.sin(time / 0.01 + i);
                float finalSize = distanceScale * sizeFactor * pulse;
                float alphaTrail = alphaPC * (1f - progress * progress) * 0.4f;
                int baseColor = ColorUtil.multBright(Theme.getInstance().clientColor(), 1.2f);
                int red = ColorUtil.getColor(255, 0, 0);
                int finalColor = ColorUtil.overCol(ColorUtil.multAlpha(baseColor, alphaTrail), ColorUtil.multAlpha(red, alphaTrail), hurtPC);
                float rotation = (float) (time / 5.0 + i * 5) % 180;
                matrix.push();
                matrix.translate(marker.x, marker.y, 0);
                GLUtil.rotate(matrix, 0, 0, Vector3f.ZP.rotationDegrees(rotation), () -> RectUtil.drawRect(matrix, -finalSize / 2f, -finalSize / 2f, finalSize, finalSize, finalColor, true, true));
                matrix.pop();
            }
        }

        RenderSystem.enableDepthTest();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableBlend();
        RenderSystem.depthMask(true);
        matrix.pop();
    }
}
Одобрите плиз
это че за головастики xD
 
Назад
Сверху Снизу