mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -04:00
debug hud: show opaque and translucent size
This commit is contained in:
parent
b5637518ab
commit
963f82f988
@ -132,7 +132,7 @@ open class ItemFeature(
|
|||||||
EXTREME(48.0),
|
EXTREME(48.0),
|
||||||
;
|
;
|
||||||
|
|
||||||
val distance = distance * distance * distance
|
val distance = distance * distance
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
|
|||||||
|
|
||||||
class VisibilityManager(val renderer: EntitiesRenderer) {
|
class VisibilityManager(val renderer: EntitiesRenderer) {
|
||||||
private var update = false
|
private var update = false
|
||||||
|
private var _size = 0
|
||||||
var size: Int = 0
|
var size: Int = 0
|
||||||
private set
|
private set
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ class VisibilityManager(val renderer: EntitiesRenderer) {
|
|||||||
opaque.clear()
|
opaque.clear()
|
||||||
translucent.clear()
|
translucent.clear()
|
||||||
size = 0
|
size = 0
|
||||||
|
_size = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun EntityRenderer<*>.isInRenderDistance(): Boolean {
|
private fun EntityRenderer<*>.isInRenderDistance(): Boolean {
|
||||||
@ -80,7 +82,7 @@ class VisibilityManager(val renderer: EntitiesRenderer) {
|
|||||||
fun collect(renderer: EntityRenderer<*>) {
|
fun collect(renderer: EntityRenderer<*>) {
|
||||||
if (!renderer.visible) return
|
if (!renderer.visible) return
|
||||||
lock.lock()
|
lock.lock()
|
||||||
size++
|
_size++
|
||||||
for (feature in renderer.features) {
|
for (feature in renderer.features) {
|
||||||
if (!feature.enabled || !feature.visible || feature.isInvisible()) continue
|
if (!feature.enabled || !feature.visible || feature.isInvisible()) continue
|
||||||
feature.collect(this)
|
feature.collect(this)
|
||||||
@ -93,6 +95,7 @@ class VisibilityManager(val renderer: EntitiesRenderer) {
|
|||||||
this.opaque.sort()
|
this.opaque.sort()
|
||||||
this.translucent.sort()
|
this.translucent.sort()
|
||||||
this.update = false
|
this.update = false
|
||||||
|
size = _size
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun get(layer: EntityLayer) = when (layer) {
|
operator fun get(layer: EntityLayer) = when (layer) {
|
||||||
|
@ -100,7 +100,7 @@ class DebugHUDElement(guiRenderer: GUIRenderer) : Element(guiRenderer), Layouted
|
|||||||
}
|
}
|
||||||
|
|
||||||
layout += context.renderer[EntitiesRenderer]?.let {
|
layout += context.renderer[EntitiesRenderer]?.let {
|
||||||
AutoTextElement(guiRenderer, 1) { BaseComponent("E v=", it.visibility.size, ", t=", it.renderers.size, ", w=", connection.world.entities.size) }
|
AutoTextElement(guiRenderer, 1) { BaseComponent("E v=", it.visibility.size, ",ov=", it.visibility.opaque.size, ",tv=", it.visibility.translucent.size, ", t=", it.renderers.size, ", w=", connection.world.entities.size) }
|
||||||
} ?: AutoTextElement(guiRenderer, 1) { "E w=${connection.world.entities.size.format()}" }
|
} ?: AutoTextElement(guiRenderer, 1) { "E w=${connection.world.entities.size.format()}" }
|
||||||
|
|
||||||
context.renderer[ParticleRenderer]?.apply {
|
context.renderer[ParticleRenderer]?.apply {
|
||||||
|
@ -15,6 +15,7 @@ package de.bixilon.minosoft.terminal.commands.connection
|
|||||||
|
|
||||||
import de.bixilon.kotlinglm.GLM.PIf
|
import de.bixilon.kotlinglm.GLM.PIf
|
||||||
import de.bixilon.kotlinglm.vec3.Vec3d
|
import de.bixilon.kotlinglm.vec3.Vec3d
|
||||||
|
import de.bixilon.kutil.math.Trigonometry.sin
|
||||||
import de.bixilon.kutil.random.RandomUtil.nextDouble
|
import de.bixilon.kutil.random.RandomUtil.nextDouble
|
||||||
import de.bixilon.kutil.random.RandomUtil.nextFloat
|
import de.bixilon.kutil.random.RandomUtil.nextFloat
|
||||||
import de.bixilon.kutil.random.RandomUtil.nextInt
|
import de.bixilon.kutil.random.RandomUtil.nextInt
|
||||||
@ -33,7 +34,6 @@ import de.bixilon.minosoft.util.KUtil.startInit
|
|||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.cbrt
|
import kotlin.math.cbrt
|
||||||
import kotlin.math.sin
|
|
||||||
|
|
||||||
object BenchmarkCommand : ConnectionCommand {
|
object BenchmarkCommand : ConnectionCommand {
|
||||||
override var node = LiteralNode("benchmark").addChild(
|
override var node = LiteralNode("benchmark").addChild(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user