Вопрос 3D Render 1.16.5

Начинающий
Статус
Оффлайн
Регистрация
20 Авг 2023
Сообщения
11
Реакции[?]
0
Поинты[?]
0

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

halo, при переносе софтвара с 1.12.2 на 1.16.5 столкнулся с проблемой: при рендере box'а ентити происходит сенсация: боксы рендерятся где-то далеко в небе (
Пожалуйста, авторизуйтесь для просмотра ссылки.
) помогите блять я ваще в этом MatrixStack нихуя не понимаю
EventRender3D вызывается в WorldRenderer.java (updateCameraAndRender) в 570 строке


drawBox:
   public static void drawBox(AxisAlignedBB bb) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1, 1, 1, 1);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(1, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.maxZ).endVertex();
        tessellator.draw();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
WorldRenderer.java:
  public void updateCameraAndRender(MatrixStack matrixStackIn, float partialTicks, long finishTimeNano, boolean drawBlockOutline, ActiveRenderInfo activeRenderInfoIn, GameRenderer gameRendererIn, LightTexture lightmapIn, Matrix4f projectionIn)
{
TileEntityRendererDispatcher.instance.prepare(this.world, this.mc.getTextureManager(), this.mc.fontRenderer, activeRenderInfoIn, this.mc.objectMouseOver);
    this.renderManager.cacheActiveRenderInfo(this.world, activeRenderInfoIn, this.mc.pointedEntity);
    IProfiler iprofiler = this.world.getProfiler();
    iprofiler.endStartSection("light_updates");
    this.mc.world.getChunkProvider().getLightManager().tick(Integer.MAX_VALUE, true, true);
    Vector3d vector3d = activeRenderInfoIn.getProjectedView();
    double d0 = vector3d.getX();
    double d1 = vector3d.getY();
    double d2 = vector3d.getZ();
    Matrix4f matrix4f = matrixStackIn.getLast().getMatrix();
    iprofiler.endStartSection("culling");
    boolean flag = this.debugFixedClippingHelper != null;
    ClippingHelper clippinghelper;

    if (flag)
{
clippinghelper = this.debugFixedClippingHelper;
        clippinghelper.setCameraPosition(this.debugTerrainFrustumPosition.x, this.debugTerrainFrustumPosition.y, this.debugTerrainFrustumPosition.z);
    }
else
    {
clippinghelper = new ClippingHelper(matrix4f, projectionIn);
        clippinghelper.setCameraPosition(d0, d1, d2);
    }

this.mc.getProfiler().endStartSection("captureFrustum");

    if (this.debugFixTerrainFrustum)
{
this.captureFrustum(matrix4f, projectionIn, vector3d.x, vector3d.y, vector3d.z, flag ? new ClippingHelper(matrix4f, projectionIn) : clippinghelper);
        this.debugFixTerrainFrustum = false;
    }

iprofiler.endStartSection("clear");

    if (Config.isShaders())
{
Shaders.setViewport(0, 0, this.mc.getMainWindow().getFramebufferWidth(), this.mc.getMainWindow().getFramebufferHeight());
    }
else
    {
RenderSystem.viewport(0, 0, this.mc.getMainWindow().getFramebufferWidth(), this.mc.getMainWindow().getFramebufferHeight());
    }

FogRenderer.updateFogColor(activeRenderInfoIn, partialTicks, this.mc.world, this.mc.gameSettings.renderDistanceChunks, gameRendererIn.getBossColorModifier(partialTicks));
    RenderSystem.clear(16640, Minecraft.IS_RUNNING_ON_MAC);
    boolean flag1 = Config.isShaders();

    if (flag1)
{
Shaders.clearRenderBuffer();
        Shaders.setCamera(matrixStackIn, activeRenderInfoIn, partialTicks);
        Shaders.renderPrepare();
    }

clippinghelper.disabled = Config.isShaders() && !Shaders.isFrustumCulling();
    float f = gameRendererIn.getFarPlaneDistance();
    boolean flag2 = this.mc.world.func_239132_a_().func_230493_a_(MathHelper.floor(d0), MathHelper.floor(d1)) || this.mc.ingameGUI.getBossOverlay().shouldCreateFog();

    if ((Config.isSkyEnabled() || Config.isSunMoonEnabled() || Config.isStarsEnabled()) && !Shaders.isShadowPass)
{
FogRenderer.setupFog(activeRenderInfoIn, FogRenderer.FogType.FOG_SKY, f, flag2, partialTicks);
        iprofiler.endStartSection("sky");

        if (flag1)
{
Shaders.beginSky();
        }

this.renderSky(matrixStackIn, partialTicks);

        if (flag1)
{
Shaders.endSky();
        }
}
else
    {
GlStateManager.disableBlend();
    }

iprofiler.endStartSection("fog");
    FogRenderer.setupFog(activeRenderInfoIn, FogRenderer.FogType.FOG_TERRAIN, Math.max(f - 16.0F, 32.0F), flag2, partialTicks);
    iprofiler.endStartSection("terrain_setup");
    this.checkLoadVisibleChunks(activeRenderInfoIn, clippinghelper, this.mc.player.isSpectator());
    this.setupTerrain(activeRenderInfoIn, clippinghelper, flag, this.frameId++, this.mc.player.isSpectator());
    iprofiler.endStartSection("updatechunks");
    int i = 30;
    int j = this.mc.gameSettings.framerateLimit;
    long k = 33333333L;
    long l;

    if ((double)j == AbstractOption.FRAMERATE_LIMIT.getMaxValue())
{
l = 0L;
    }
else
    {
l = (long)(1000000000 / j);
    }

long i1 = Util.nanoTime() - finishTimeNano;
    long j1 = this.renderTimeManager.nextValue(i1);
    long k1 = j1 * 3L / 2L;
    long l1 = MathHelper.clamp(k1, l, 33333333L);
    Lagometer.timerChunkUpload.start();
    this.updateChunks(finishTimeNano + l1);
    Lagometer.timerChunkUpload.end();
    iprofiler.endStartSection("terrain");
    Lagometer.timerTerrain.start();

    if (this.mc.gameSettings.ofSmoothFps)
{
this.mc.getProfiler().endStartSection("finish");
        GL11.glFinish();
        this.mc.getProfiler().endStartSection("terrain");
    }

if (Config.isFogOff() && FogRenderer.fogStandard)
{
GlStateManager.setFogAllowed(false);
    }

this.renderBlockLayer(RenderType.getSolid(), matrixStackIn, d0, d1, d2);
    this.mc.getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmapDirect(false, this.mc.gameSettings.mipmapLevels > 0);
    this.renderBlockLayer(RenderType.getCutoutMipped(), matrixStackIn, d0, d1, d2);
    this.mc.getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
    this.renderBlockLayer(RenderType.getCutout(), matrixStackIn, d0, d1, d2);

    if (flag1)
{
ShadersRender.endTerrain();
    }

Lagometer.timerTerrain.end();

    if (this.world.func_239132_a_().func_239217_c_())
{
RenderHelper.setupDiffuseGuiLighting(matrixStackIn.getLast().getMatrix());
    }
else
    {
RenderHelper.setupLevelDiffuseLighting(matrixStackIn.getLast().getMatrix());
    }

if (flag1)
{
Shaders.beginEntities();
    }

ItemFrameRenderer.updateItemRenderDistance();
    iprofiler.endStartSection("entities");
    ++renderEntitiesCounter;
    this.countEntitiesRendered = 0;
    this.countEntitiesHidden = 0;
    this.countTileEntitiesRendered = 0;

    if (this.field_239223_G_ != null)
{
this.field_239223_G_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239223_G_.func_237506_a_(this.mc.getFramebuffer());
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

if (this.field_239225_I_ != null)
{
this.field_239225_I_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
    }

if (this.isRenderEntityOutlines())
{
this.entityOutlineFramebuffer.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

boolean flag3 = false;
    IRenderTypeBuffer.Impl irendertypebuffer$impl = this.renderTypeTextures.getBufferSource();

    if (Config.isFastRender())
{
RenderStateManager.enableCache();
    }

for (WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer : this.renderInfosEntities)
{
ChunkRenderDispatcher.ChunkRender chunkrenderdispatcher$chunkrender = worldrenderer$localrenderinformationcontainer.renderChunk;
        Chunk chunk = chunkrenderdispatcher$chunkrender.getChunk();

        for (Entity entity : chunk.getEntityLists()[chunkrenderdispatcher$chunkrender.getPosition().getY() / 16])
{
boolean flag4 = entity == this.mc.player && !this.mc.player.isSpectator();

            if ((this.renderManager.shouldRender(entity, clippinghelper, d0, d1, d2) || entity.isRidingOrBeingRiddenBy(this.mc.player)) && (entity != activeRenderInfoIn.getRenderViewEntity() || activeRenderInfoIn.isThirdPerson() || activeRenderInfoIn.getRenderViewEntity() instanceof LivingEntity && ((LivingEntity)activeRenderInfoIn.getRenderViewEntity()).isSleeping()) && (!(entity instanceof ClientPlayerEntity) || activeRenderInfoIn.getRenderViewEntity() == entity || flag4))
{
String s = entity.getClass().getName();
                List<Entity> list = this.mapEntityLists.get(s);

                if (list == null)
{
list = new ArrayList<>();
                    this.mapEntityLists.put(s, list);
                }

list.add(entity);
            }
}
}

for (List<Entity> list1 : this.mapEntityLists.values())
{
for (Entity entity1 : list1)
{
++this.countEntitiesRendered;

            if (entity1.ticksExisted == 0)
{
entity1.lastTickPosX = entity1.getPosX();
                entity1.lastTickPosY = entity1.getPosY();
                entity1.lastTickPosZ = entity1.getPosZ();
            }

IRenderTypeBuffer irendertypebuffer;

            if (this.isRenderEntityOutlines() && this.mc.isEntityGlowing(entity1))
{
flag3 = true;
                OutlineLayerBuffer outlinelayerbuffer = this.renderTypeTextures.getOutlineBufferSource();
                irendertypebuffer = outlinelayerbuffer;
                int k2 = entity1.getTeamColor();
                int l2 = 255;
                int i3 = k2 >> 16 & 255;
                int i2 = k2 >> 8 & 255;
                int j2 = k2 & 255;
                outlinelayerbuffer.setColor(i3, i2, j2, 255);
            }
else
            {
irendertypebuffer = irendertypebuffer$impl;
            }

this.renderedEntity = entity1;

            if (flag1)
{
Shaders.nextEntity(entity1);
            }

this.renderEntity(entity1, d0, d1, d2, partialTicks, matrixStackIn, irendertypebuffer);
            this.renderedEntity = null;
        }

list1.clear();
    }

this.checkMatrixStack(matrixStackIn);
    irendertypebuffer$impl.finish(RenderType.getEntitySolid(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntityCutout(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntityCutoutNoCull(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntitySmoothCutout(AtlasTexture.LOCATION_BLOCKS_TEXTURE));

    if (flag1)
{
Shaders.endEntities();
        Shaders.beginBlockEntities();
    }

iprofiler.endStartSection("blockentities");
    SignTileEntityRenderer.updateTextRenderDistance();
    boolean flag5 = Reflector.IForgeTileEntity_getRenderBoundingBox.exists();
    ClippingHelper clippinghelper1 = clippinghelper;
    label354:

for (WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer1 : this.renderInfosTileEntities)
{
List<TileEntity> list2 = worldrenderer$localrenderinformationcontainer1.renderChunk.getCompiledChunk().getTileEntities();

        if (!list2.isEmpty())
{
Iterator iterator1 = list2.iterator();

            while (true)
{
TileEntity tileentity1;
                AxisAlignedBB axisalignedbb1;

                do
                {
if (!iterator1.hasNext())
{
continue label354;
                    }

tileentity1 = (TileEntity)iterator1.next();

                    if (!flag5)
{
break;
                    }

axisalignedbb1 = (AxisAlignedBB)Reflector.call(tileentity1, Reflector.IForgeTileEntity_getRenderBoundingBox);
                }
while (axisalignedbb1 != null && !clippinghelper1.isBoundingBoxInFrustum(axisalignedbb1));

                if (flag1)
{
Shaders.nextBlockEntity(tileentity1);
                }

BlockPos blockpos3 = tileentity1.getPos();
                IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl;
                matrixStackIn.push();
                matrixStackIn.translate((double)blockpos3.getX() - d0, (double)blockpos3.getY() - d1, (double)blockpos3.getZ() - d2);
                SortedSet<DestroyBlockProgress> sortedset = this.damageProgress.get(blockpos3.toLong());

                if (sortedset != null && !sortedset.isEmpty())
{
int j3 = sortedset.last().getPartialBlockDamage();

                    if (j3 >= 0)
{
MatrixStack.Entry matrixstack$entry = matrixStackIn.getLast();
                        IVertexBuilder ivertexbuilder = new MatrixApplyingVertexBuilder(this.renderTypeTextures.getCrumblingBufferSource().getBuffer(ModelBakery.DESTROY_RENDER_TYPES.get(j3)), matrixstack$entry.getMatrix(), matrixstack$entry.getNormal());
                        irendertypebuffer1 = (p_lambda$updateCameraAndRender$1_2_) ->
{
IVertexBuilder ivertexbuilder3 = irendertypebuffer$impl.getBuffer(p_lambda$updateCameraAndRender$1_2_);
                            return p_lambda$updateCameraAndRender$1_2_.isUseDelegate() ? VertexBuilderUtils.newDelegate(ivertexbuilder, ivertexbuilder3) : ivertexbuilder3;
                        };
                    }
}

TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, matrixStackIn, irendertypebuffer1);
                matrixStackIn.pop();
                ++this.countTileEntitiesRendered;
            }
}
}

synchronized (this.setTileEntities)
{
Iterator iterator = this.setTileEntities.iterator();
        label329:

while (true)
{
TileEntity tileentity;
            AxisAlignedBB axisalignedbb;

            do
            {
if (!iterator.hasNext())
{
break label329;
                }

tileentity = (TileEntity)iterator.next();

                if (!flag5)
{
break;
                }

axisalignedbb = (AxisAlignedBB)Reflector.call(tileentity, Reflector.IForgeTileEntity_getRenderBoundingBox);
            }
while (axisalignedbb != null && !clippinghelper1.isBoundingBoxInFrustum(axisalignedbb));

            if (flag1)
{
Shaders.nextBlockEntity(tileentity);
            }

BlockPos blockpos2 = tileentity.getPos();
            matrixStackIn.push();
            matrixStackIn.translate((double)blockpos2.getX() - d0, (double)blockpos2.getY() - d1, (double)blockpos2.getZ() - d2);
            TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, matrixStackIn, irendertypebuffer$impl);
            matrixStackIn.pop();
            ++this.countTileEntitiesRendered;
        }
}

this.checkMatrixStack(matrixStackIn);
    irendertypebuffer$impl.finish(RenderType.getSolid());
    irendertypebuffer$impl.finish(Atlases.getSolidBlockType());
    irendertypebuffer$impl.finish(Atlases.getCutoutBlockType());
    irendertypebuffer$impl.finish(Atlases.getBedType());
    irendertypebuffer$impl.finish(Atlases.getShulkerBoxType());
    irendertypebuffer$impl.finish(Atlases.getSignType());
    irendertypebuffer$impl.finish(Atlases.getChestType());
    irendertypebuffer$impl.finish(Atlases.getBannerType());
    this.renderTypeTextures.getOutlineBufferSource().finish();

    if (Config.isFastRender())
{
RenderStateManager.disableCache();
    }

if (flag3)
{
this.entityOutlineShader.render(partialTicks);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

if (flag1)
{
Shaders.endBlockEntities();
    }

this.renderOverlayDamaged = true;
    iprofiler.endStartSection("destroyProgress");

    for (Entry<SortedSet<DestroyBlockProgress>> entry : this.damageProgress.long2ObjectEntrySet())
{
BlockPos blockpos1 = BlockPos.fromLong(entry.getLongKey());
        double d3 = (double)blockpos1.getX() - d0;
        double d4 = (double)blockpos1.getY() - d1;
        double d5 = (double)blockpos1.getZ() - d2;

        if (!(d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D))
{
SortedSet<DestroyBlockProgress> sortedset1 = entry.getValue();

            if (sortedset1 != null && !sortedset1.isEmpty())
{
int k3 = sortedset1.last().getPartialBlockDamage();
                matrixStackIn.push();
                matrixStackIn.translate((double)blockpos1.getX() - d0, (double)blockpos1.getY() - d1, (double)blockpos1.getZ() - d2);
                MatrixStack.Entry matrixstack$entry1 = matrixStackIn.getLast();
                IVertexBuilder ivertexbuilder1 = new MatrixApplyingVertexBuilder(this.renderTypeTextures.getCrumblingBufferSource().getBuffer(ModelBakery.DESTROY_RENDER_TYPES.get(k3)), matrixstack$entry1.getMatrix(), matrixstack$entry1.getNormal());
                this.mc.getBlockRendererDispatcher().renderBlockDamage(this.world.getBlockState(blockpos1), blockpos1, this.world, matrixStackIn, ivertexbuilder1);
                matrixStackIn.pop();
            }
}
}

this.renderOverlayDamaged = false;
    RenderUtils.flushRenderBuffers();
    --renderEntitiesCounter;
    this.checkMatrixStack(matrixStackIn);
    RayTraceResult raytraceresult = this.mc.objectMouseOver;

    if (drawBlockOutline && raytraceresult != null && raytraceresult.getType() == RayTraceResult.Type.BLOCK)
{
iprofiler.endStartSection("outline");
        BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).getPos();
        BlockState blockstate = this.world.getBlockState(blockpos);

        if (flag1)
{
ShadersRender.beginOutline();
        }

boolean flag7;

        if (Reflector.IForgeBlockState_isAir2.exists() && Reflector.ForgeHooksClient_onDrawBlockHighlight.exists())
{
flag7 = !Reflector.callBoolean(Reflector.ForgeHooksClient_onDrawBlockHighlight, this, activeRenderInfoIn, raytraceresult, partialTicks, matrixStackIn, irendertypebuffer$impl) && !Reflector.callBoolean(blockstate, Reflector.IForgeBlockState_isAir2, this.world, blockpos) && this.world.getWorldBorder().contains(blockpos);
        }
else
        {
flag7 = !blockstate.isAir() && this.world.getWorldBorder().contains(blockpos);
        }

if (flag7)
{
IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.getLines());
            this.drawSelectionBox(matrixStackIn, ivertexbuilder2, activeRenderInfoIn.getRenderViewEntity(), d0, d1, d2, blockpos, blockstate);
        }
if (flag1)
{
irendertypebuffer$impl.finish(RenderType.getLines());
            ShadersRender.endOutline();
        }
}
else if (raytraceresult != null && raytraceresult.getType() == RayTraceResult.Type.ENTITY)
{
Reflector.ForgeHooksClient_onDrawBlockHighlight.call(this, activeRenderInfoIn, raytraceresult, partialTicks, matrixStackIn, irendertypebuffer$impl);
    }

RenderSystem.pushMatrix();
    RenderSystem.multMatrix(matrixStackIn.getLast().getMatrix());
    boolean flag6 = GlStateManager.isFogEnabled();
    GlStateManager.disableFog();

    if (flag1)
{
ShadersRender.beginDebug();
    }

this.mc.debugRenderer.render(matrixStackIn, irendertypebuffer$impl, d0, d1, d2);
    RenderSystem.popMatrix();
    irendertypebuffer$impl.finish(Atlases.getTranslucentCullBlockType());
    irendertypebuffer$impl.finish(Atlases.getBannerType());
    irendertypebuffer$impl.finish(Atlases.getShieldType());
    irendertypebuffer$impl.finish(RenderType.getArmorGlint());
    irendertypebuffer$impl.finish(RenderType.getArmorEntityGlint());
    irendertypebuffer$impl.finish(RenderType.getGlint());
    irendertypebuffer$impl.finish(RenderType.getGlintDirect());
    irendertypebuffer$impl.finish(RenderType.getGlintTranslucent());
    irendertypebuffer$impl.finish(RenderType.getEntityGlint());
    irendertypebuffer$impl.finish(RenderType.getEntityGlintDirect());
    irendertypebuffer$impl.finish(RenderType.getWaterMask());
    this.renderTypeTextures.getCrumblingBufferSource().finish();
    GlStateManager.setFogEnabled(flag6);

    if (flag1)
{
irendertypebuffer$impl.finish();
        ShadersRender.endDebug();
        Shaders.preRenderHand();
        ShadersRender.renderHand0(gameRendererIn, matrixStackIn, activeRenderInfoIn, partialTicks);
        Shaders.preWater();
    }

if (this.field_239227_K_ != null)
{
irendertypebuffer$impl.finish(RenderType.getLines());
        irendertypebuffer$impl.finish();
        this.field_239222_F_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239222_F_.func_237506_a_(this.mc.getFramebuffer());
        iprofiler.endStartSection("translucent");
        this.renderBlockLayer(RenderType.getTranslucent(), matrixStackIn, d0, d1, d2);
        iprofiler.endStartSection("string");
        this.renderBlockLayer(RenderType.getTripwire(), matrixStackIn, d0, d1, d2);
        this.field_239224_H_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239224_H_.func_237506_a_(this.mc.getFramebuffer());
        RenderState.field_239237_T_.setupRenderState();
        iprofiler.endStartSection("particles");
        this.mc.particles.renderParticles(matrixStackIn, irendertypebuffer$impl, lightmapIn, activeRenderInfoIn, partialTicks, clippinghelper);
        RenderState.field_239237_T_.clearRenderState();
    }
else
    {
iprofiler.endStartSection("translucent");

        if (flag1)
{
Shaders.beginWater();
        }

this.renderBlockLayer(RenderType.getTranslucent(), matrixStackIn, d0, d1, d2);

        if (flag1)
{
Shaders.endWater();
        }

irendertypebuffer$impl.finish(RenderType.getLines());
        irendertypebuffer$impl.finish();
        iprofiler.endStartSection("string");
        this.renderBlockLayer(RenderType.getTripwire(), matrixStackIn, d0, d1, d2);
        iprofiler.endStartSection("particles");

        if (flag1)
{
Shaders.beginParticles();
        }

this.mc.particles.renderParticles(matrixStackIn, irendertypebuffer$impl, lightmapIn, activeRenderInfoIn, partialTicks, clippinghelper);

        if (flag1)
{
Shaders.endParticles();
        }
}

GlStateManager.setFogAllowed(true);
    RenderSystem.pushMatrix();
    RenderSystem.multMatrix(matrixStackIn.getLast().getMatrix());
    EventManager.trigger(new EventRender3D(partialTicks, matrixStackIn));


    if (this.mc.gameSettings.getCloudOption() != CloudOption.OFF)
{
if (this.field_239227_K_ != null)
{
this.field_239226_J_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
            RenderState.field_239239_V_.setupRenderState();
            iprofiler.endStartSection("clouds");
            this.renderClouds(matrixStackIn, partialTicks, d0, d1, d2);
            RenderState.field_239239_V_.clearRenderState();
        }
else
        {
iprofiler.endStartSection("clouds");
            this.renderClouds(matrixStackIn, partialTicks, d0, d1, d2);
        }
}
if (this.field_239227_K_ != null)
{
RenderState.field_239238_U_.setupRenderState();
        iprofiler.endStartSection("weather");
        this.renderRainSnow(lightmapIn, partialTicks, d0, d1, d2);
        this.renderWorldBorder(activeRenderInfoIn);
        RenderState.field_239238_U_.clearRenderState();
        this.field_239227_K_.render(partialTicks);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }
else
    {
RenderSystem.depthMask(false);

        if (Config.isShaders())
{
GlStateManager.depthMask(Shaders.isRainDepth());
        }

iprofiler.endStartSection("weather");

        if (flag1)
{
Shaders.beginWeather();
        }

this.renderRainSnow(lightmapIn, partialTicks, d0, d1, d2);

        if (flag1)
{
Shaders.endWeather();
        }

this.renderWorldBorder(activeRenderInfoIn);
        RenderSystem.depthMask(true);
    }
this.renderDebug(activeRenderInfoIn);
    RenderSystem.shadeModel(7424);
    RenderSystem.depthMask(true);
    RenderSystem.disableBlend();
    RenderSystem.popMatrix();
    FogRenderer.resetFog();
}
 
Начинающий
Статус
Оффлайн
Регистрация
10 Авг 2023
Сообщения
17
Реакции[?]
0
Поинты[?]
0
halo, при переносе софтвара с 1.12.2 на 1.16.5 столкнулся с проблемой: при рендере box'а ентити происходит сенсация: боксы рендерятся где-то далеко в небе (
Пожалуйста, авторизуйтесь для просмотра ссылки.
) помогите блять я ваще в этом MatrixStack нихуя не понимаю
EventRender3D вызывается в WorldRenderer.java (updateCameraAndRender) в 570 строке


drawBox:
   public static void drawBox(AxisAlignedBB bb) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1, 1, 1, 1);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(1, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(bb.minX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.minZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.maxX, bb.maxY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.minY, bb.maxZ).endVertex();
        vertexbuffer.pos(bb.minX, bb.maxY, bb.maxZ).endVertex();
        tessellator.draw();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
WorldRenderer.java:
  public void updateCameraAndRender(MatrixStack matrixStackIn, float partialTicks, long finishTimeNano, boolean drawBlockOutline, ActiveRenderInfo activeRenderInfoIn, GameRenderer gameRendererIn, LightTexture lightmapIn, Matrix4f projectionIn)
{
TileEntityRendererDispatcher.instance.prepare(this.world, this.mc.getTextureManager(), this.mc.fontRenderer, activeRenderInfoIn, this.mc.objectMouseOver);
    this.renderManager.cacheActiveRenderInfo(this.world, activeRenderInfoIn, this.mc.pointedEntity);
    IProfiler iprofiler = this.world.getProfiler();
    iprofiler.endStartSection("light_updates");
    this.mc.world.getChunkProvider().getLightManager().tick(Integer.MAX_VALUE, true, true);
    Vector3d vector3d = activeRenderInfoIn.getProjectedView();
    double d0 = vector3d.getX();
    double d1 = vector3d.getY();
    double d2 = vector3d.getZ();
    Matrix4f matrix4f = matrixStackIn.getLast().getMatrix();
    iprofiler.endStartSection("culling");
    boolean flag = this.debugFixedClippingHelper != null;
    ClippingHelper clippinghelper;

    if (flag)
{
clippinghelper = this.debugFixedClippingHelper;
        clippinghelper.setCameraPosition(this.debugTerrainFrustumPosition.x, this.debugTerrainFrustumPosition.y, this.debugTerrainFrustumPosition.z);
    }
else
    {
clippinghelper = new ClippingHelper(matrix4f, projectionIn);
        clippinghelper.setCameraPosition(d0, d1, d2);
    }

this.mc.getProfiler().endStartSection("captureFrustum");

    if (this.debugFixTerrainFrustum)
{
this.captureFrustum(matrix4f, projectionIn, vector3d.x, vector3d.y, vector3d.z, flag ? new ClippingHelper(matrix4f, projectionIn) : clippinghelper);
        this.debugFixTerrainFrustum = false;
    }

iprofiler.endStartSection("clear");

    if (Config.isShaders())
{
Shaders.setViewport(0, 0, this.mc.getMainWindow().getFramebufferWidth(), this.mc.getMainWindow().getFramebufferHeight());
    }
else
    {
RenderSystem.viewport(0, 0, this.mc.getMainWindow().getFramebufferWidth(), this.mc.getMainWindow().getFramebufferHeight());
    }

FogRenderer.updateFogColor(activeRenderInfoIn, partialTicks, this.mc.world, this.mc.gameSettings.renderDistanceChunks, gameRendererIn.getBossColorModifier(partialTicks));
    RenderSystem.clear(16640, Minecraft.IS_RUNNING_ON_MAC);
    boolean flag1 = Config.isShaders();

    if (flag1)
{
Shaders.clearRenderBuffer();
        Shaders.setCamera(matrixStackIn, activeRenderInfoIn, partialTicks);
        Shaders.renderPrepare();
    }

clippinghelper.disabled = Config.isShaders() && !Shaders.isFrustumCulling();
    float f = gameRendererIn.getFarPlaneDistance();
    boolean flag2 = this.mc.world.func_239132_a_().func_230493_a_(MathHelper.floor(d0), MathHelper.floor(d1)) || this.mc.ingameGUI.getBossOverlay().shouldCreateFog();

    if ((Config.isSkyEnabled() || Config.isSunMoonEnabled() || Config.isStarsEnabled()) && !Shaders.isShadowPass)
{
FogRenderer.setupFog(activeRenderInfoIn, FogRenderer.FogType.FOG_SKY, f, flag2, partialTicks);
        iprofiler.endStartSection("sky");

        if (flag1)
{
Shaders.beginSky();
        }

this.renderSky(matrixStackIn, partialTicks);

        if (flag1)
{
Shaders.endSky();
        }
}
else
    {
GlStateManager.disableBlend();
    }

iprofiler.endStartSection("fog");
    FogRenderer.setupFog(activeRenderInfoIn, FogRenderer.FogType.FOG_TERRAIN, Math.max(f - 16.0F, 32.0F), flag2, partialTicks);
    iprofiler.endStartSection("terrain_setup");
    this.checkLoadVisibleChunks(activeRenderInfoIn, clippinghelper, this.mc.player.isSpectator());
    this.setupTerrain(activeRenderInfoIn, clippinghelper, flag, this.frameId++, this.mc.player.isSpectator());
    iprofiler.endStartSection("updatechunks");
    int i = 30;
    int j = this.mc.gameSettings.framerateLimit;
    long k = 33333333L;
    long l;

    if ((double)j == AbstractOption.FRAMERATE_LIMIT.getMaxValue())
{
l = 0L;
    }
else
    {
l = (long)(1000000000 / j);
    }

long i1 = Util.nanoTime() - finishTimeNano;
    long j1 = this.renderTimeManager.nextValue(i1);
    long k1 = j1 * 3L / 2L;
    long l1 = MathHelper.clamp(k1, l, 33333333L);
    Lagometer.timerChunkUpload.start();
    this.updateChunks(finishTimeNano + l1);
    Lagometer.timerChunkUpload.end();
    iprofiler.endStartSection("terrain");
    Lagometer.timerTerrain.start();

    if (this.mc.gameSettings.ofSmoothFps)
{
this.mc.getProfiler().endStartSection("finish");
        GL11.glFinish();
        this.mc.getProfiler().endStartSection("terrain");
    }

if (Config.isFogOff() && FogRenderer.fogStandard)
{
GlStateManager.setFogAllowed(false);
    }

this.renderBlockLayer(RenderType.getSolid(), matrixStackIn, d0, d1, d2);
    this.mc.getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmapDirect(false, this.mc.gameSettings.mipmapLevels > 0);
    this.renderBlockLayer(RenderType.getCutoutMipped(), matrixStackIn, d0, d1, d2);
    this.mc.getTextureManager().getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
    this.renderBlockLayer(RenderType.getCutout(), matrixStackIn, d0, d1, d2);

    if (flag1)
{
ShadersRender.endTerrain();
    }

Lagometer.timerTerrain.end();

    if (this.world.func_239132_a_().func_239217_c_())
{
RenderHelper.setupDiffuseGuiLighting(matrixStackIn.getLast().getMatrix());
    }
else
    {
RenderHelper.setupLevelDiffuseLighting(matrixStackIn.getLast().getMatrix());
    }

if (flag1)
{
Shaders.beginEntities();
    }

ItemFrameRenderer.updateItemRenderDistance();
    iprofiler.endStartSection("entities");
    ++renderEntitiesCounter;
    this.countEntitiesRendered = 0;
    this.countEntitiesHidden = 0;
    this.countTileEntitiesRendered = 0;

    if (this.field_239223_G_ != null)
{
this.field_239223_G_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239223_G_.func_237506_a_(this.mc.getFramebuffer());
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

if (this.field_239225_I_ != null)
{
this.field_239225_I_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
    }

if (this.isRenderEntityOutlines())
{
this.entityOutlineFramebuffer.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

boolean flag3 = false;
    IRenderTypeBuffer.Impl irendertypebuffer$impl = this.renderTypeTextures.getBufferSource();

    if (Config.isFastRender())
{
RenderStateManager.enableCache();
    }

for (WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer : this.renderInfosEntities)
{
ChunkRenderDispatcher.ChunkRender chunkrenderdispatcher$chunkrender = worldrenderer$localrenderinformationcontainer.renderChunk;
        Chunk chunk = chunkrenderdispatcher$chunkrender.getChunk();

        for (Entity entity : chunk.getEntityLists()[chunkrenderdispatcher$chunkrender.getPosition().getY() / 16])
{
boolean flag4 = entity == this.mc.player && !this.mc.player.isSpectator();

            if ((this.renderManager.shouldRender(entity, clippinghelper, d0, d1, d2) || entity.isRidingOrBeingRiddenBy(this.mc.player)) && (entity != activeRenderInfoIn.getRenderViewEntity() || activeRenderInfoIn.isThirdPerson() || activeRenderInfoIn.getRenderViewEntity() instanceof LivingEntity && ((LivingEntity)activeRenderInfoIn.getRenderViewEntity()).isSleeping()) && (!(entity instanceof ClientPlayerEntity) || activeRenderInfoIn.getRenderViewEntity() == entity || flag4))
{
String s = entity.getClass().getName();
                List<Entity> list = this.mapEntityLists.get(s);

                if (list == null)
{
list = new ArrayList<>();
                    this.mapEntityLists.put(s, list);
                }

list.add(entity);
            }
}
}

for (List<Entity> list1 : this.mapEntityLists.values())
{
for (Entity entity1 : list1)
{
++this.countEntitiesRendered;

            if (entity1.ticksExisted == 0)
{
entity1.lastTickPosX = entity1.getPosX();
                entity1.lastTickPosY = entity1.getPosY();
                entity1.lastTickPosZ = entity1.getPosZ();
            }

IRenderTypeBuffer irendertypebuffer;

            if (this.isRenderEntityOutlines() && this.mc.isEntityGlowing(entity1))
{
flag3 = true;
                OutlineLayerBuffer outlinelayerbuffer = this.renderTypeTextures.getOutlineBufferSource();
                irendertypebuffer = outlinelayerbuffer;
                int k2 = entity1.getTeamColor();
                int l2 = 255;
                int i3 = k2 >> 16 & 255;
                int i2 = k2 >> 8 & 255;
                int j2 = k2 & 255;
                outlinelayerbuffer.setColor(i3, i2, j2, 255);
            }
else
            {
irendertypebuffer = irendertypebuffer$impl;
            }

this.renderedEntity = entity1;

            if (flag1)
{
Shaders.nextEntity(entity1);
            }

this.renderEntity(entity1, d0, d1, d2, partialTicks, matrixStackIn, irendertypebuffer);
            this.renderedEntity = null;
        }

list1.clear();
    }

this.checkMatrixStack(matrixStackIn);
    irendertypebuffer$impl.finish(RenderType.getEntitySolid(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntityCutout(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntityCutoutNoCull(AtlasTexture.LOCATION_BLOCKS_TEXTURE));
    irendertypebuffer$impl.finish(RenderType.getEntitySmoothCutout(AtlasTexture.LOCATION_BLOCKS_TEXTURE));

    if (flag1)
{
Shaders.endEntities();
        Shaders.beginBlockEntities();
    }

iprofiler.endStartSection("blockentities");
    SignTileEntityRenderer.updateTextRenderDistance();
    boolean flag5 = Reflector.IForgeTileEntity_getRenderBoundingBox.exists();
    ClippingHelper clippinghelper1 = clippinghelper;
    label354:

for (WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer1 : this.renderInfosTileEntities)
{
List<TileEntity> list2 = worldrenderer$localrenderinformationcontainer1.renderChunk.getCompiledChunk().getTileEntities();

        if (!list2.isEmpty())
{
Iterator iterator1 = list2.iterator();

            while (true)
{
TileEntity tileentity1;
                AxisAlignedBB axisalignedbb1;

                do
                {
if (!iterator1.hasNext())
{
continue label354;
                    }

tileentity1 = (TileEntity)iterator1.next();

                    if (!flag5)
{
break;
                    }

axisalignedbb1 = (AxisAlignedBB)Reflector.call(tileentity1, Reflector.IForgeTileEntity_getRenderBoundingBox);
                }
while (axisalignedbb1 != null && !clippinghelper1.isBoundingBoxInFrustum(axisalignedbb1));

                if (flag1)
{
Shaders.nextBlockEntity(tileentity1);
                }

BlockPos blockpos3 = tileentity1.getPos();
                IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl;
                matrixStackIn.push();
                matrixStackIn.translate((double)blockpos3.getX() - d0, (double)blockpos3.getY() - d1, (double)blockpos3.getZ() - d2);
                SortedSet<DestroyBlockProgress> sortedset = this.damageProgress.get(blockpos3.toLong());

                if (sortedset != null && !sortedset.isEmpty())
{
int j3 = sortedset.last().getPartialBlockDamage();

                    if (j3 >= 0)
{
MatrixStack.Entry matrixstack$entry = matrixStackIn.getLast();
                        IVertexBuilder ivertexbuilder = new MatrixApplyingVertexBuilder(this.renderTypeTextures.getCrumblingBufferSource().getBuffer(ModelBakery.DESTROY_RENDER_TYPES.get(j3)), matrixstack$entry.getMatrix(), matrixstack$entry.getNormal());
                        irendertypebuffer1 = (p_lambda$updateCameraAndRender$1_2_) ->
{
IVertexBuilder ivertexbuilder3 = irendertypebuffer$impl.getBuffer(p_lambda$updateCameraAndRender$1_2_);
                            return p_lambda$updateCameraAndRender$1_2_.isUseDelegate() ? VertexBuilderUtils.newDelegate(ivertexbuilder, ivertexbuilder3) : ivertexbuilder3;
                        };
                    }
}

TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, matrixStackIn, irendertypebuffer1);
                matrixStackIn.pop();
                ++this.countTileEntitiesRendered;
            }
}
}

synchronized (this.setTileEntities)
{
Iterator iterator = this.setTileEntities.iterator();
        label329:

while (true)
{
TileEntity tileentity;
            AxisAlignedBB axisalignedbb;

            do
            {
if (!iterator.hasNext())
{
break label329;
                }

tileentity = (TileEntity)iterator.next();

                if (!flag5)
{
break;
                }

axisalignedbb = (AxisAlignedBB)Reflector.call(tileentity, Reflector.IForgeTileEntity_getRenderBoundingBox);
            }
while (axisalignedbb != null && !clippinghelper1.isBoundingBoxInFrustum(axisalignedbb));

            if (flag1)
{
Shaders.nextBlockEntity(tileentity);
            }

BlockPos blockpos2 = tileentity.getPos();
            matrixStackIn.push();
            matrixStackIn.translate((double)blockpos2.getX() - d0, (double)blockpos2.getY() - d1, (double)blockpos2.getZ() - d2);
            TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, matrixStackIn, irendertypebuffer$impl);
            matrixStackIn.pop();
            ++this.countTileEntitiesRendered;
        }
}

this.checkMatrixStack(matrixStackIn);
    irendertypebuffer$impl.finish(RenderType.getSolid());
    irendertypebuffer$impl.finish(Atlases.getSolidBlockType());
    irendertypebuffer$impl.finish(Atlases.getCutoutBlockType());
    irendertypebuffer$impl.finish(Atlases.getBedType());
    irendertypebuffer$impl.finish(Atlases.getShulkerBoxType());
    irendertypebuffer$impl.finish(Atlases.getSignType());
    irendertypebuffer$impl.finish(Atlases.getChestType());
    irendertypebuffer$impl.finish(Atlases.getBannerType());
    this.renderTypeTextures.getOutlineBufferSource().finish();

    if (Config.isFastRender())
{
RenderStateManager.disableCache();
    }

if (flag3)
{
this.entityOutlineShader.render(partialTicks);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }

if (flag1)
{
Shaders.endBlockEntities();
    }

this.renderOverlayDamaged = true;
    iprofiler.endStartSection("destroyProgress");

    for (Entry<SortedSet<DestroyBlockProgress>> entry : this.damageProgress.long2ObjectEntrySet())
{
BlockPos blockpos1 = BlockPos.fromLong(entry.getLongKey());
        double d3 = (double)blockpos1.getX() - d0;
        double d4 = (double)blockpos1.getY() - d1;
        double d5 = (double)blockpos1.getZ() - d2;

        if (!(d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D))
{
SortedSet<DestroyBlockProgress> sortedset1 = entry.getValue();

            if (sortedset1 != null && !sortedset1.isEmpty())
{
int k3 = sortedset1.last().getPartialBlockDamage();
                matrixStackIn.push();
                matrixStackIn.translate((double)blockpos1.getX() - d0, (double)blockpos1.getY() - d1, (double)blockpos1.getZ() - d2);
                MatrixStack.Entry matrixstack$entry1 = matrixStackIn.getLast();
                IVertexBuilder ivertexbuilder1 = new MatrixApplyingVertexBuilder(this.renderTypeTextures.getCrumblingBufferSource().getBuffer(ModelBakery.DESTROY_RENDER_TYPES.get(k3)), matrixstack$entry1.getMatrix(), matrixstack$entry1.getNormal());
                this.mc.getBlockRendererDispatcher().renderBlockDamage(this.world.getBlockState(blockpos1), blockpos1, this.world, matrixStackIn, ivertexbuilder1);
                matrixStackIn.pop();
            }
}
}

this.renderOverlayDamaged = false;
    RenderUtils.flushRenderBuffers();
    --renderEntitiesCounter;
    this.checkMatrixStack(matrixStackIn);
    RayTraceResult raytraceresult = this.mc.objectMouseOver;

    if (drawBlockOutline && raytraceresult != null && raytraceresult.getType() == RayTraceResult.Type.BLOCK)
{
iprofiler.endStartSection("outline");
        BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).getPos();
        BlockState blockstate = this.world.getBlockState(blockpos);

        if (flag1)
{
ShadersRender.beginOutline();
        }

boolean flag7;

        if (Reflector.IForgeBlockState_isAir2.exists() && Reflector.ForgeHooksClient_onDrawBlockHighlight.exists())
{
flag7 = !Reflector.callBoolean(Reflector.ForgeHooksClient_onDrawBlockHighlight, this, activeRenderInfoIn, raytraceresult, partialTicks, matrixStackIn, irendertypebuffer$impl) && !Reflector.callBoolean(blockstate, Reflector.IForgeBlockState_isAir2, this.world, blockpos) && this.world.getWorldBorder().contains(blockpos);
        }
else
        {
flag7 = !blockstate.isAir() && this.world.getWorldBorder().contains(blockpos);
        }

if (flag7)
{
IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.getLines());
            this.drawSelectionBox(matrixStackIn, ivertexbuilder2, activeRenderInfoIn.getRenderViewEntity(), d0, d1, d2, blockpos, blockstate);
        }
if (flag1)
{
irendertypebuffer$impl.finish(RenderType.getLines());
            ShadersRender.endOutline();
        }
}
else if (raytraceresult != null && raytraceresult.getType() == RayTraceResult.Type.ENTITY)
{
Reflector.ForgeHooksClient_onDrawBlockHighlight.call(this, activeRenderInfoIn, raytraceresult, partialTicks, matrixStackIn, irendertypebuffer$impl);
    }

RenderSystem.pushMatrix();
    RenderSystem.multMatrix(matrixStackIn.getLast().getMatrix());
    boolean flag6 = GlStateManager.isFogEnabled();
    GlStateManager.disableFog();

    if (flag1)
{
ShadersRender.beginDebug();
    }

this.mc.debugRenderer.render(matrixStackIn, irendertypebuffer$impl, d0, d1, d2);
    RenderSystem.popMatrix();
    irendertypebuffer$impl.finish(Atlases.getTranslucentCullBlockType());
    irendertypebuffer$impl.finish(Atlases.getBannerType());
    irendertypebuffer$impl.finish(Atlases.getShieldType());
    irendertypebuffer$impl.finish(RenderType.getArmorGlint());
    irendertypebuffer$impl.finish(RenderType.getArmorEntityGlint());
    irendertypebuffer$impl.finish(RenderType.getGlint());
    irendertypebuffer$impl.finish(RenderType.getGlintDirect());
    irendertypebuffer$impl.finish(RenderType.getGlintTranslucent());
    irendertypebuffer$impl.finish(RenderType.getEntityGlint());
    irendertypebuffer$impl.finish(RenderType.getEntityGlintDirect());
    irendertypebuffer$impl.finish(RenderType.getWaterMask());
    this.renderTypeTextures.getCrumblingBufferSource().finish();
    GlStateManager.setFogEnabled(flag6);

    if (flag1)
{
irendertypebuffer$impl.finish();
        ShadersRender.endDebug();
        Shaders.preRenderHand();
        ShadersRender.renderHand0(gameRendererIn, matrixStackIn, activeRenderInfoIn, partialTicks);
        Shaders.preWater();
    }

if (this.field_239227_K_ != null)
{
irendertypebuffer$impl.finish(RenderType.getLines());
        irendertypebuffer$impl.finish();
        this.field_239222_F_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239222_F_.func_237506_a_(this.mc.getFramebuffer());
        iprofiler.endStartSection("translucent");
        this.renderBlockLayer(RenderType.getTranslucent(), matrixStackIn, d0, d1, d2);
        iprofiler.endStartSection("string");
        this.renderBlockLayer(RenderType.getTripwire(), matrixStackIn, d0, d1, d2);
        this.field_239224_H_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
        this.field_239224_H_.func_237506_a_(this.mc.getFramebuffer());
        RenderState.field_239237_T_.setupRenderState();
        iprofiler.endStartSection("particles");
        this.mc.particles.renderParticles(matrixStackIn, irendertypebuffer$impl, lightmapIn, activeRenderInfoIn, partialTicks, clippinghelper);
        RenderState.field_239237_T_.clearRenderState();
    }
else
    {
iprofiler.endStartSection("translucent");

        if (flag1)
{
Shaders.beginWater();
        }

this.renderBlockLayer(RenderType.getTranslucent(), matrixStackIn, d0, d1, d2);

        if (flag1)
{
Shaders.endWater();
        }

irendertypebuffer$impl.finish(RenderType.getLines());
        irendertypebuffer$impl.finish();
        iprofiler.endStartSection("string");
        this.renderBlockLayer(RenderType.getTripwire(), matrixStackIn, d0, d1, d2);
        iprofiler.endStartSection("particles");

        if (flag1)
{
Shaders.beginParticles();
        }

this.mc.particles.renderParticles(matrixStackIn, irendertypebuffer$impl, lightmapIn, activeRenderInfoIn, partialTicks, clippinghelper);

        if (flag1)
{
Shaders.endParticles();
        }
}

GlStateManager.setFogAllowed(true);
    RenderSystem.pushMatrix();
    RenderSystem.multMatrix(matrixStackIn.getLast().getMatrix());
    EventManager.trigger(new EventRender3D(partialTicks, matrixStackIn));


    if (this.mc.gameSettings.getCloudOption() != CloudOption.OFF)
{
if (this.field_239227_K_ != null)
{
this.field_239226_J_.framebufferClear(Minecraft.IS_RUNNING_ON_MAC);
            RenderState.field_239239_V_.setupRenderState();
            iprofiler.endStartSection("clouds");
            this.renderClouds(matrixStackIn, partialTicks, d0, d1, d2);
            RenderState.field_239239_V_.clearRenderState();
        }
else
        {
iprofiler.endStartSection("clouds");
            this.renderClouds(matrixStackIn, partialTicks, d0, d1, d2);
        }
}
if (this.field_239227_K_ != null)
{
RenderState.field_239238_U_.setupRenderState();
        iprofiler.endStartSection("weather");
        this.renderRainSnow(lightmapIn, partialTicks, d0, d1, d2);
        this.renderWorldBorder(activeRenderInfoIn);
        RenderState.field_239238_U_.clearRenderState();
        this.field_239227_K_.render(partialTicks);
        this.mc.getFramebuffer().bindFramebuffer(false);
    }
else
    {
RenderSystem.depthMask(false);

        if (Config.isShaders())
{
GlStateManager.depthMask(Shaders.isRainDepth());
        }

iprofiler.endStartSection("weather");

        if (flag1)
{
Shaders.beginWeather();
        }

this.renderRainSnow(lightmapIn, partialTicks, d0, d1, d2);

        if (flag1)
{
Shaders.endWeather();
        }

this.renderWorldBorder(activeRenderInfoIn);
        RenderSystem.depthMask(true);
    }
this.renderDebug(activeRenderInfoIn);
    RenderSystem.shadeModel(7424);
    RenderSystem.depthMask(true);
    RenderSystem.disableBlend();
    RenderSystem.popMatrix();
    FogRenderer.resetFog();
}
добавь MatrixStack в аргументы drawBox, и просто добавь его при вызове BufferBuilder#pos
 
Начинающий
Статус
Оффлайн
Регистрация
20 Авг 2023
Сообщения
11
Реакции[?]
0
Поинты[?]
0
добавь MatrixStack в аргументы drawBox, и просто добавь его при вызове BufferBuilder#pos
в каком смысле добавить? добавил в аргументы и перед BufferBuilder#pos не чаю че сделать
 
Начинающий
Статус
Оффлайн
Регистрация
10 Авг 2023
Сообщения
17
Реакции[?]
0
Поинты[?]
0
drawBox(AxisAlignedBB bb) -> drawBox(MatrixStack stack, AxisAlignedBB bb)
vertexbuffer.pos(x, y, z) -> vertexbuffer.pos(если фордж - stack.peek().getModel() а если мсп то stack.getLast().getMatrix(), x, y, z)
 
Начинающий
Статус
Оффлайн
Регистрация
20 Авг 2023
Сообщения
11
Реакции[?]
0
Поинты[?]
0
drawBox(AxisAlignedBB bb) -> drawBox(MatrixStack stack, AxisAlignedBB bb)
vertexbuffer.pos(x, y, z) -> vertexbuffer.pos(если фордж - stack.peek().getModel() а если мсп то stack.getLast().getMatrix(), x, y, z)
не, все равно в небе

drawkek:
 public static void drawBox(AxisAlignedBB bb, MatrixStack matrixStack) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1, 1, 1, 1);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float) bb.minY, (float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX, (float) bb.minY, (float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX,(float) bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float)bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.minY,(float) bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX,(float) bb.maxY, (float)bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX, (float)bb.maxY, (float)bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float)bb.maxY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(1, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.minY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.minY, (float)bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX,(float) bb.maxY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.minY, (float)bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.maxY, (float)bb.maxZ).endVertex();
        tessellator.draw();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
 
Начинающий
Статус
Оффлайн
Регистрация
10 Авг 2023
Сообщения
17
Реакции[?]
0
Поинты[?]
0
не, все равно в небе

drawkek:
 public static void drawBox(AxisAlignedBB bb, MatrixStack matrixStack) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1, 1, 1, 1);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float) bb.minY, (float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX, (float) bb.minY, (float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX,(float) bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float)bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.minY,(float) bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX,(float) bb.maxY, (float)bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.maxX, (float)bb.maxY, (float)bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX, (float)bb.maxY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(), (float) bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        tessellator.draw();
        vertexbuffer.begin(1, DefaultVertexFormats.POSITION);
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.minY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX,(float) bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.minY, (float)bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.maxY,(float) bb.minZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX, (float)bb.minY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.maxX,(float) bb.maxY,(float) bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.minY, (float)bb.maxZ).endVertex();
        vertexbuffer.pos(matrixStack.getLast().getMatrix(),(float)bb.minX, (float)bb.maxY, (float)bb.maxZ).endVertex();
        tessellator.draw();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
    }
покажи где у тебя вызывается 3д евент
 
Начинающий
Статус
Оффлайн
Регистрация
22 Авг 2023
Сообщения
13
Реакции[?]
0
Поинты[?]
0
у тебя неправильно написано гетание x, y, z скопипасти откуда-то
 
Начинающий
Статус
Оффлайн
Регистрация
20 Авг 2023
Сообщения
11
Реакции[?]
0
Поинты[?]
0
у тебя неправильно написано гетание x, y, z скопипасти откуда-то
а че не так то

Код:
     for (Entity e : Minecraft.getInstance().world.getAllEntities()) {
            BoxUtil.drawBox(e.getBoundingBox(), eventRender3D.getMatrixStack());
        }
 
Последнее редактирование:
Сверху Снизу