Fix line flickering in ancestral spade solver

This commit is contained in:
Linnea Gräf
2024-11-02 12:55:51 +01:00
parent 8b410fbdf2
commit c516c4b947
3 changed files with 89 additions and 90 deletions

View File

@@ -1,4 +1,3 @@
package moe.nea.firmament.features.diana
import kotlin.time.Duration.Companion.seconds

View File

@@ -172,7 +172,7 @@ class RenderInWorldContext private constructor(
points.zipWithNext().forEach { (a, b) ->
val normal = Vector3f(b.x.toFloat(), b.y.toFloat(), b.z.toFloat())
.sub(a.x.toFloat(), a.y.toFloat(), a.z.toFloat())
// .normalize()
.normalize()
val lastNormal0 = lastNormal ?: normal
lastNormal = normal
buffer.vertex(matrix.positionMatrix, a.x.toFloat(), a.y.toFloat(), a.z.toFloat())

View File

@@ -37,7 +37,7 @@ void main() {
gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);
return; // I don't care for these people
}
if (linePosStartBehind || linePosEndBehind) {
if ((linePosStartBehind || linePosEndBehind) && false) {
ndc1.z = 0.0;
ndc2.z = 0.0;
linePosStart.w = 1.0;