voxelcore/doc/en/scripting/builtins
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
..
libapp.md update doc/*/scripting/builtins/libapp.md 2026-11-01 17:33:51 +03:00
libassets.md update doc/*/scripting/builtins/libassets.md 2026-10-14 13:03:05 +03:00
libbase64.md update doc/*/scripting/builtins/libbase64.md 2025-09-16 22:24:29 +03:00
libblock.md update doc/*/scripting/builtins 2026-10-31 17:19:42 +03:00
libbyteutil.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libcameras.md update doc/*/scripting/builtins/libcameras.md 2024-10-15 04:38:18 +03:00
libcrypto.md update crypto docs 2026-08-22 17:47:59 +07:00
libctypes.md add ctypes docs (minimal) 2026-08-04 20:24:58 +03:00
libentities.md update doc/*/entity-properties.md, doc/*/scripting/builtins/libentities.md 2026-10-19 21:53:03 +03:00
libfile.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libgfx-blockwraps.md fix doc/en/scripting/builtins/libgfx-blockwraps.md 2025-12-21 17:04:03 +03:00
libgfx-posteffects.md render the world relative to an origin near the camera 2026-11-12 10:05:06 +03:00
libgfx-skeletons.md update doc/*/scripting/ecs.md, doc/*/scripting/builtins/libgfx-skeletons.md 2026-10-18 14:46:31 +03:00
libgfx-weather.md update doc/*/scripting/builtins/libgfx-weather.md 2026-03-16 00:02:42 +03:00
libgui.md update doc/*/scripting/builtins/libgui.md 2026-09-17 22:12:11 +03:00
libhud.md Merge pull request #1043 from ostermine/feat/hotbar-control 2026-10-18 11:38:10 +03:00
libinput.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libinventory.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libitem.md add cached item.has_tag, block.has_tag & update docs 2025-08-31 12:55:02 +03:00
libmat4.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libnetwork.md complete the rename of voxelengine to voxelcore 2026-10-10 10:54:36 +03:00
libpack.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
libpathfinding.md update doc/*/scripting/builtins/libpathfinding.md 2026-11-01 18:42:58 +03:00
libplayer.md docs: describe hotbar keys by topic and hotbar size from server side 2026-10-16 14:06:08 +03:00
libquat.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
librandom.md add 'random' library docs 2025-09-16 20:27:35 +03:00
librules.md fix doc/*/scripting/builtins/librules.md 2026-03-29 20:17:45 +03:00
libsession.md add doc/en/scripting/builtins/libsession.md 2026-03-18 22:10:53 +03:00
libtime.md add precise_utc_time function 2026-08-18 21:57:51 +05:00
libutf8.md update doc/*/scripting/builtins/libutf8 and extensions.md 2025-11-23 20:00:25 +03:00
libvecn.md add vec2.rotate 2025-09-07 21:12:50 +03:00
libworld.md Merge branch 'main' into dev 2026-10-16 01:30:13 +03:00