World Render Environment
class WorldRenderEnvironment
Context representing the rendering environment.
Parameters
render Target
The render target framebuffer.
Functions
Link copied to clipboard
fun WorldRenderEnvironment.drawBoxSide(box: AABB, side: Direction, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
fun WorldRenderEnvironment.drawBoxSides(box: AABB, sides: Iterable<Direction>, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
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 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
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 WorldRenderEnvironment.drawLegacy2DMarker(pos: Vec3, entityHeight: Double, scale: Float, foregroundArgb: Int, backgroundArgb: Int)
Link copied to clipboard
Function to draw lines using the specified positions vectors.
Link copied to clipboard
Function to draw a line strip using the specified positions vectors.
Link copied to clipboard
Draws lines with width. Modern GL doesn't support glLineWidth well, so draw with shader simulation.
Link copied to clipboard
fun WorldRenderEnvironment.drawShape(shape: VoxelShape, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
fun WorldRenderEnvironment.drawShapeSide(shape: VoxelShape, side: Direction, hitPos: Vec3, faceColor: Color4b? = Color4b.TRANSPARENT, outlineColor: Color4b? = Color4b.TRANSPARENT)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Converts a world-space position to the camera-relative coordinate system.
Link copied to clipboard
inline fun WorldRenderEnvironment.withPositionRelativeToCamera(draw: WorldRenderEnvironment.() -> Unit)
inline fun WorldRenderEnvironment.withPositionRelativeToCamera(x: Double, y: Double, z: Double, draw: WorldRenderEnvironment.() -> Unit)
inline fun WorldRenderEnvironment.withPositionRelativeToCamera(pos: Vec3i, draw: WorldRenderEnvironment.() -> Unit)
Shortcut of withPositionRelativeToCamera(Vec3.atLowerCornerOf(pos))
inline fun WorldRenderEnvironment.withPositionRelativeToCamera(pos: Vec3, draw: WorldRenderEnvironment.() -> Unit)
Shorthand for withPosition(relativeToCamera(pos))