Ref: Removed shader language, correct floating origin in shaders and other fixes by emyfops · Pull Request #184 · lambda-client/lambda · GitHub
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
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
}
}
119 changes: 0 additions & 119 deletions src/main/kotlin/com/lambda/graphics/shader/ParsedShader.kt

This file was deleted.

Loading