Commit graph

131 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
575bfb28e0 Merge branch 'main' into dev 2026-10-27 13:03:13 +03:00
clasher113
1d5dc81f9c fix tests 2026-10-20 15:44:31 +03:00
MihailRis
ec51848447 update memory_ostream 2026-10-10 16:31:36 +03:00
MihailRis
8962042627 complete the rename of voxelengine to voxelcore 2026-10-10 10:54:36 +03:00
MihailRis
61af506f4c fix xml.tostring 2026-09-27 16:14:14 +03:00
boolean-false
7f408c11de Перевел parse_double на from_chars 2026-09-20 18:55:59 +07:00
MihailRis
ef4bd4f594
Merge pull request #941 from boolean-false/crypto-library
Crypto library
2026-09-17 20:41:32 +03:00
dagger
8d279466a9 move crypto Lua test to dev tests 2026-09-15 04:45:07 +07:00
MihailRis
58c974a3a1 add HttpResponse 2026-09-13 16:16:59 +03:00
MihailRis
74bb695807 cleanup http requests (part 1) 2026-09-09 23:43:44 +03:00
dagger
c65b9ae385 fix ecdsa test on linux 2026-08-22 17:14:42 +07:00
dagger
a23c4d4159 add crypto library 2026-08-22 15:22:55 +07:00
MihailRis
b4c8469264 Merge branch 'main' into client-side-tests 2026-07-07 18:53:27 +03:00
MihailRis
98dfeb8da6 Merge branch 'main' into fix-basic-parser-exponential-notation 2026-07-07 17:50:10 +03:00
MihailRis
a8ed3cb36f
fix macos build (#859)
* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update workflows

* update test

* fix unused function warning

* update test

* fixes

* update test

* update test

* update macos.yml

* Revert "update workflows"

This reverts commit ae78ff3ca2.
2026-07-07 17:42:24 +03:00
MihailRis
c45d994216 fix BasicParser power function 2026-07-06 12:44:09 +03:00
MihailRis
ce0f90d21e feat: memory_istream seek support 2026-06-11 00:17:31 +03:00
MihailRis
30177b9d2a fix stringutil locale-related functions 2026-04-07 00:03:56 +03:00
MihailRis
163a0a8c93 rename ImageFormat enum items 2025-12-21 19:05:14 +03:00
MihailRis
9dc9441902 reduce allocations while reading chunks data 2025-12-06 00:58:13 +03:00
MihailRis
fa6950ca87 fix util::stack_vector 2025-10-16 18:17:30 +03:00
MihailRis
28c821006a fix unicode string literal escape 2025-09-23 00:08:05 +03:00
MihailRis
7d6ddfa535 add 'data' argument to http error callback 2025-09-16 23:17:06 +03:00
MihailRis
a621b179d3 add 'do-trace-shaders' setting and fix shaders recompiling 2025-08-31 18:14:05 +03:00
MihailRis
9cd95bb0eb fix toml encoder 2025-06-29 12:33:57 +03:00
MihailRis
4333d9ab06 feat: support alternative vcm models syntax 2025-06-01 23:08:59 +03:00
MihailRis
5253be6c56 feat: custom languages syntax (WIP) 2025-04-13 00:19:38 +03:00
MihailRis
4360cd408b refactor: rename coders/lua_parsing to coders/syntax_parser 2025-04-12 21:14:18 +03:00
MihailRis
ba170035ef feat: post-processing effects 2025-04-05 00:41:25 +03:00
MihailRis
70cf308771 add '#param' default value syntax 2025-04-04 13:19:25 +03:00
MihailRis
6043ae8331 refactor GLSLExtension 2025-04-03 21:57:46 +03:00
MihailRis
1feee3a809 refactor GLSLExtension.cpp & add 'param' shader preprocessor directive & add PostEffect class (WIP) 2025-04-03 21:46:12 +03:00
MihailRis
b3feb5945b reduce extra includes 2025-04-02 14:55:53 +03:00
MihailRis
396fab02b3 add yaml::stringify 2025-03-24 05:30:56 +03:00
MihailRis
2aea19febd add YAML parser 2025-03-23 08:49:09 +03:00
Ygrik2003
6c3d2d0907
Merge pull request #435 from Ygrik2003/Refactoring-cmake
Refactoring cmake
2025-03-20 20:59:19 +03:00
MihailRis
4cdb1fbae2 add util::base64_urlsafe_encode/decode 2025-03-12 16:26:46 +03:00
MihailRis
decb820cf9 add memory_istream 2025-02-22 05:47:27 +03:00
MihailRis
8a8c1525fd
Fix syntax highlighting unicode support (#475)
* convert BasicParser to a template

* fix syntax hightlighting with unicode characters
2025-02-22 01:01:20 +03:00
MihailRis
b1740bf7eb update io::path::normalized() 2025-02-05 14:56:45 +03:00
MihailRis
e4c33e539e fix io::path.parent() & update tests 2025-02-04 12:53:05 +03:00
MihailRis
e0314803c0 migrate from std::filesystem::path to io::path (WIP) 2025-01-30 22:23:13 +03:00
MihailRis
1e22882284 rename 'files' to 'io' 2025-01-30 16:53:52 +03:00
Stepanov Igor
bb15d17892 add cmake-format.py and formating all cmake files 2025-01-09 16:32:54 +03:00
MihailRis
857bdd7f37 update cmake lists 2024-12-27 07:14:47 +03:00
MihailRis
d73c0b21f5 fix cmake in linux 2024-12-27 07:00:30 +03:00
Stepanov Igor
2229cd538c Fix ctest 2024-12-22 01:00:23 +03:00
Ygrik2003
885438999d
Fix resources 2024-12-21 10:31:02 +03:00