Commit graph

1648 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
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
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
42f28dd96e update post_content.lua 2026-11-02 00:04:12 +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
be59202e17 Merge branch 'main' into dev 2026-11-01 18:37:11 +03:00
MihailRis
a0c3e546fe update core:pathfinding component 2026-11-01 18:14:50 +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
5011a654be Merge branch 'main' into dev 2026-11-01 02:03:50 +03:00
ostermine
3b0efb674a fix app.config_packs adding default packs twice in a client app script
Since b2bbef69 the first content-related app function ticks first, and in a
client app that tick loads the default content. app.config_packs read the
installed packs before that tick, so it asked reconfig_packs to add base
again: "pack duplication [base]". Do the pending tick before reading them.
2026-10-30 20:11:53 +03:00
MihailRis
575bfb28e0 Merge branch 'main' into dev 2026-10-27 13:03:13 +03:00
MihailRis
5eae83be33
Merge pull request #1062 from MihailRis/entity-rotation-interpolation
entity rotation interpolation
2026-10-27 13:02:35 +03:00
MihailRis
59047f3c6a fix entity.transform size animation 2026-10-26 19:31:47 +03:00
MihailRis
07568e6ae8 update res/preload.json 2026-10-26 12:27:41 +03:00
MihailRis
b2bbef699c fix content-related app functions timings 2026-10-25 22:56:54 +03:00
MihailRis
10f9d89c6d add first client test (creating_new_world.lua) 2026-10-21 20:48:23 +03:00
MihailRis
283e3c041e add entity.properties 2026-10-19 21:46:30 +03:00
MihailRis
716977aed7 update Skeleton class 2026-10-18 17:10:44 +03:00
MihailRis
01a0215903 add skeleton:get_bone_offset 2026-10-18 14:45:42 +03:00
Andrey Tazetdinov
5d6446b06a gpu instanced entities renderer 2026-10-18 12:44:37 +02:00
MihailRis
0f71e1a152 fix animation & disable codegen trace 2026-10-18 12:45:03 +03:00
MihailRis
bb73e3f354
Merge pull request #1043 from ostermine/feat/hotbar-control
make hotbar size and layout configurable
2026-10-18 11:38:10 +03:00
MihailRis
45c97e6f1e revert: use dithering for non translucent entities 2026-10-16 22:34:57 +03:00
MihailRis
2288251494 revert player_animator.lua changes 2026-10-16 22:25:05 +03:00
MihailRis
7522016e84 feat: entity translucent pass & test layered transparency pipeline 2026-10-16 22:20:59 +03:00
MihailRis
35e3d80f35 Merge branch 'main' into dev 2026-10-16 01:30:13 +03:00
ostermine
aa670f3c9d make hotbar size and layout configurable
Add hotbar-size, hotbar-layout and inventory-layout to config/defaults.toml,
player.get_hotbar_size / player.set_hotbar_size and
hud.is_hotbar_visible / hud.set_hotbar_visible.
2026-10-15 15:58:56 +03:00
Andrey Tazetdinov
05f9782786 track groups 2026-10-14 16:46:12 +02:00
Andrey Tazetdinov
fd17ce32ab optimize animator 2026-10-14 16:35:21 +02:00
MihailRis
d0803fce0c add world.get_logic, set_logic 'block_ticks', 'random_ticks' runtime world parameters 2026-10-14 12:15:32 +03:00
MihailRis
6f76dc7519 Merge branch 'main' into dev 2026-10-13 22:17:31 +03:00
MihailRis
57fa6393c2 feat: 'res:project' as default project 2026-10-12 20:06:30 +03:00
MihailRis
1f5d415f75 feat: reuse streams 2026-10-12 18:54:26 +03:00
MihailRis
6034c4933f add app.get_stdin_stream 2026-10-12 03:05:25 +03:00
MihailRis
0340e2977e add app.get_stdout_stream 2026-10-11 22:23:48 +03:00
MihailRis
3fc5a4322d Merge branch 'dev' into lights-fixes 2026-10-11 15:25:10 +03:00
MihailRis
3617e01d21 refactor: split io_stream 2026-10-10 17:24:17 +03:00
MihailRis
7994d41b19 Merge branch 'main' into dev 2026-10-10 12:34:29 +03:00
ostermine
d8017ff995 fix reload_module ignoring pack environment
reload_module loaded the new module code with the global environment,
while require runs modules in their pack environment. After reload,
PACK_ID and other pack globals were nil in the module.
2026-10-10 00:52:23 +03:00
MihailRis
08abed324c fix 'color' target 2026-10-09 00:19:22 +03:00
MihailRis
51c8d78b88 add 'color' VCA directive 2026-10-09 00:14:59 +03:00
MihailRis
a036a590ab add 'model' directive 2026-10-08 23:27:45 +03:00
MihailRis
26d09f750b replace control with show for visibility 2026-10-08 23:24:09 +03:00
MihailRis
1f2e938d83 feat: control flag visible for whole skeleton support 2026-10-07 22:32:11 +03:00
MihailRis
fed89b64c7 add 'control' VCA directive and 'visible' flag 2026-10-07 20:51:33 +03:00