Skip to content

Commit

Permalink
BISTRO WORKS
Browse files Browse the repository at this point in the history
  • Loading branch information
Honeybunch committed Nov 20, 2024
1 parent 81892ab commit 22a2a7d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/tb_depth_two.slangm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void mesh(uint32_t gtid: SV_GroupThreadID, uint32_t gid: SV_GroupID,
SetMeshOutputCounts(meshlet.vert_count, meshlet.prim_count);

if (gtid < meshlet.vert_count) {
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid);
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid) + draw.vertex_offset;

int3 local_pos =
tb_vert_get_local_pos(draw.perm, idx, mesh_idx, pos_buffers);
Expand Down
2 changes: 1 addition & 1 deletion source/tb_gltf_two.slangm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void mesh(uint32_t gtid: SV_GroupThreadID, uint32_t gid: SV_GroupID,
SetMeshOutputCounts(meshlet.vert_count, meshlet.prim_count);

if (gtid < meshlet.vert_count) {
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid);
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid) + draw.vertex_offset;

int3 local_pos =
tb_vert_get_local_pos(draw.perm, idx, mesh_idx, pos_buffers);
Expand Down
5 changes: 0 additions & 5 deletions source/tb_mesh_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,6 @@ TbMeshData tb_load_gltf_mesh(TbRenderSystem *rnd_sys,
}
}

// Offset all meshlet vertices by the primitive
TB_DYN_ARR_FOREACH(meshlet_verts, i) {
TB_DYN_ARR_AT(meshlet_verts, i) += prim_vert_offset;
}

// Because meshlets are packed, primitive offsets are actually off by a
// factor of 3; they point to an offset of triangle indices when we need
// them to be an offset to triangles
Expand Down
2 changes: 1 addition & 1 deletion source/tb_opaque_prepass_two.slangm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void mesh(uint32_t gtid: SV_GroupThreadID, uint32_t gid: SV_GroupID,
SetMeshOutputCounts(meshlet.vert_count, meshlet.prim_count);

if (gtid < meshlet.vert_count) {
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid);
uint32_t idx = tb_get_meshlet_vertex(meshlet_verts[mesh_idx], meshlet, gtid) + draw.vertex_offset;

int3 local_pos =
tb_vert_get_local_pos(draw.perm, idx, mesh_idx, pos_buffers);
Expand Down
4 changes: 2 additions & 2 deletions viewer/assets/originals/simple.blend
Git LFS file not shown
4 changes: 2 additions & 2 deletions viewer/assets/scenes/simple.glb
Git LFS file not shown

0 comments on commit 22a2a7d

Please sign in to comment.