feat: grass (#11)

* feat: add grass texture and update grass_block texture

* feat: add block data

* feat: add blocks_tool

* feat: add sync info and change function in blocks_tools

* feat: add check and new function

* refactor: make block texture loading data-driven

* feat: add rendering for grass

* feat: passable grass

* feat: random grass place

* fix: memory leak in TextureManager::load_cross_plane_texture
This commit is contained in:
zhenyan121
2026-05-28 21:34:36 +08:00
committed by GitHub
parent bbf8b4e969
commit 5901ab7cd9
47 changed files with 1193 additions and 210 deletions

View File

@@ -0,0 +1,6 @@
id = 0
is_cross_plane = false
is_liquid = false
is_passable = true
is_transparent = true
name = 'air'

View File

@@ -0,0 +1,6 @@
id = 2
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'dirt'

View File

@@ -0,0 +1,6 @@
id = 9
is_cross_plane = true
is_liquid = false
is_passable = true
is_transparent = true
name = 'grass'

View File

@@ -0,0 +1,6 @@
id = 1
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'grass_block'

View File

@@ -0,0 +1,6 @@
id = 6
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = true
name = 'leaf'

View File

@@ -0,0 +1,6 @@
id = 5
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'log'

View File

@@ -0,0 +1,6 @@
id = 4
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'sand'

View File

@@ -0,0 +1,6 @@
id = 8
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'snowy_grass_block'

View File

@@ -0,0 +1,6 @@
id = 3
is_cross_plane = false
is_liquid = false
is_passable = false
is_transparent = false
name = 'stone'

View File

@@ -0,0 +1,6 @@
name = "template"
id = 0
is_liquid = false
is_passable = false
is_cross_plane = false
is_transparent = false

View File

@@ -0,0 +1,6 @@
id = 7
is_cross_plane = false
is_liquid = true
is_passable = false
is_transparent = false
name = 'water'

View File

@@ -8,7 +8,7 @@ layout (binding = 0) uniform sampler2DArray samp;
void main(void) {
color = texture(samp, vec3(tc, tex_layer));
if (color.a < 0.5) {
if (color.a < 0.1) {
discard;
}
//color = varyingColor;

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B