460 Commits

Author SHA1 Message Date
IntegratedQuantum
775dcc85fc Use palette compression for chunks and increase the maximum render distance.
fixes #156
fixes #136
2024-04-17 17:29:25 +02:00
IntegratedQuantum
64e37dca26 Move all the palette compression related code into utils.
More progress towards #156
2024-04-17 16:22:27 +02:00
IntegratedQuantum
82be61ed6d Implement mutex assertions only in debug mode.
This avoids side effects in release fixing #317
2024-04-16 22:16:19 +02:00
IntegratedQuantum
4ea9b37b8c
Update ci.yml Does it now work? 2024-04-16 14:11:05 +02:00
IntegratedQuantum
d585551ba7
Update ci.yml 2024-04-16 14:03:43 +02:00
IntegratedQuantum
b8b1ba49f4
Create ci.yml
Should fix #315
2024-04-16 14:02:40 +02:00
IntegratedQuantum
aba651a998 Add a simple python script to check for common formatting errors (tabs and line endings) and fix existing problems.
a step towards #315
2024-04-16 13:51:22 +02:00
archbirdplus
5b76d2c33c
Adjust mesh selection by crosshair (fixes #302) (#323)
* Adjust mesh selection by crosshair (fixes #302)

* view space is now also z-up. The projection matrix now transforms z-up to y-up.

This makes it more intuitive to use the camera matrix for cpu-side computations. (see #323)

* Correct axes in cameraDir/cameraUp vectors

* Remove f32 arg from degreesToRadians in crosshair selection

* Fix some remaining issues.

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2024-04-16 12:28:45 +02:00
IntegratedQuantum
3d3a1322cb view space is now also z-up. The projection matrix now transforms z-up to y-up.
This makes it more intuitive to use the camera matrix for cpu-side computations. (see #323)
2024-04-15 11:24:59 +02:00
IntegratedQuantum
413372a321 Use a RwLock for the lighting data to allow meshing to lock it in a wider scope.
Fixes #319
2024-04-14 20:20:17 +02:00
IntegratedQuantum
86e08b9f8a Use palette compression for light data, reduing memory usage (of light data) by up to 100×.
Progress towards #156
Makes #277 worse
2024-04-14 15:42:49 +02:00
careeoki
80a54a8727
Colour Balancing & Texture Changes (#314)
* Colour balancing / texture changes

Slight changes to block colours to look nicer.
- Oak leaves are darker than grass. Oak woods are less saturated
- Sand is darker and more yellow
- Stone and soil are both slightly lighter

Texture changes:
- Sand tiles better
- Gravel tiles better

* Cont. colour balancing and texture changes

Essentially a more polished version of last commit. 
Soil is more textured, with a new highlight colour
New log is higher contrast
New planks texture that is less contrasty

* New grass plant texture

* Edit sand.json to reflect texture changes

* Delete misplaced texture

* New grass plant texture

* Fix line endings

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2024-04-11 13:43:20 +02:00
IntegratedQuantum
5d079c706e Fix incorrect assert which produced false positives. 2024-04-10 15:14:23 +02:00
IntegratedQuantum
0ab706c184 Fix stair model uvs
fixes #312
2024-04-08 17:12:03 +02:00
IntegratedQuantum
0a6521ff3e Fix texture brightness in game
Fixes #313
2024-04-08 15:35:50 +02:00
IntegratedQuantum
293100305c
Update the link to the java version. 2024-04-06 14:06:43 +02:00
IntegratedQuantum
63be36dfb3 I accidentally commited debug code that disabled occlusion culling in my previous commit. 2024-04-05 20:47:25 +02:00
IntegratedQuantum
f7cd5e4c9c Fix more errors at the integer limit.
Fixes #309
2024-04-05 11:44:42 +02:00
IntegratedQuantum
0b11301910 Some fixes for terrain generation at the world border.
Terrain generation no longer crashes which is a step a step towards #309
Also fixed #286 which I found along the way.
2024-04-04 18:58:33 +02:00
IntegratedQuantum
0acb0e2c80 Update zig
This one was annoying.
2024-04-03 13:57:38 +02:00
IntegratedQuantum
2dfbe98844 Add texture hot-reloading for Linux and Windows.
Closes #106
2024-04-02 16:47:32 +02:00
IntegratedQuantum
114888110d Fix the menu background capturing. 2024-04-01 11:38:21 +02:00
IntegratedQuantum
f4a8de00ba RotationModes can now change the selection based on the item.
Also make water unselectable.

Closes #292
2024-03-31 16:36:51 +02:00
IntegratedQuantum
5fea779e37 Undo the performance regression of the previous commit by adding a special case for air blocks. 2024-03-30 22:54:48 +01:00
IntegratedQuantum
4ab40cc85b Better occlusion and lighting for non-cube models.
Full faces of non-cube models now block light and occlude neighbor faces, whereas the others will let light through.
This does make light propapagation significantly (~40%) slower though due to the extra logic involved.

Closes #295
2024-03-30 22:13:55 +01:00
IntegratedQuantum
0bee580059 Add temporary chisel texture and recipe. 2024-03-30 15:58:27 +01:00
IntegratedQuantum
d1a81cfa93 Make light values more consistent at T-junctions inside of a model.
Fixes #291
2024-03-30 10:13:15 +01:00
IntegratedQuantum
6473362c6e Add the chisel to make stairs.
fixes #69
2024-03-28 21:11:46 +01:00
IntegratedQuantum
8418202df8 Store and update 3 color channels at once instead of treating them all seperately. This makes lighting ~twice as fast. 2024-03-26 21:23:21 +01:00
IntegratedQuantum
fce29ed4a0 Fix problem with the top fence uvs. 2024-03-25 21:57:49 +01:00
IntegratedQuantum
662ef94d0c Add a terrain border between caves and the ocean floor.
Fixes #282
Also fixes #281 by making water degradable
2024-03-25 20:55:31 +01:00
IntegratedQuantum
92b38a526e Add the torch model and rotation mode.
Resolves #70
2024-03-25 17:52:24 +01:00
IntegratedQuantum
44a786165d Properly handle closing the game menu.
Fixes #37
Fixes #248
Fixes #283
2024-03-25 14:17:37 +01:00
IntegratedQuantum
b6cffba122 Some small UI improvements
Fixes #245
Fixes #262
Fixes #284
Fixes #285
2024-03-24 20:00:21 +01:00
IntegratedQuantum
16f0e4d37f Add stairs as a rotation mode and generate all 2⁸ possible stair models.
A step towards #69, still missing a more convenient way to produce stairs.
2024-03-23 23:46:32 +01:00
IntegratedQuantum
c321bd927c RotationModes can now change block data on neighbor updates. This allows connecting fences on placement.
Closes #68
There is still some remaining functionality from the java version that's not implemented, but things like collision detection should be performed on the model directly instead of the rotation mode.
2024-03-22 23:00:35 +01:00
IntegratedQuantum
0159b65e51 Remove the Permutation and generate all variants of the fence model.
Progess towards #68
2024-03-22 21:27:10 +01:00
IntegratedQuantum
e248d85e1c Rotated block placement 2024-03-21 10:48:50 +01:00
IntegratedQuantum
3c7bd89be5 Create the base fence model. 2024-03-20 21:56:53 +01:00
IntegratedQuantum
69e1fe2f15 Allow rotation modes to create rotated versions of given block models.
A step towards #68
2024-03-20 15:25:19 +01:00
IntegratedQuantum
899083569d Remove redundant window ids. They were asserted to be equal to the file name, now they are initialized to the file name, removing the need for setting it manually.
This makes adding new windows simpler, also affects #273.
2024-03-19 22:17:46 +01:00
IntegratedQuantum
4ea46a6cde Remove the permutation code from the vertex shader, improving performance by 1.5 ms ≈ 10%
The entire permutation stuff was a bad idea. It makes more sense to do these calculations during meshing, using pre-rotated models.
Closes #121
2024-03-19 20:22:15 +01:00
IntegratedQuantum
1f78bde24f Rework meshing to support arbitrary quad models. Add some X-shaped grass to demonstrate that this system works. 2024-03-19 16:28:11 +01:00
IntegratedQuantum
21f2ab084a Light data can now be sampled for arbitrary models. Also remove unnecessarily complex code in transparency sorting.
Again preparing for #134
2024-03-13 20:55:00 +01:00
IntegratedQuantum
a1ddb6755d Pass the texture instead of the block to the GPU.
The block doesn't need to be known for rendering, all the info is in the texture now.
This is another step towards arbitrary models #134
2024-03-12 21:38:38 +01:00
IntegratedQuantum
80a4d2d35a The fog data is now part of the texture.
This is not really optimal, as this doesn't ensure that all textures of a block have the same fog, but this is an important step towards not storing the block id on the GPU and additionally this allows changing the fog of a block in future resource packs.
2024-03-12 11:45:38 +01:00
IntegratedQuantum
a164ee6794 Revert "Use instanced rendering to allow for an unlimited number of faces per chunk (previously it was limited by the size of the index buffer)."
Instanced rendering caused a 3× slowdown on an intel iGPU.

This reverts commit 45422f8be7b158385486666bd951bbcaddc5eb7c.
2024-03-11 21:04:10 +01:00
IntegratedQuantum
a682169562 Add absorption textures - previously absorption was constant throughout the block. 2024-03-11 21:02:56 +01:00
IntegratedQuantum
45422f8be7 Use instanced rendering to allow for an unlimited number of faces per chunk (previously it was limited by the size of the index buffer). 2024-03-11 15:50:54 +01:00
IntegratedQuantum
c4e76d060c Make the biome-type tree more stable when adding new biomes.
fixes #158
2024-03-10 20:25:34 +01:00