Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed class ClientShaders : ShaderSource
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Submission strategy for geometry started in WorldRenderEnvironment.

Link copied to clipboard
class FontFace(val name: String, val size: Float, val file: File? = null)
Link copied to clipboard
Link copied to clipboard
abstract class GenericColorMode<in T>(name: String) : Mode
Link copied to clipboard
class GenericDistanceHSBColorMode<T : Any>(val parent: ModeValueGroup<*>, fixedAlpha: Float?, distanceGetter: ToFloatFunction<T>) : GenericColorMode<T>
Link copied to clipboard
class GenericEntityHealthColorMode(val parent: ModeValueGroup<*>) : GenericColorMode<LivingEntity>
Link copied to clipboard
class GenericRainbowColorMode(val parent: ModeValueGroup<*>, alpha: Int = 50) : GenericColorMode<Any?>
Link copied to clipboard
class GenericStaticColorMode(val parent: ModeValueGroup<*>, defaultColor: Color4b) : GenericColorMode<Any?>
Link copied to clipboard
class GrowableMappableRingBuffer @JvmOverloads constructor(val label: String, val usage: Int, val growPolicy: GrowableMappableRingBuffer.GrowPolicy = GrowPolicy.DEFAULT)

A growable GpuBuffer wrapper for streaming GPU data (e.g. dynamic VBO/IBO uploads).

Link copied to clipboard
class MapColorMode(val parent: ModeValueGroup<*>, alpha: Int = 100) : GenericColorMode<Pair<BlockPos, BlockState>>
Link copied to clipboard
data class RenderBufferKey(val pipeline: RenderPipeline, val textures: Map<String, AbstractTexture> = emptyMap(), val uniforms: Map<String, GpuBufferSlice> = emptyMap()) : Record

Buffer grouping key used by BatchCollector.

Link copied to clipboard
Storage for a reusable (static) mesh draw call.
Link copied to clipboard

Context representing the rendering environment.

Properties

Link copied to clipboard
Link copied to clipboard
val FULL_BOX: AABB
Link copied to clipboard

This variable should be used when rendering long lines, meaning longer than ~2 in 3d. WorldRenderEnvironment.longLines is available for this.

Functions

Link copied to clipboard
fun VertexConsumer.addBoxFaces(pose: Matrix4fc, box: AABB, color: Color4b? = null, verticesToUse: Int = -1)
Link copied to clipboard
fun VertexConsumer.addBoxOutlines(pose: Matrix4fc, box: AABB, color: Color4b? = null, verticesToUse: Int = -1)
Link copied to clipboard
inline fun VertexConsumer.addVertex(pose: PoseStack.Pose, pos: Vec3f): VertexConsumer
inline fun VertexConsumer.addVertex(pose: PoseStack.Pose, pos: Vec3): VertexConsumer
inline fun VertexConsumer.addVertex(pose: PoseStack.Pose, pos: Vector3fc): VertexConsumer
inline fun VertexConsumer.addVertex(pose: Matrix4fc, pos: Vec3f): VertexConsumer
inline fun VertexConsumer.addVertex(pose: Matrix4fc, pos: Vec3): VertexConsumer
inline fun VertexConsumer.addVertex(pose: Matrix4fc, pos: Vector3fc): VertexConsumer
inline fun VertexConsumer.addVertex(pose: PoseStack.Pose, x: Double, y: Double, z: Double): VertexConsumer
inline fun VertexConsumer.addVertex(pose: Matrix4fc, x: Double, y: Double, z: Double): VertexConsumer
Link copied to clipboard
fun RenderPass.bindAndDraw(vertexSlice: GpuBufferSlice, indexSlice: GpuBufferSlice, vertexFormat: VertexFormat, indexType: VertexFormat.IndexType, indexCount: Int)

Set vertex and index buffers for RenderPass and call RenderPass.drawIndexed.

Link copied to clipboard
inline fun RenderPass.bindDefaultUniforms()
Link copied to clipboard
inline fun RenderPass.bindDynamicTransformsUniform(gpuBufferSlice: GpuBufferSlice)
Link copied to clipboard
inline fun RenderPass.bindFogUniform()
Link copied to clipboard
inline fun RenderPass.bindGlobalsUniform()
Link copied to clipboard
inline fun RenderPass.bindLightingUniform()
Link copied to clipboard
inline fun RenderPass.bindProjectionUniform()
Link copied to clipboard
inline fun RenderPass.bindTexture(name: String, texture: AbstractTexture?)
Link copied to clipboard
inline fun RenderPass.bindTextures(textures: Map<String, AbstractTexture?>)
Link copied to clipboard
inline fun StaticMeshStorage.buildMesh(pipeline: RenderPipeline, rotate: Boolean = true, block: VertexConsumer.(pose: PoseStack) -> Unit)

Build new mesh data and upload it. This method is designed for lazy building so rotate defaults to true.

Link copied to clipboard
inline fun GuiGraphics.copyPose(): Matrix3x2f
Link copied to clipboard
inline fun GuiGraphics.copyPosePooled(): Matrix3x2f
Link copied to clipboard
fun GpuTextureView.createRenderPass(labelGetter: Supplier<String> = RENDER_PASS_DEFAULT_LABEL, clearColor: OptionalInt = OptionalInt.empty(), allowOverride: Boolean = false): RenderPass

Color-only RenderPass.

fun RenderTarget.createRenderPass(labelGetter: Supplier<String> = RENDER_PASS_DEFAULT_LABEL, clearColor: OptionalInt = OptionalInt.empty(), clearDepth: OptionalDouble = OptionalDouble.empty(), useDepthAttachment: Boolean = true, allowOverride: Boolean = false): RenderPass
Link copied to clipboard
inline fun GuiGraphics.drawBlitOnCurrentLayer(textureSetup: TextureSetup, x0: Int, y0: Int, x1: Int, y1: Int, u1: Float = 0.0f, v1: Float = 0.0f, u2: Float = 1.0f, v2: Float = 1.0f, argb: Int = -1, pipeline: RenderPipeline = RenderPipelines.GUI_TEXTURED)
Link copied to clipboard
fun WorldRenderEnvironment.drawBox(box: AABB, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT, faceVertices: Int = -1, outlineVertices: Int = -1)

Function to draw a colored box.

Link copied to clipboard
fun WorldRenderEnvironment.drawBoxSide(box: AABB, side: Direction, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)

Function to draw a colored box with specified side.

Link copied to clipboard
fun WorldRenderEnvironment.drawBoxSides(box: AABB, sides: Iterable<Direction>, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)

Function to draw a colored box with specified sides.

Link copied to clipboard
fun GuiGraphics.drawCircle(x: Float, y: Float, radius: Float, innerRadius: Float = 0.0f, colorGetter: Float2IntFunction = Float2IntFunction { Color4b.WHITE.argb })
Link copied to clipboard
fun WorldRenderEnvironment.drawCircleOutline(radius: Float, color: Color4b, noDepthTest: Boolean = true)

Function to draw the outline of a circle of the size radius

Link copied to clipboard
inline fun GuiGraphics.drawCustomElement(pipeline: RenderPipeline = RenderPipelines.GUI, textureSetup: TextureSetup = TextureSetup.noTexture(), scissorArea: ScreenRectangle? = this.scissorStack.peek(), bounds: ScreenRectangle? = null, verticesSetupHandler: VerticesSetupHandler)
Link copied to clipboard
inline fun WorldRenderEnvironment.drawCustomMesh(pipeline: RenderPipeline, textures: Map<String, AbstractTexture> = emptyMap(), uniforms: Map<String, GpuBufferSlice> = emptyMap(), drawer: VertexConsumer.(PoseStack.Pose) -> Unit)

Preferred mesh draw helper for world rendering code.

Link copied to clipboard
inline fun WorldRenderEnvironment.drawCustomMeshTextured(sampler0: AbstractTexture, pipeline: RenderPipeline = ClientRenderPipelines.TexQuads, uniforms: Map<String, GpuBufferSlice> = emptyMap(), drawer: VertexConsumer.(PoseStack.Pose) -> Unit)

Variant of drawCustomMesh that binds sampler0 as Sampler0.

Link copied to clipboard
inline fun GuiGraphics.drawGlyphOnCurrentLayer(textureSetup: TextureSetup, x0: Float, y0: Float, x1: Float, y1: Float, u1: Float = 0.0f, v1: Float = 0.0f, u2: Float = 1.0f, v2: Float = 1.0f, argb: Int = -1, pipeline: RenderPipeline = RenderPipelines.GUI_TEXTURED)
Link copied to clipboard
fun WorldRenderEnvironment.drawGradientCircle(outerRadius: Float, innerRadius: Float, outerColor: Color4b, innerColor: Color4b, innerOffset: Vector3fc = Vector3f(), noDepthTest: Boolean = true)

Function to draw a circle of the size outerRadius with a cutout of size innerRadius

Link copied to clipboard
fun WorldRenderEnvironment.drawGradientSides(height: Double, baseColor: Color4b, topColor: Color4b, box: AABB)
Link copied to clipboard
fun GuiGraphics.drawHorizontalLine(x1: Float, x2: Float, y: Float, thickness: Float, color: Color4b)
Link copied to clipboard

Draws a line with endpoint p1 and p2 and color argb.

Link copied to clipboard
fun WorldRenderEnvironment.drawLines(argb: Int, vararg positions: Vec3f)

Function to draw lines using the specified positions vectors.

fun GuiGraphics.drawLines(points: FloatArray, argb: Int, bounds: ScreenRectangle, cull: Boolean = true)
Link copied to clipboard
fun WorldRenderEnvironment.drawLineStrip(argb: Int, vararg positions: Vec3f)

Function to draw a line strip using the specified positions vectors.

Link copied to clipboard

Function to draw a 'line strip' using the specified positions vectors, actual pipeline is ClientRenderPipelines.Lines.

Link copied to clipboard
fun WorldRenderEnvironment.drawLinesWithWidth(argb: Int, width: Float, vararg positions: Vec3f)

Draws lines with width. Modern GL doesn't support glLineWidth well, so draw with shader simulation.

Link copied to clipboard
fun WorldRenderEnvironment.drawPlane(sizeX: Float, sizeZ: Float, fillColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)

Function to draw a flat plane on the XZ axis with an optional outline.

Link copied to clipboard
fun GuiGraphics.drawQuad(x1: Float, y1: Float, x2: Float, y2: Float, fillColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
inline fun GuiGraphics.drawQuadXYWH(x: Float, y: Float, w: Float, h: Float, fillColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
fun WorldRenderEnvironment.drawSquareTexture(sampler0: AbstractTexture, size: Float, argb: Int)
Link copied to clipboard
fun WorldRenderEnvironment.drawTexQuad(sampler0: AbstractTexture, argb: Int)
inline fun GuiGraphics.drawTexQuad(textureSetup: TextureSetup, x0: Float, y0: Float, x1: Float, y1: Float, u1: Float = 0.0f, v1: Float = 0.0f, u2: Float = 1.0f, v2: Float = 1.0f, argb: Int = -1, pipeline: RenderPipeline = RenderPipelines.GUI_TEXTURED)
Link copied to clipboard
fun GuiGraphics.drawTriangle(p1: Vec2, p2: Vec2, p3: Vec2, fillColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
fun GuiGraphics.drawTriangle(x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, fillColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT, cull: Boolean = true)
Link copied to clipboard
fun GuiGraphics.drawVerticalLine(x: Float, y1: Float, y2: Float, thickness: Float, color: Color4b)
Link copied to clipboard
inline fun AABB.forEachFaceVertex(fn: (index: Int, x: Double, y: Double, z: Double) -> Unit)
Link copied to clipboard
inline fun AABB.forEachOutlineVertex(fn: (index: Int, x: Double, y: Double, z: Double) -> Unit)
Link copied to clipboard
fun GuiGraphics.getBounds(box: BoundingBox2f): ScreenRectangle
fun GuiGraphics.getBounds(left: Float, top: Float, right: Float, bottom: Float): ScreenRectangle
Link copied to clipboard
fun GuiGraphics.getBoundsXYWH(x: Float, y: Float, w: Float, h: Float): ScreenRectangle
Link copied to clipboard
fun getDynamicTransformsUniform(modelView: Matrix4fc? = null, colorModulator: Color4b = Color4b.WHITE): GpuBufferSlice
Link copied to clipboard

Disables GL11C.GL_LINE_SMOOTH if HAS_AMD_VEGA_APU.

Link copied to clipboard
inline fun renderEnvironmentForWorld(poseStack: PoseStack, renderTarget: RenderTarget = mc.mainRenderTarget, mode: DrawMode = DrawMode.BATCH, camera: Camera = mc.gameRenderer.mainCamera, draw: WorldRenderEnvironment.() -> Unit)

Helper function to render an environment with the specified poseStack and draw block.

Link copied to clipboard
inline fun VertexConsumer.setColor(color: Color4b): VertexConsumer
Link copied to clipboard
inline fun VertexConsumer.setNormal(pose: PoseStack.Pose, normalVector: Vec3f): VertexConsumer
Link copied to clipboard
inline fun RenderPass.setUniforms(uniforms: Map<String, GpuBufferSlice>)
Link copied to clipboard
inline fun RenderPass.setupRenderTypeScissor()
Link copied to clipboard
inline fun PoseStack.translate(vec3i: Vec3i)
Link copied to clipboard
inline fun RenderPass.unbindTexture(name: String)
Link copied to clipboard
inline fun <T> usePoseStack(block: PoseStack.() -> T): T
Link copied to clipboard

Shortcut of withPositionRelativeToCamera(Vec3d.of(pos))

Shorthand for withPosition(relativeToCamera(pos))

Link copied to clipboard
inline fun PoseStack.withPush(block: PoseStack.() -> Unit)
inline fun Matrix3x2fStack.withPush(block: Matrix3x2fStack.() -> Unit)
inline fun GuiGraphics.ScissorStack.withPush(rect: ScreenRectangle, block: GuiGraphics.ScissorStack.() -> Unit)