5221 Commits

Author SHA1 Message Date
Moritz Zwerger
3feebb8935
fix test executor, block position bounds 2025-03-04 16:39:21 +01:00
Moritz Zwerger
d70f55ad56
fix building of tests 2025-03-04 16:25:31 +01:00
Moritz Zwerger
6abc316d0d
make it build 2025-03-03 19:04:52 +01:00
Moritz Zwerger
dd9aee9c21
chunk mesher: only remove from meshing queue if meshed
If it was interrupted it might not restart the meshing. That probably solves the "sometimes missing chunk" bug.
2025-03-02 20:58:43 +01:00
Moritz Zwerger
f0db36c80b
some tracing 2025-03-02 19:41:03 +01:00
Moritz Zwerger
83c86d2129
lots of build fixes
Down to < 100 errors (without tests)
2025-02-28 23:56:39 +01:00
Moritz Zwerger
d60267a981
more build fixes
700 errors to go
2025-02-21 21:23:27 +01:00
Moritz Zwerger
05855f8ad2
more fixes and inlining
Why are there so many build errors? Still 1000 to go...
2025-02-19 22:18:28 +01:00
Moritz Zwerger
6ee353dedd
more build fixes, some refactor 2025-02-19 12:58:33 +01:00
Moritz Zwerger
fe470a2384
more improvements 2025-02-18 13:57:36 +01:00
Moritz Zwerger
d22cae38de
more inline data type refactor
- more position
 - LightArray
2025-02-14 21:49:17 +01:00
Moritz Zwerger
e730434482
more porting to inlined positions 2025-02-14 20:51:22 +01:00
Moritz Zwerger
b655998304
inline block, chunk, in chunk position 2025-02-14 20:41:03 +01:00
Moritz Zwerger
387877fe27
inline some stuff 2025-02-14 19:16:54 +01:00
Moritz Zwerger
b74d63ac51
section occlusion: work with just the index, not xyz
This actually is a lot faster since there is no need to push xyz recursively (benchmark goes down from 23s to 12s, so 48% improvement).
This is time critical code, because occlusion is calculated on demand in the rendering thread and might cause stuttering when new chunks flow it (the meshing queue depends on it)
2025-02-13 23:34:44 +01:00
Moritz Zwerger
25d4ab6fdc
world visibility graph: check correct chunk position
chunkPosition.x could already have been changed during the check and this random regions just disappear.

Hell, one day I will rewrite this whole part and write tests...
2025-02-09 21:04:59 +01:00
Moritz Zwerger
1486cd9cf8
packet decoder: only warn if not connected
We are already disconnected, don't care about it.
2025-02-09 20:52:10 +01:00
Moritz Zwerger
1d5d1bbdc6
block changes: fix potential deadlock
Light changes are fired before the lock is unlocked. The event enqueues it in the culling queue, which wants the lock. Hence it is deadlocking...
2025-02-09 20:01:45 +01:00
Moritz Zwerger
2557992ace
bump lwjgl 2025-02-09 20:01:43 +01:00
Moritz Zwerger
bf6db97798
meshing: cache tint array
Reduces potential allocation of new arrays during meshing
2025-02-09 20:01:41 +01:00
Moritz Zwerger
faa2b10b51
array float lists: make min grow step a power of 2 2025-02-09 20:01:40 +01:00
Moritz Zwerger
dbd4752d09
section occlusion: set invalid region for full opaque blocks
No need to check if the block is full opaque multiple times.
Benchmark time goes down from 18s to 15s, so 17% improvement. Not bad.
2025-02-09 20:01:38 +01:00
Moritz Zwerger
3fadadd441
fragmented array list: optimize batch adding for 6 floats, clean up
6 floats are added during chunk meshing, this does improve performance because it adds a special case for the most likely case (the buffer has enough capacity left)
2025-02-09 20:01:34 +01:00
Moritz Zwerger
434cc7bacb
dns util: don't resolve ip addresses
This just times out. Not needed.
2025-02-09 19:47:07 +01:00
Moritz Zwerger
ff68fcaac0
chunk meshing: prioritize very close chunks 2025-02-08 21:28:51 +01:00
Moritz Zwerger
fce6bc27c9
fix tests 2025-02-08 21:06:22 +01:00
Moritz Zwerger
d3dfcb2a92
chunk reading: check early if data is empty
Now it does not allocate chunk data when the section is truly empty (servers sometimes send the opposite and then it turns out that they are empty)
2025-02-08 21:06:05 +01:00
Moritz Zwerger
1b869e4761
ambient occlusion: on demand
This is way faster now and almost disappeared in the cpu profiling.
It also renders ao only on touching faces
2025-02-08 20:40:38 +01:00
Moritz Zwerger
b174638aaf
outsource allocator, section occlusion: reuse memory 2025-02-08 19:55:48 +01:00
Moritz Zwerger
d2dfe2b7f6
world visibility graph: remove dynamic allocation 2025-02-08 19:39:36 +01:00
Moritz Zwerger
128ced029d
linux: force x11
Wayland simply crashes and does not work at all.
2025-02-08 19:32:39 +01:00
Moritz Zwerger
a8fa9a304c
fluid mesher: reduce allocation a bit
Still a big fucking mess
2025-02-08 19:32:23 +01:00
Moritz Zwerger
555252d123
long array allocator: remove array that is in use 2025-02-08 19:31:57 +01:00
Moritz Zwerger
8e1855f10a
network: paletted container reading: reuse long array
Now it stores all allocated long arrays in a weak list and reuses them if they were not collected by the gc yet
2025-02-08 19:18:15 +01:00
Moritz Zwerger
055b015390
limit time for gpu chunk transfers
"Smooth FPS"

Adds an option to the config, and limits to time the chunk renderer has to transfer to about 3ms. This works good and feels a lot smoother now.
2025-02-08 18:22:11 +01:00
Moritz Zwerger
f20f2b5e0b
option to disable ambient occlusion 2025-02-07 23:52:34 +01:00
Moritz Zwerger
0db46ff41f
ambient occlusion: real greyscale 2025-02-07 23:43:36 +01:00
Moritz Zwerger
6a9cc77879
ambient occlusion
west + east
2025-02-07 23:33:28 +01:00
Moritz Zwerger
b6d14b3a9b
wip ambient occlusion
already working for top/bottom faces
2025-02-07 23:11:16 +01:00
Moritz Zwerger
f22935b5f1
arm render: enable face culling
Looks pretty shitty otherwise
2025-02-07 22:14:47 +01:00
Moritz Zwerger
095b537578
chunk renderer: pack uv
Cleans up uv with its own inlined datatype.

UV took 2*32bits but that was just overkill. Now it takes 2*12 bits and fits into one 32 bit float and leaves an additional
8 bits left, 2 of them will be used for ambient occlusion in the future.
2025-02-07 15:38:49 +01:00
Moritz Zwerger
68728bb1d8
baked face: don't allocate Int object when not tinted
Reduces some allocation during chunk meshing
2025-02-07 13:34:40 +01:00
Moritz Zwerger
89c164b360
block flags
This caches some properties that might be "complex" to calculate and are needed all over. Costs some memory, but we got enough, right?
2025-02-07 13:30:27 +01:00
Moritz Zwerger
63ff882512
reduce meshes per frame, reduce some latency 2025-02-06 22:11:59 +01:00
Moritz Zwerger
f1596c53ff
block entity receiving: don't process empty nbt 2025-02-06 22:11:43 +01:00
Moritz Zwerger
2e202bd6fc
benchmark section occlusion 2025-02-06 21:54:12 +01:00
Moritz Zwerger
b2963ca1bd
occlusion: cache short array
Reduces memory allocations a lot and slightly the performance
2025-02-06 21:47:52 +01:00
Moritz Zwerger
c6892e4bd3
chunk section: only keep track if section has fluids and not how many, improvements
A lot faster now and the count is not really needed, it will change rarely.
2025-02-06 21:37:15 +01:00
Moritz Zwerger
d2d83d85dc
MobSpawnerBlockEntity::isPlayerInRange: don't wait forever
This workarounds a deadlock.
2025-02-06 21:06:29 +01:00
Moritz Zwerger
be5dffcc0a
some more freeze dump improvements 2025-02-06 18:57:26 +01:00