Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 30 Май 2025
- Сообщения
- 2
- Реакции
- 0
вот мой рендер -
вот где я его вызываю -
квадрат просто не рендерится, в логах всё норм, помогите
Код:
package ru.refacus.heart.api.util.render;
import com.mojang.blaze3d.pipeline.BlendFunction;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.DepthTestFunction;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.gl.UniformType;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.util.Identifier;
public class RenderUtil {
private final RenderPipeline.Snippet TRANSFORMS_AND_PROJECTION = RenderPipeline.builder()
.withUniform("DynamicTransforms", UniformType.UNIFORM_BUFFER)
.withUniform("Projection", UniformType.UNIFORM_BUFFER)
.buildSnippet();
private final RenderPipeline.Snippet REFACUS_GUI_SNIPPET = RenderPipeline.builder(TRANSFORMS_AND_PROJECTION)
.withVertexShader(Identifier.of("refacus", "core/refacus_gui"))
.withFragmentShader(Identifier.of("refacus", "core/refacus_gui"))
.withBlend(BlendFunction.TRANSLUCENT)
.withCull(true)
.withDepthWrite(true)
.withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
.withVertexFormat(VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.QUADS)
.buildSnippet();
public final RenderPipeline pipeline = RenderPipeline.builder(REFACUS_GUI_SNIPPET)
.withLocation(Identifier.of("refacus", "pipeline/gui"))
.build();
public void drawQuad(DrawContext drawContext, int x, int y, int width, int height, int color) {
drawContext.fill(pipeline, x, y, x + width, y + height, color);
}
}
вот где я его вызываю -
Код:
package ru.refacus.heart.mixins;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.refacus.heart.api.util.render.RenderUtil;
@Mixin(TitleScreen.class)
public class TitleScreenMixin {
@Inject(method = "render", at = @At("TAIL"))
private void onRender(DrawContext ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
new RenderUtil().drawQuad(ctx, 10, 10, 100, 100, 0xFFFFFFFF);
}
}
квадрат просто не рендерится, в логах всё норм, помогите
Последнее редактирование модератором: