Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions src/main/kotlin/com/lambda/graphics/animation/Animation.kt

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/kotlin/com/lambda/graphics/animation/AnimationTicker.kt

This file was deleted.

30 changes: 12 additions & 18 deletions src/main/kotlin/com/lambda/graphics/renderer/esp/ShapeDsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ package com.lambda.graphics.renderer.esp

import com.lambda.graphics.pipeline.VertexBuilder
import com.lambda.graphics.renderer.esp.DirectionMask.hasDirection
import com.lambda.graphics.renderer.esp.Treed.Companion.cameraPos
import com.lambda.threading.runSafe
import com.lambda.util.BlockUtils.blockState
import com.lambda.util.extension.max
import com.lambda.util.extension.min
import com.lambda.util.extension.outlineShape
import com.lambda.util.math.minus
import net.minecraft.block.BlockState
import net.minecraft.block.entity.BlockEntity
import net.minecraft.entity.Entity
Expand All @@ -48,12 +46,11 @@ class ShapeBuilder(
sides : Int = DirectionMask.ALL,
) = faces.apply {
val boxes = box.pair ?: return@apply
val camera = cameraPos

val pos11 = boxes.first.min - camera
val pos12 = boxes.first.max - camera
val pos21 = boxes.second.min - camera
val pos22 = boxes.second.max - camera
val pos11 = boxes.first.min
val pos12 = boxes.first.max
val pos21 = boxes.second.min
val pos22 = boxes.second.max

val blb by lazy { vertex { vec3(pos11.x, pos11.y, pos11.z).vec3(pos21.x, pos21.y, pos21.z).color(color) } }
val blf by lazy { vertex { vec3(pos11.x, pos11.y, pos12.z).vec3(pos21.x, pos21.y, pos22.z).color(color) } }
Expand All @@ -79,9 +76,8 @@ class ShapeBuilder(
topColor : Color = bottomColor,
sides : Int = DirectionMask.ALL
) = faces.apply {
val camera = cameraPos
val pos1 = box.min - camera
val pos2 = box.max - camera
val pos1 = box.min
val pos2 = box.max

val blb by lazy { vertex { vec3(pos1.x, pos1.y, pos1.z).color(bottomColor) } }
val blf by lazy { vertex { vec3(pos1.x, pos1.y, pos2.z).color(bottomColor) } }
Expand Down Expand Up @@ -156,12 +152,11 @@ class ShapeBuilder(
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
) = edges.apply {
val boxes = box.pair ?: return@apply
val camera = cameraPos

val pos11 = boxes.first.min - camera
val pos12 = boxes.first.max - camera
val pos21 = boxes.second.min - camera
val pos22 = boxes.second.max - camera
val pos11 = boxes.first.min
val pos12 = boxes.first.max
val pos21 = boxes.second.min
val pos22 = boxes.second.max

val blb by lazy { vertex { vec3(pos11.x, pos11.y, pos11.z).vec3(pos21.x, pos21.y, pos21.z).color(color) } }
val blf by lazy { vertex { vec3(pos11.x, pos11.y, pos12.z).vec3(pos21.x, pos21.y, pos22.z).color(color) } }
Expand Down Expand Up @@ -203,9 +198,8 @@ class ShapeBuilder(
sides : Int = DirectionMask.ALL,
mode : DirectionMask.OutlineMode = DirectionMask.OutlineMode.Or,
) = edges.apply {
val camera = cameraPos
val pos1 = box.min - camera
val pos2 = box.max - camera
val pos1 = box.min
val pos2 = box.max

val blb by lazy { vertex { vec3(pos1.x, pos1.y, pos1.z).color(bottomColor) } }
val blf by lazy { vertex { vec3(pos1.x, pos1.y, pos2.z).color(bottomColor) } }
Expand Down
22 changes: 7 additions & 15 deletions src/main/kotlin/com/lambda/graphics/renderer/esp/Treed.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ import com.lambda.graphics.buffer.vertex.attributes.VertexMode
import com.lambda.graphics.gl.GlStateUtils
import com.lambda.graphics.pipeline.VertexBuilder
import com.lambda.graphics.pipeline.VertexPipeline
import com.lambda.graphics.shader.Shader.Companion.shader
import com.lambda.graphics.shader.Shader
import com.lambda.module.modules.client.StyleEditor
import com.lambda.util.extension.partialTicks
import com.lambda.util.math.minus
import net.minecraft.util.math.Vec3d

/**
* Open class for 3d rendering. It contains two pipelines, one for edges and the other for faces.
*/
open class Treed(static: Boolean) {
open class Treed(private val static: Boolean) {
val shader = if (static) staticMode.first else dynamicMode.first

val faces = VertexPipeline(VertexMode.Triangles, if (static) staticMode.second else dynamicMode.second)
Expand All @@ -48,8 +46,9 @@ open class Treed(static: Boolean) {

fun render() {
shader.use()
shader["u_TickDelta"] = mc.partialTicks
shader["u_CameraLerp"] = cachedCameraPos - mc.gameRenderer.camera.pos

if (!static)
shader["u_TickDelta"] = mc.partialTicks

GlStateUtils.withFaceCulling(faces::render)
GlStateUtils.withLineWidth(StyleEditor.outlineWidth, edges::render)
Expand All @@ -76,14 +75,7 @@ open class Treed(static: Boolean) {
object Dynamic : Treed(false)

companion object {
private val staticMode = shader("renderer/box_static") to VertexAttrib.Group.STATIC_RENDERER
private val dynamicMode = shader("renderer/box_dynamic") to VertexAttrib.Group.DYNAMIC_RENDERER

var cachedCameraPos: Vec3d = Vec3d.ZERO
val cameraPos: Vec3d
get() {
cachedCameraPos = mc.gameRenderer.camera.pos
return cachedCameraPos
}
private val staticMode = Shader("shaders/vertex/box_static.glsl", "shaders/fragment/pos_color.glsl") to VertexAttrib.Group.STATIC_RENDERER
private val dynamicMode = Shader("shaders/vertex/box_dynamic.glsl", "shaders/fragment/pos_color.glsl") to VertexAttrib.Group.DYNAMIC_RENDERER
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.lambda.graphics.pipeline.VertexBuilder
import com.lambda.graphics.renderer.gui.font.core.GlyphInfo
import com.lambda.graphics.renderer.gui.font.core.LambdaAtlas.get
import com.lambda.graphics.renderer.gui.font.core.LambdaAtlas.height
import com.lambda.graphics.shader.Shader.Companion.shader
import com.lambda.graphics.texture.TextureOwner.bind
import com.lambda.gui.components.ClickGuiLayout
import com.lambda.module.modules.client.LambdaMoji
Expand All @@ -39,7 +38,7 @@ import java.awt.Color
* Renders text and emoji glyphs using a shader-based font rendering system.
* This class handles text and emoji rendering, shadow effects, and text scaling.
*/
object FontRenderer : AbstractGUIRenderer(VertexAttrib.Group.FONT, shader("renderer/font")) {
/*object FontRenderer : AbstractGUIRenderer(VertexAttrib.Group.FONT, shader("renderer/font")) {
private val chars get() = StyleEditor.textFont
private val emojis get() = StyleEditor.emojiFont
Expand Down Expand Up @@ -278,4 +277,4 @@ object FontRenderer : AbstractGUIRenderer(VertexAttrib.Group.FONT, shader("rende
(color.blue * StyleEditor.shadowBrightness).toInt(),
color.alpha
)
}
}*/
119 changes: 0 additions & 119 deletions src/main/kotlin/com/lambda/graphics/shader/ParsedShader.kt

This file was deleted.

Loading