diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt index c35469c8..c5240402 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/StarboundClient.kt @@ -173,8 +173,8 @@ class StarboundClient : Closeable { GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GLFW.GLFW_FALSE) GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, GLFW.GLFW_TRUE) - GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 4) - GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 6) + GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 3) + GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 3) GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE) window = GLFW.glfwCreateWindow(800, 600, "KStarbound", MemoryUtil.NULL, MemoryUtil.NULL) @@ -843,7 +843,6 @@ class StarboundClient : Closeable { ensureSameThread() var diff = nextRender - System.nanoTime() - var yields = 0 // try to sleep until next frame as precise as possible while (diff > 0L) { @@ -851,7 +850,6 @@ class StarboundClient : Closeable { LockSupport.parkNanos(1_000_000L) } else { Thread.yield() - yields++ } diff = nextRender - System.nanoTime() diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/world/ClientWorld.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/world/ClientWorld.kt index ab533dcb..1d117ede 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/world/ClientWorld.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/world/ClientWorld.kt @@ -90,7 +90,7 @@ class ClientWorld( val tile = view.getTile(x, y) ?: continue val material = tile.material - if (material != null && !material.isMeta) { + if (!material.isMeta) { client.tileRenderers.getMaterialRenderer(material.materialName).tesselate(tile, view, meshes, Vector2i(x, y), background = isBackground) } diff --git a/src/main/resources/shaders/flat.fsh b/src/main/resources/shaders/flat.fsh index ab68d955..846ac241 100644 --- a/src/main/resources/shaders/flat.fsh +++ b/src/main/resources/shaders/flat.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 uniform vec4 color; out vec4 color_out; diff --git a/src/main/resources/shaders/flat.vsh b/src/main/resources/shaders/flat.vsh index 707bd488..731d50c4 100644 --- a/src/main/resources/shaders/flat.vsh +++ b/src/main/resources/shaders/flat.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 pos; uniform mat4 transform; diff --git a/src/main/resources/shaders/flat_color.fsh b/src/main/resources/shaders/flat_color.fsh index 8eda7992..90d524b7 100644 --- a/src/main/resources/shaders/flat_color.fsh +++ b/src/main/resources/shaders/flat_color.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 in vec4 finalVertexColor; diff --git a/src/main/resources/shaders/flat_color.vsh b/src/main/resources/shaders/flat_color.vsh index 6989e33f..3e106a27 100644 --- a/src/main/resources/shaders/flat_color.vsh +++ b/src/main/resources/shaders/flat_color.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 vertexPos; layout (location = 1) in vec4 vertexColor; diff --git a/src/main/resources/shaders/font.fsh b/src/main/resources/shaders/font.fsh index b97c6ba3..5b6500c5 100644 --- a/src/main/resources/shaders/font.fsh +++ b/src/main/resources/shaders/font.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 in vec2 uv_out; out vec4 color_out; diff --git a/src/main/resources/shaders/font.vsh b/src/main/resources/shaders/font.vsh index 336af8ec..ac1b45b8 100644 --- a/src/main/resources/shaders/font.vsh +++ b/src/main/resources/shaders/font.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 pos; layout (location = 1) in vec2 uv_in; diff --git a/src/main/resources/shaders/fragment/texture.glsl b/src/main/resources/shaders/fragment/texture.glsl index e7663dfb..bd8f867d 100644 --- a/src/main/resources/shaders/fragment/texture.glsl +++ b/src/main/resources/shaders/fragment/texture.glsl @@ -1,5 +1,5 @@ -#version 460 +#version 330 uniform sampler2D texture0; diff --git a/src/main/resources/shaders/fragment/texture_color.glsl b/src/main/resources/shaders/fragment/texture_color.glsl index 27680e40..90614da8 100644 --- a/src/main/resources/shaders/fragment/texture_color.glsl +++ b/src/main/resources/shaders/fragment/texture_color.glsl @@ -1,5 +1,5 @@ -#version 460 +#version 330 uniform sampler2D texture0; uniform vec4 color; diff --git a/src/main/resources/shaders/light.fsh b/src/main/resources/shaders/light.fsh index 07268458..484d23ce 100644 --- a/src/main/resources/shaders/light.fsh +++ b/src/main/resources/shaders/light.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 in vec2 oUVCoords; out vec4 resultColor; diff --git a/src/main/resources/shaders/light.vsh b/src/main/resources/shaders/light.vsh index a7d5c597..558f246f 100644 --- a/src/main/resources/shaders/light.vsh +++ b/src/main/resources/shaders/light.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 vertexPos; layout (location = 1) in vec2 uvCoords; diff --git a/src/main/resources/shaders/liquid.fsh b/src/main/resources/shaders/liquid.fsh index f8429d5d..4b6daa7d 100644 --- a/src/main/resources/shaders/liquid.fsh +++ b/src/main/resources/shaders/liquid.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 out vec4 resultColor; diff --git a/src/main/resources/shaders/liquid.vsh b/src/main/resources/shaders/liquid.vsh index ebeb16f6..c5d3e324 100644 --- a/src/main/resources/shaders/liquid.vsh +++ b/src/main/resources/shaders/liquid.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 vertexPos; diff --git a/src/main/resources/shaders/tile.fsh b/src/main/resources/shaders/tile.fsh index 85bf822f..1a9f03f4 100644 --- a/src/main/resources/shaders/tile.fsh +++ b/src/main/resources/shaders/tile.fsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 uniform sampler2D texture0; uniform vec4 color; diff --git a/src/main/resources/shaders/tile.vsh b/src/main/resources/shaders/tile.vsh index f89073e7..5a0a2815 100644 --- a/src/main/resources/shaders/tile.vsh +++ b/src/main/resources/shaders/tile.vsh @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec3 pos; layout (location = 1) in vec2 uv_in; diff --git a/src/main/resources/shaders/vertex/2dtexture.glsl b/src/main/resources/shaders/vertex/2dtexture.glsl index d5227edc..cc741c04 100644 --- a/src/main/resources/shaders/vertex/2dtexture.glsl +++ b/src/main/resources/shaders/vertex/2dtexture.glsl @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec2 pos; layout (location = 1) in vec2 uv_in; diff --git a/src/main/resources/shaders/vertex/texture.glsl b/src/main/resources/shaders/vertex/texture.glsl index e916d628..55489e51 100644 --- a/src/main/resources/shaders/vertex/texture.glsl +++ b/src/main/resources/shaders/vertex/texture.glsl @@ -1,5 +1,5 @@ -#version 460 +#version 330 layout (location = 0) in vec3 pos; layout (location = 1) in vec2 uv_in;