Commit graph

6919 commits

Author SHA1 Message Date
ostermine
89bdadd6aa render the world relative to an origin near the camera
World coordinates were passed to GPU as floats: u_model of a chunk and
of a model had the world translation, vertices of translucent blocks,
particles, precipitation, block wrappers, lines and 3D texts were built
in the world space, and the camera position was subtracted in shaders.
The float step grows with the distance from the world origin (6 cm at
1M blocks, 2 m at 30M): blocks got skewed, then stuck together.

Camera::getOrigin() is an integer point near the camera (X and Z are
rounded to 1024 blocks, Y is 0). Camera::getView() is relative to it,
and every position passed to GPU is "world - origin" calculated on CPU,
so the shaders keep working with small numbers and do not change:
u_cameraPos, a_modelpos, u_inverseView and the shadows matrices are in
the same space as before, shifted by the origin. Matrices of a shadow
map are converted from the origin of its camera to the origin of the
player camera. The clouds shader gets the origin wrapped by the period
of its waves, the waves stay bound to the world.

Vertices of translucent blocks are local to the chunk now, as vertices
of opaque ones, and drawn with u_model of the chunk.
2026-11-12 10:05:06 +03:00
ostermine
e1f6daabb7 fix camera view rotation far from the world origin
Camera::getView built the view with lookAt(position, position + front):
the direction came back as a difference of large floats. Far from the
origin the view turned away from where the camera looks - at 16M blocks
by up to 24 degrees, at 30M the camera looked straight up or down
whatever its yaw (at pitch 0 the direction is a zero vector, the matrix
is NaN). The rotation is built from front itself now, then translated
by -position: the same matrix, without the subtraction.
2026-11-12 10:05:05 +03:00
MihailRis
348c058c9b
Merge pull request #1079 from ostermine/fix/math-randomseed
Some checks failed
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Has been cancelled
Build / Build (push) Has been cancelled
Macos Build / build-dmg (push) Has been cancelled
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Has been cancelled
MSVC Build / build-windows (windows-2022) (push) Has been cancelled
fix math.random seed being the same on every launch
2026-11-08 17:51:43 +03:00
MihailRis
5983e981ed
Merge pull request #1078 from ostermine/fix/server-tick-rate
fix headless tick rate: schedule ticks by deadlines
2026-11-08 17:50:57 +03:00
ostermine
4578915943 fix math.random seed being the same on every launch
stdlib.lua runs from scripting::initialize before the main loop starts,
so time.uptime() is still 0 there and math.randomseed(time.uptime() *
1536227939) is math.randomseed(0). math.random() gave the same sequence
on every launch, and so did the random seed placeholder of the "New
World" page: every world created without typing a seed got the same
seed. Seed from time.precise_utc_time() instead.
2026-11-06 03:49:26 +03:00
ostermine
67c913041e fix headless tick rate: schedule ticks by deadlines
ServerMainloop slept the rest of the tick and then restarted counting from
the moment it woke up, so every sleep overshoot made the tick longer. With a
coarse timer (a VirtualBox guest of a Windows host) --tps 20 gave 12-17 ticks
per second. Ticks now follow absolute deadlines on steady_clock; after falling
more than 5 ticks behind the schedule is reset instead of running a burst of
ticks.

The time of a tick is its scheduled time, so delta is exactly 1 / tps while
the loop keeps up, as in test mode. With the wake-up time deltas jitter
around 1 / tps, and the world tick clock, which calls on_world_tick at most
once per update, skipped every few ticks.
2026-11-05 13:46:49 +03:00
MihailRis
9be7cfa724 fix fatal errors caused by incorrect interval event callbacks timing
Some checks failed
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Has been cancelled
Build / Build (push) Has been cancelled
Macos Build / build-dmg (push) Has been cancelled
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Has been cancelled
MSVC Build / build-windows (windows-2022) (push) Has been cancelled
2026-11-05 03:35:32 +03:00
MihailRis
97c790350d
Merge pull request #1072 from MihailRis/dev
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
0.33 development
2026-11-04 16:23:46 +03:00
MihailRis
f4d4209e48 fix reverb room rolloff factor minimum value 2026-11-04 15:58:55 +03:00
MihailRis
c641a18d32 fix lighting settings based chunk meshes rebuilding 2026-11-04 12:43:42 +03:00
MihailRis
3ee20855a5
Merge pull request #1077 from MihailRis/fix-audio-streams-cleanup
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
fix audio streams cleanup
2026-11-03 23:21:18 +03:00
MihailRis
482f6d4a18
Merge pull request #1076 from MihailRis/missing-content-removal
feat: automatic missing content removal
2026-11-03 22:46:39 +03:00
MihailRis
498868a8d5 cleanup 2026-11-03 22:45:30 +03:00
MihailRis
1bb66ebf1f fix audio streams cleanup 2026-11-03 22:26:03 +03:00
MihailRis
24718a2993 reverting it because voices are not reasom
This reverts commit ecc4c1794e.
2026-11-03 22:08:44 +03:00
MihailRis
ecc4c1794e replace 'units' with 'blocks', 'items' for some reason 2026-11-03 22:01:43 +03:00
MihailRis
8268118735 update ru_RU.txt 2026-11-03 21:35:38 +03:00
MihailRis
3de0187a87 feat: removing world missing content from UI 2026-11-03 21:29:42 +03:00
MihailRis
106a575c60
Merge pull request #1075 from MihailRis/abstract-defs
fix content inheritance issues
2026-11-03 20:09:07 +03:00
MihailRis
c9cc301e46 fix content inheritance issues 2026-11-03 18:46:50 +03:00
MihailRis
8124b550df
Merge pull request #1073 from MihailRis/uv-lock
uv-lock block property
2026-11-02 00:57:00 +03:00
MihailRis
46ce153eb2 update doc/*/block-properties.md 2026-11-02 00:12:33 +03:00
MihailRis
7d3584629f cleanup 2026-11-02 00:07:47 +03:00
MihailRis
42f28dd96e update post_content.lua 2026-11-02 00:04:12 +03:00
MihailRis
463a439089 add 'uv-lock' block property 2026-11-02 00:03:25 +03:00
MihailRis
c2777eba09
Merge pull request #1071 from MihailRis/pathfinding-update
pathfinding update
2026-11-01 19:08:18 +03:00
MihailRis
835521e734 update doc/*/scripting/builtins/libpathfinding.md 2026-11-01 18:42:58 +03:00
MihailRis
3ec03738b4 add pathfinding.set_height 2026-11-01 18:41:40 +03:00
MihailRis
98cd85f4f6 Merge branch 'dev' into pathfinding-update 2026-11-01 18:37:28 +03:00
MihailRis
e2e7f8711b Merge branch 'dev' of https://github.com/MihailRis/voxelcore into dev 2026-11-01 18:37:17 +03:00
MihailRis
be59202e17 Merge branch 'main' into dev 2026-11-01 18:37:11 +03:00
MihailRis
2aaaea6e83
Merge pull request #1070 from MihailRis/engine-patch-number
engine patch number
2026-11-01 18:15:24 +03:00
MihailRis
a0c3e546fe update core:pathfinding component 2026-11-01 18:14:50 +03:00
MihailRis
db8c684855 update doc/*/scripting/builtins/libpathfinding.md 2026-11-01 18:09:03 +03:00
MihailRis
b37da1a728 add pathfinding.set_width 2026-11-01 18:07:21 +03:00
MihailRis
1fe64a8b51 remove extra pathfinding route steps & add pathfinding agent width 2026-11-01 18:05:31 +03:00
MihailRis
e196086ec3 update doc/*/scripting/builtins/libapp.md 2026-11-01 17:33:51 +03:00
MihailRis
5390541334 update app.get_version 2026-11-01 17:31:53 +03:00
MihailRis
3e22dd6329 pass patch number to the engine 2026-11-01 17:30:34 +03:00
MihailRis
cb5bebf3ae fix core:pathfinding with low refresh interval
Some checks failed
Macos Build / build-dmg (push) Has been cancelled
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Has been cancelled
MSVC Build / build-windows (windows-2022) (push) Has been cancelled
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Has been cancelled
Build / Build (push) Has been cancelled
2026-11-01 04:55:07 +03:00
MihailRis
17e6d2e8f6
Merge pull request #1059 from MihailRis/test-client-test
add first client test (creating_new_world.lua)
2026-11-01 04:36:51 +03:00
MihailRis
e370ec6495
Merge pull request #1069 from MihailRis/remove-entt
remove EnTT dependency
2026-11-01 04:11:40 +03:00
MihailRis
1da6ef9747 extract render-related code from Entities to EntitiesRenderer 2026-11-01 03:34:16 +03:00
MihailRis
5afe1e2f37 remove EnTT from README.md 2026-11-01 02:34:06 +03:00
MihailRis
3bc521c916 remove entt from build configs and workflows 2026-11-01 02:32:45 +03:00
MihailRis
dbc6a52132 update CMakeLists.txt 2026-11-01 02:29:17 +03:00
MihailRis
7ef07a75cd remove EnTT from Entities.cpp 2026-11-01 02:24:15 +03:00
MihailRis
0ae335599a add MeshStats vertices count to Mesh::drawInstanced 2026-11-01 02:05:27 +03:00
MihailRis
5011a654be Merge branch 'main' into dev 2026-11-01 02:03:50 +03:00
MihailRis
7561515ff2
Merge pull request #1068 from MihailRis/show-vertices-in-debug-panel
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
add vertices count to debug panel
2026-11-01 02:03:23 +03:00