Add the new prop job setup to all 4 (3) VoxelWorlds.

This commit is contained in:
Relintai 2022-02-09 13:34:24 +01:00
parent 08be795296
commit 9ee54a48c4
4 changed files with 88 additions and 0 deletions

View File

@ -76,6 +76,28 @@ Ref<VoxelChunk> VoxelWorldBlocky::_create_chunk(int x, int y, int z, Ref<VoxelCh
pj.INSTANCE(); pj.INSTANCE();
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherBlocky))); pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherBlocky)));
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_NORMAL);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_MERGE_VERTS);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_BAKE_TEXTURE);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_SIMPLIFY_MESH);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> fqms;
fqms.instance();
s->set_fqms(fqms);
s->set_simplification_steps(2);
#endif
pj->add_jobs_step(s);
chunk->job_add(lj); chunk->job_add(lj);
chunk->job_add(tj); chunk->job_add(tj);
chunk->job_add(pj); chunk->job_add(pj);

View File

@ -77,6 +77,28 @@ Ref<VoxelChunk> VoxelWorldCubic::_create_chunk(int x, int y, int z, Ref<VoxelChu
pj.INSTANCE(); pj.INSTANCE();
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherCubic))); pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherCubic)));
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_NORMAL);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_MERGE_VERTS);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_BAKE_TEXTURE);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_SIMPLIFY_MESH);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> fqms;
fqms.instance();
s->set_fqms(fqms);
s->set_simplification_steps(2);
#endif
pj->add_jobs_step(s);
chunk->job_add(lj); chunk->job_add(lj);
chunk->job_add(tj); chunk->job_add(tj);
chunk->job_add(pj); chunk->job_add(pj);

View File

@ -221,6 +221,28 @@ Ref<VoxelChunk> VoxelWorldDefault::_create_chunk(int x, int y, int z, Ref<VoxelC
pj.instance(); pj.instance();
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherDefault))); pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherDefault)));
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_NORMAL);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_MERGE_VERTS);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_BAKE_TEXTURE);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_SIMPLIFY_MESH);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> fqms;
fqms.instance();
s->set_fqms(fqms);
s->set_simplification_steps(2);
#endif
pj->add_jobs_step(s);
// Order matters! // Order matters!
chunk->job_add(lj); chunk->job_add(lj);
chunk->job_add(tj); chunk->job_add(tj);

View File

@ -78,6 +78,28 @@ Ref<VoxelChunk> VoxelWorldMarchingCubes::_create_chunk(int x, int y, int z, Ref<
pj.INSTANCE(); pj.INSTANCE();
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherMarchingCubes))); pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherMarchingCubes)));
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_NORMAL);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_MERGE_VERTS);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_BAKE_TEXTURE);
pj->add_jobs_step(s);
s.instance();
s->set_job_type(VoxelMesherJobStep::TYPE_SIMPLIFY_MESH);
#ifdef MESH_UTILS_PRESENT
Ref<FastQuadraticMeshSimplifier> fqms;
fqms.instance();
s->set_fqms(fqms);
s->set_simplification_steps(2);
#endif
pj->add_jobs_step(s);
chunk->job_add(lj); chunk->job_add(lj);
chunk->job_add(tj); chunk->job_add(tj);
chunk->job_add(pj); chunk->job_add(pj);