voxelcore/doc/en/scripting
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
..
builtins render the world relative to an origin near the camera 2026-11-12 10:05:06 +03:00
modules fix docs typos and other trash 2026-10-16 00:20:25 +03:00
ecs.md update doc/*/scripting/ecs.md, doc/*/scripting/builtins/libgfx-skeletons.md 2026-10-18 14:46:31 +03:00
events.md update doc/*/scripting/events.md 2026-10-18 14:17:23 +03:00
extensions.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
filesystem.md fix docs typos and other trash 2026-10-16 00:20:25 +03:00
ui.md update doc/*/scripting/ui.md 2026-10-31 17:59:26 +03:00
user-input.md docs: list punctuation key names 2026-10-11 22:46:32 +03:00