本文整理匯總了Java中net.minecraft.client.renderer.BufferBuilder.color方法的典型用法代碼示例。如果您正苦於以下問題:Java BufferBuilder.color方法的具體用法?Java BufferBuilder.color怎麽用?Java BufferBuilder.color使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.BufferBuilder
的用法示例。
在下文中一共展示了BufferBuilder.color方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderGhostModel
import net.minecraft.client.renderer.BufferBuilder; //導入方法依賴的package包/類
public static void renderGhostModel(IBakedModel model, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
BufferBuilder vb;
if(noDepth)
{
GlStateManager.depthFunc(519);
vb = prepRenderBlockDepth(partialTicks, true);
}
else
vb = prepRender(partialTicks, true);
vb.begin(7, DefaultVertexFormats.BLOCK);
World world = Minecraft.getMinecraft().world;
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
dispatcher.getBlockModelRenderer().renderModel(world, model, Minecraft.getMinecraft().world.getBlockState(position), position.add(0, noDepth ? 500 : 0, 0), vb, false);
for(int i = 0; i < vb.getVertexCount(); i++)
vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
vb.color(1, 1, 1, 0.1f);
postRender();
GlStateManager.depthFunc(515);
GlStateManager.disableBlend();
}
示例2: renderGhostBlock
import net.minecraft.client.renderer.BufferBuilder; //導入方法依賴的package包/類
public static void renderGhostBlock(IBlockState state, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
if(!(state.getBlock() instanceof BlockLiquid) && !(state.getBlock() instanceof BlockFluidBase))
{
renderGhostModel(Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state), position, color, noDepth, partialTicks);
return;
}
GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
BufferBuilder vb;
if(noDepth)
{
GlStateManager.depthFunc(519);
vb = prepRenderBlockDepth(partialTicks, true);
}
else
vb = prepRender(partialTicks, true);
vb.begin(7, DefaultVertexFormats.BLOCK);
World world = Minecraft.getMinecraft().world;
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlock(state, position.add(0, noDepth ? 500 : 0, 0), world, vb);
for(int i = 0; i < vb.getVertexCount(); i++)
vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
vb.color(1, 1, 1, 0.1f);
postRender();
GlStateManager.disableBlend();
GlStateManager.depthFunc(515);
}