mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-26 05:38:20 -06:00
hopefully fix trans rendering bug
This commit is contained in:
parent
80abfc2768
commit
338f11afc6
|
@ -76,7 +76,7 @@ pub fn draw_world(
|
||||||
let world_position = position.as_vec3() * CHUNK_SIZE as f32;
|
let world_position = position.as_vec3() * CHUNK_SIZE as f32;
|
||||||
|
|
||||||
//Skip mesh if its empty
|
//Skip mesh if its empty
|
||||||
if mesh.index_buffer.len() == 0 {
|
if mesh.index_buffer.len() == 0 && mesh.trans_index_buffer.len() == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,19 +90,21 @@ pub fn draw_world(
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw chunk mesh
|
//Draw chunk mesh
|
||||||
target.0.draw(
|
if mesh.index_buffer.len() > 0 {
|
||||||
&mesh.vertex_buffer,
|
target.0.draw(
|
||||||
&mesh.index_buffer,
|
&mesh.vertex_buffer,
|
||||||
&program.0,
|
&mesh.index_buffer,
|
||||||
&uniform! {
|
&program.0,
|
||||||
position_offset: world_position.to_array(),
|
&uniform! {
|
||||||
view: view,
|
position_offset: world_position.to_array(),
|
||||||
perspective: perspective,
|
view: view,
|
||||||
tex: texture_sampler,
|
perspective: perspective,
|
||||||
discard_alpha: true,
|
tex: texture_sampler,
|
||||||
},
|
discard_alpha: true,
|
||||||
&draw_parameters
|
},
|
||||||
).unwrap();
|
&draw_parameters
|
||||||
|
).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
if mesh.trans_index_buffer.len() > 0 {
|
if mesh.trans_index_buffer.len() > 0 {
|
||||||
enqueue_trans.push((chunk, mesh));
|
enqueue_trans.push((chunk, mesh));
|
||||||
|
|
Loading…
Reference in a new issue