Package codechicken.lib.render
Class CCRenderState
java.lang.Object
codechicken.lib.render.CCRenderState
The core of the CodeChickenLib render system.
Where possible assign a local var of CCRenderState to avoid millions of calls to instance();
Uses a ThreadLocal system to assign each thread their own CCRenderState so we can use it in Multithreaded chunk batching.
Piping Vanilla BakedQuad instances through here possible via BakedVertexSource.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintAn override for the alpha colour component.intThe base color, multiplied by theColourAttributefrom the bound model if present otherwise used as-is.int@Nullable CachedFormatintfinal VertexAttribute<int[]> booleanint@Nullable com.mojang.blaze3d.vertex.VertexFormatbooleanDeprecated, for removal: This API element is subject to removal in a future version.intfinal VertexAttribute<LC[]> final VertexAttribute<int[]> A standardLightMatrixinstance to be shared on this pipeline.@Nullable IVertexSourcefinal Vector3final VertexAttribute<Vector3[]> int@Nullable com.mojang.blaze3d.vertex.VertexConsumerintfinal VertexAttribute<int[]> @Nullable net.minecraft.client.renderer.texture.TextureAtlasSpritefinal Vertex5int -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(com.mojang.blaze3d.vertex.BufferBuilder r) Bind thisCCRenderStateinstance to the givenBufferBuilder.voidbind(com.mojang.blaze3d.vertex.VertexConsumer consumer, com.mojang.blaze3d.vertex.VertexFormat format) voidbind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource source) Bind thisCCRenderStateto the givenRenderType.voidbind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource getter, Matrix4 mat) Bind thisCCRenderStateto the givenRenderType, applying the given MatrixStack.voidbind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource source, com.mojang.blaze3d.vertex.PoseStack mStack) Bind thisCCRenderStateto the givenRenderType, applying the given MatrixStack.voidbindModel(IVertexSource model) com.mojang.blaze3d.vertex.VertexConsumercom.mojang.blaze3d.vertex.VertexFormatstatic CCRenderStateinstance()voidpreRenderWorld(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos) voidrender()voidrender(IVertexOperation... ops) voidreset()Resets thisCCRenderStateinstance's pipeline and internal state.voidvoidsetBrightness(net.minecraft.world.entity.Entity entity, float frameDelta) voidsetBrightness(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos) voidvoidsetFluidColour(net.neoforged.neoforge.fluids.FluidStack fluidStack) voidsetFluidColour(net.neoforged.neoforge.fluids.FluidStack fluidStack, int alpha) voidsetModel(IVertexSource source) voidsetModel(IVertexSource source, int start, int end) voidsetPipeline(IVertexOperation... ops) voidsetPipeline(IVertexSource model, int start, int end, IVertexOperation... ops) voidsetVertexRange(int start, int end) void
-
Field Details
-
normalAttrib
-
colourAttrib
-
lightingAttrib
-
sideAttrib
-
lightCoordAttrib
-
model
-
firstVertexIndex
public int firstVertexIndex -
lastVertexIndex
public int lastVertexIndex -
vertexIndex
public int vertexIndex -
pipeline
-
r
@Nullable public @Nullable com.mojang.blaze3d.vertex.VertexConsumer r -
fmt
@Nullable public @Nullable com.mojang.blaze3d.vertex.VertexFormat fmt -
cFmt
-
baseColour
public int baseColourThe base color, multiplied by theColourAttributefrom the bound model if present otherwise used as-is. -
alphaOverride
public int alphaOverrideAn override for the alpha colour component. -
computeLighting
public boolean computeLighting -
lightMatrix
A standardLightMatrixinstance to be shared on this pipeline. -
hackyReallyDontComputeLighting
Deprecated, for removal: This API element is subject to removal in a future version. -
vert
-
normal
-
colour
public int colour -
brightness
public int brightness -
overlay
public int overlay -
side
public int side -
lc
-
sprite
@Nullable public @Nullable net.minecraft.client.renderer.texture.TextureAtlasSprite sprite
-
-
Method Details
-
instance
-
bind
public void bind(com.mojang.blaze3d.vertex.BufferBuilder r) Bind thisCCRenderStateinstance to the givenBufferBuilder.- Parameters:
r- TheBufferBuilder.
-
bind
public void bind(com.mojang.blaze3d.vertex.VertexConsumer consumer, com.mojang.blaze3d.vertex.VertexFormat format) - Parameters:
consumer- TheVertexConsumerto bind to.format- TheVertexFormatof theVertexConsumer.
-
bind
public void bind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource source) Bind thisCCRenderStateto the givenRenderType.- Parameters:
renderType- TheRenderTypeto bind to.source- TheMultiBufferSourceinstance.
-
bind
public void bind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource source, com.mojang.blaze3d.vertex.PoseStack mStack) Bind thisCCRenderStateto the givenRenderType, applying the given MatrixStack.- Parameters:
renderType- TheRenderTypeto bind to.source- TheMultiBufferSourceinstance.mStack- ThePoseStackto apply.
-
bind
public void bind(net.minecraft.client.renderer.RenderType renderType, net.minecraft.client.renderer.MultiBufferSource getter, Matrix4 mat) Bind thisCCRenderStateto the givenRenderType, applying the given MatrixStack.- Parameters:
renderType- TheRenderTypeto bind to.getter- TheMultiBufferSourceinstance.mat- TheMatrix4to apply.
-
reset
public void reset()Resets thisCCRenderStateinstance's pipeline and internal state. -
preRenderWorld
public void preRenderWorld(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos) -
setPipeline
-
setPipeline
-
bindModel
-
setModel
-
setModel
-
setVertexRange
public void setVertexRange(int start, int end) -
render
-
render
public void render() -
runPipeline
public void runPipeline() -
writeVert
public void writeVert() -
setBrightness
public void setBrightness(net.minecraft.world.level.BlockAndTintGetter world, net.minecraft.core.BlockPos pos) -
setBrightness
public void setBrightness(net.minecraft.world.entity.Entity entity, float frameDelta) -
setFluidColour
public void setFluidColour(net.neoforged.neoforge.fluids.FluidStack fluidStack) -
setFluidColour
public void setFluidColour(net.neoforged.neoforge.fluids.FluidStack fluidStack, int alpha) -
setColour
-
getColour
-
getConsumer
public com.mojang.blaze3d.vertex.VertexConsumer getConsumer() -
getVertexFormat
public com.mojang.blaze3d.vertex.VertexFormat getVertexFormat()
-