当前位置: 首页>>代码示例>>Java>>正文


Java BakedQuad.shouldApplyDiffuseLighting方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.block.model.BakedQuad.shouldApplyDiffuseLighting方法的典型用法代码示例。如果您正苦于以下问题:Java BakedQuad.shouldApplyDiffuseLighting方法的具体用法?Java BakedQuad.shouldApplyDiffuseLighting怎么用?Java BakedQuad.shouldApplyDiffuseLighting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.block.model.BakedQuad的用法示例。


在下文中一共展示了BakedQuad.shouldApplyDiffuseLighting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderQuadsSmooth

import net.minecraft.client.renderer.block.model.BakedQuad; //导入方法依赖的package包/类
private void renderQuadsSmooth(IBlockAccess p_renderQuadsSmooth_1_, IBlockState p_renderQuadsSmooth_2_, BlockPos p_renderQuadsSmooth_3_, VertexBuffer p_renderQuadsSmooth_4_, List<BakedQuad> p_renderQuadsSmooth_5_, RenderEnv p_renderQuadsSmooth_6_)
{
    float[] afloat = p_renderQuadsSmooth_6_.getQuadBounds();
    BitSet bitset = p_renderQuadsSmooth_6_.getBoundsFlags();
    BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = p_renderQuadsSmooth_6_.getAoFace();
    Vec3d vec3d = p_renderQuadsSmooth_2_.func_191059_e(p_renderQuadsSmooth_1_, p_renderQuadsSmooth_3_);
    double d0 = (double)p_renderQuadsSmooth_3_.getX() + vec3d.xCoord;
    double d1 = (double)p_renderQuadsSmooth_3_.getY() + vec3d.yCoord;
    double d2 = (double)p_renderQuadsSmooth_3_.getZ() + vec3d.zCoord;
    int i = 0;

    for (int j = p_renderQuadsSmooth_5_.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)p_renderQuadsSmooth_5_.get(i);
        this.fillQuadBounds(p_renderQuadsSmooth_2_, bakedquad.getVertexData(), bakedquad.getFace(), afloat, bitset);
        blockmodelrenderer$ambientocclusionface.updateVertexBrightness(p_renderQuadsSmooth_1_, p_renderQuadsSmooth_2_, p_renderQuadsSmooth_3_, bakedquad.getFace(), afloat, bitset);

        if (p_renderQuadsSmooth_4_.isMultiTexture())
        {
            p_renderQuadsSmooth_4_.addVertexData(bakedquad.getVertexDataSingle());
            p_renderQuadsSmooth_4_.putSprite(bakedquad.getSprite());
        }
        else
        {
            p_renderQuadsSmooth_4_.addVertexData(bakedquad.getVertexData());
        }

        p_renderQuadsSmooth_4_.putBrightness4(blockmodelrenderer$ambientocclusionface.vertexBrightness[0], blockmodelrenderer$ambientocclusionface.vertexBrightness[1], blockmodelrenderer$ambientocclusionface.vertexBrightness[2], blockmodelrenderer$ambientocclusionface.vertexBrightness[3]);

        if (bakedquad.shouldApplyDiffuseLighting())
        {
            float f = FaceBakery.getFaceBrightness(bakedquad.getFace());
            float[] afloat1 = blockmodelrenderer$ambientocclusionface.vertexColorMultiplier;
            afloat1[0] *= f;
            afloat1 = blockmodelrenderer$ambientocclusionface.vertexColorMultiplier;
            afloat1[1] *= f;
            afloat1 = blockmodelrenderer$ambientocclusionface.vertexColorMultiplier;
            afloat1[2] *= f;
            afloat1 = blockmodelrenderer$ambientocclusionface.vertexColorMultiplier;
            afloat1[3] *= f;
        }

        int l = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsSmooth_2_, p_renderQuadsSmooth_1_, p_renderQuadsSmooth_3_, p_renderQuadsSmooth_6_);

        if (!bakedquad.hasTintIndex() && l == -1)
        {
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], 4);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], 3);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], 2);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], 1);
        }
        else
        {
            int k = l;

            if (l == -1)
            {
                k = this.blockColors.colorMultiplier(p_renderQuadsSmooth_2_, p_renderQuadsSmooth_1_, p_renderQuadsSmooth_3_, bakedquad.getTintIndex());
            }

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            float f1 = (float)(k >> 16 & 255) / 255.0F;
            float f2 = (float)(k >> 8 & 255) / 255.0F;
            float f3 = (float)(k & 255) / 255.0F;
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f3, 4);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f3, 3);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f3, 2);
            p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f3, 1);
        }

        p_renderQuadsSmooth_4_.putPosition(d0, d1, d2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:78,代码来源:BlockModelRenderer.java

示例2: renderQuadsFlat

import net.minecraft.client.renderer.block.model.BakedQuad; //导入方法依赖的package包/类
private void renderQuadsFlat(IBlockAccess p_renderQuadsFlat_1_, IBlockState p_renderQuadsFlat_2_, BlockPos p_renderQuadsFlat_3_, int p_renderQuadsFlat_4_, boolean p_renderQuadsFlat_5_, VertexBuffer p_renderQuadsFlat_6_, List<BakedQuad> p_renderQuadsFlat_7_, RenderEnv p_renderQuadsFlat_8_)
{
    BitSet bitset = p_renderQuadsFlat_8_.getBoundsFlags();
    Vec3d vec3d = p_renderQuadsFlat_2_.func_191059_e(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_);
    double d0 = (double)p_renderQuadsFlat_3_.getX() + vec3d.xCoord;
    double d1 = (double)p_renderQuadsFlat_3_.getY() + vec3d.yCoord;
    double d2 = (double)p_renderQuadsFlat_3_.getZ() + vec3d.zCoord;
    int i = 0;

    for (int j = p_renderQuadsFlat_7_.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)p_renderQuadsFlat_7_.get(i);

        if (p_renderQuadsFlat_5_)
        {
            this.fillQuadBounds(p_renderQuadsFlat_2_, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, bitset);
            BlockPos blockpos = bitset.get(0) ? p_renderQuadsFlat_3_.offset(bakedquad.getFace()) : p_renderQuadsFlat_3_;
            p_renderQuadsFlat_4_ = p_renderQuadsFlat_2_.getPackedLightmapCoords(p_renderQuadsFlat_1_, blockpos);
        }

        if (p_renderQuadsFlat_6_.isMultiTexture())
        {
            p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexDataSingle());
            p_renderQuadsFlat_6_.putSprite(bakedquad.getSprite());
        }
        else
        {
            p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexData());
        }

        p_renderQuadsFlat_6_.putBrightness4(p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_);
        int l = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, p_renderQuadsFlat_8_);

        if (!bakedquad.hasTintIndex() && l == -1)
        {
            if (bakedquad.shouldApplyDiffuseLighting())
            {
                float f4 = FaceBakery.getFaceBrightness(bakedquad.getFace());
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 4);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 3);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 2);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 1);
            }
        }
        else
        {
            int k = l;

            if (l == -1)
            {
                k = this.blockColors.colorMultiplier(p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, bakedquad.getTintIndex());
            }

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            float f = (float)(k >> 16 & 255) / 255.0F;
            float f1 = (float)(k >> 8 & 255) / 255.0F;
            float f2 = (float)(k & 255) / 255.0F;

            if (bakedquad.shouldApplyDiffuseLighting())
            {
                float f3 = FaceBakery.getFaceBrightness(bakedquad.getFace());
                f *= f3;
                f1 *= f3;
                f2 *= f3;
            }

            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 4);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 3);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 2);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 1);
        }

        p_renderQuadsFlat_6_.putPosition(d0, d1, d2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:80,代码来源:BlockModelRenderer.java

示例3: renderQuadsSmooth

import net.minecraft.client.renderer.block.model.BakedQuad; //导入方法依赖的package包/类
private void renderQuadsSmooth(IBlockAccess blockAccessIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, List<BakedQuad> list, float[] quadBounds, BitSet bitSet, BlockModelRenderer.AmbientOcclusionFace aoFace)
{
    double d0 = (double)posIn.getX();
    double d1 = (double)posIn.getY();
    double d2 = (double)posIn.getZ();
    Block block = stateIn.getBlock();
    Block.EnumOffsetType block$enumoffsettype = block.getOffsetType();

    if (block$enumoffsettype != Block.EnumOffsetType.NONE)
    {
        long i = MathHelper.getPositionRandom(posIn);
        d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
        d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;

        if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
        {
            d1 += ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
        }
    }

    int l = 0;

    for (int j = list.size(); l < j; ++l)
    {
        BakedQuad bakedquad = (BakedQuad)list.get(l);
        this.fillQuadBounds(stateIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, bitSet);
        aoFace.updateVertexBrightness(blockAccessIn, stateIn, posIn, bakedquad.getFace(), quadBounds, bitSet);
        buffer.addVertexData(bakedquad.getVertexData());
        buffer.putBrightness4(aoFace.vertexBrightness[0], aoFace.vertexBrightness[1], aoFace.vertexBrightness[2], aoFace.vertexBrightness[3]);
        if(bakedquad.shouldApplyDiffuseLighting())
        {
            float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.getFace());
            aoFace.vertexColorMultiplier[0] *= diffuse;
            aoFace.vertexColorMultiplier[1] *= diffuse;
            aoFace.vertexColorMultiplier[2] *= diffuse;
            aoFace.vertexColorMultiplier[3] *= diffuse;
        }
        if (bakedquad.hasTintIndex())
        {
            int k = this.blockColors.colorMultiplier(stateIn, blockAccessIn, posIn, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            float f = (float)(k >> 16 & 255) / 255.0F;
            float f1 = (float)(k >> 8 & 255) / 255.0F;
            float f2 = (float)(k & 255) / 255.0F;
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0] * f, aoFace.vertexColorMultiplier[0] * f1, aoFace.vertexColorMultiplier[0] * f2, 4);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1] * f, aoFace.vertexColorMultiplier[1] * f1, aoFace.vertexColorMultiplier[1] * f2, 3);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2] * f, aoFace.vertexColorMultiplier[2] * f1, aoFace.vertexColorMultiplier[2] * f2, 2);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3] * f, aoFace.vertexColorMultiplier[3] * f1, aoFace.vertexColorMultiplier[3] * f2, 1);
        }
        else
        {
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], aoFace.vertexColorMultiplier[0], 4);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], aoFace.vertexColorMultiplier[1], 3);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], aoFace.vertexColorMultiplier[2], 2);
            buffer.putColorMultiplier(aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], aoFace.vertexColorMultiplier[3], 1);
        }

        buffer.putPosition(d0, d1, d2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:66,代码来源:BlockModelRenderer.java


注:本文中的net.minecraft.client.renderer.block.model.BakedQuad.shouldApplyDiffuseLighting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。