From 9d41380c16abe0f96080d2a3e8ec2c8e174925e5 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 21 Feb 2023 07:44:48 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BD=D1=83=20=D0=B8=20=D1=8D=D1=82=D0=BE?= =?UTF-8?q?=D1=82=20=D0=BC=D1=83=D1=81=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shader/GLTransformableColorableProgram.kt | 4 ---- .../gl/shader/GLTransformableProgram.kt | 4 ---- .../kstarbound/client/gl/shader/Programs.kt | 24 +++++++++---------- 3 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableColorableProgram.kt delete mode 100644 src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableProgram.kt diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableColorableProgram.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableColorableProgram.kt deleted file mode 100644 index cfa26bf3..00000000 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableColorableProgram.kt +++ /dev/null @@ -1,4 +0,0 @@ -package ru.dbotthepony.kstarbound.client.gl.shader - -import ru.dbotthepony.kstarbound.client.gl.GLStateTracker -import ru.dbotthepony.kvector.vector.Color diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableProgram.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableProgram.kt deleted file mode 100644 index bd996a92..00000000 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLTransformableProgram.kt +++ /dev/null @@ -1,4 +0,0 @@ -package ru.dbotthepony.kstarbound.client.gl.shader - -import ru.dbotthepony.kstarbound.client.gl.GLStateTracker -import ru.dbotthepony.kvector.matrix.nfloat.Matrix4f diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/Programs.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/Programs.kt index a454b081..e0afd9db 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/Programs.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/Programs.kt @@ -11,6 +11,18 @@ import ru.dbotthepony.kstarbound.client.render.GPULightRenderer import ru.dbotthepony.kvector.matrix.nfloat.Matrix4f import ru.dbotthepony.kvector.vector.Color +private fun GLStateTracker.shaders(name: String): List { + return listOf(internalVertex("shaders/$name.vsh"), internalFragment("shaders/$name.fsh")) +} + +private fun GLStateTracker.gshaders(name: String): List { + return listOf( + internalVertex(name), + internalFragment(name), + internalGeometry(name) + ) +} + open class GLTransformableProgram(state: GLStateTracker, shaders: Iterable) : GLShaderProgram(state, shaders) { val transform = F4x4Uniform("_transform") @@ -27,18 +39,6 @@ open class GLTransformableColorableProgram(state: GLStateTracker, shaders: Itera } } -private fun GLStateTracker.shaders(name: String): List { - return listOf(internalVertex("shaders/$name.vsh"), internalFragment("shaders/$name.fsh")) -} - -private fun GLStateTracker.gshaders(name: String): List { - return listOf( - internalVertex(name), - internalFragment(name), - internalGeometry(name) - ) -} - class GLLiquidProgram(state: GLStateTracker) : GLShaderProgram(state, state.shaders("liquid")) { val baselineColor = F4Uniform("baselineColor") val transform = F4x4Uniform("transform")