mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -04:00
world border: remove camera offset
This breaks it even harder…
This commit is contained in:
parent
592b22db76
commit
a3deac5df0
@ -15,7 +15,6 @@ package de.bixilon.minosoft.gui.rendering.world.border
|
||||
|
||||
import de.bixilon.kotlinglm.func.common.clamp
|
||||
import de.bixilon.kotlinglm.vec2.Vec2
|
||||
import de.bixilon.kotlinglm.vec2.Vec2d
|
||||
import de.bixilon.kutil.latch.CountUpAndDownLatch
|
||||
import de.bixilon.kutil.time.TimeUtil.millis
|
||||
import de.bixilon.minosoft.data.registries.identified.Namespaces.minosoft
|
||||
@ -75,7 +74,7 @@ class WorldBorderRenderer(
|
||||
}
|
||||
val textureOffset = (offsetReset - time) / ANIMATION_SPEED.toFloat()
|
||||
shader.textureOffset = 1.0f - textureOffset
|
||||
shader.cameraHeight = (context.connection.camera.entity.renderInfo.eyePosition.y - context.camera.offset.offset.y).toFloat()
|
||||
shader.cameraHeight = context.connection.camera.entity.renderInfo.eyePosition.y.toFloat()
|
||||
|
||||
val distance = border.getDistanceTo(context.connection.player.physics.position).toFloat()
|
||||
val strength = 1.0f - (distance.clamp(0.0f, 100.0f) / 100.0f)
|
||||
@ -87,8 +86,7 @@ class WorldBorderRenderer(
|
||||
color = color.with(alpha = (strength * strength))
|
||||
shader.tintColor = color
|
||||
shader.radius = border.diameter.toFloat() / 2.0f
|
||||
val offset = context.camera.offset.offset
|
||||
shader.center = Vec2(border.center - Vec2d(offset.x, offset.z))
|
||||
shader.center = Vec2(border.center)
|
||||
}
|
||||
|
||||
override fun drawTranslucent() {
|
||||
|
@ -25,7 +25,6 @@ uniform float uCameraHeight;
|
||||
|
||||
flat out uint finTextureIndex;
|
||||
out vec3 finTextureCoordinates;
|
||||
out vec3 finFragmentPosition;
|
||||
|
||||
|
||||
#include "minosoft:uv"
|
||||
@ -43,7 +42,6 @@ void main() {
|
||||
position.x += uCenter.x;
|
||||
position.z += uCenter.y;
|
||||
gl_Position = uViewProjectionMatrix * vec4(position, 1.0f);
|
||||
finFragmentPosition = position;
|
||||
|
||||
finTextureIndex = uIndexLayer >> 28u;
|
||||
vec2 uv = CONST_UV[floatBitsToUint(uvIndex)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user