File tree Expand file tree Collapse file tree
crates/processing_render/src/particles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ struct MeshCullingData {
1717 aabb_center : vec3 <f32 >,
1818 _pad : f32 ,
1919 aabb_half_extents : vec3 <f32 >,
20- dead : f32 ,
20+ // > 0.0 = render, <= 0.0 = skip in preprocessing.
21+ life : f32 ,
2122}
2223
2324struct PackParams {
@@ -106,8 +107,9 @@ fn pack(@builtin(global_invocation_id) gid: vec3<u32>) {
106107 mesh_culling_buffer [slot ]. aabb_center = vec3 <f32 >(0 .0 , 0 .0 , 0 .0 );
107108 mesh_culling_buffer [slot ]. aabb_half_extents = vec3 <f32 >(1 .0 , 1 .0 , 1 .0 );
108109#ifdef HAS_DEAD
109- mesh_culling_buffer [slot ]. dead = dead [i ];
110+ // dead[i]: 0.0 = alive, nonzero = dead -> life > 0.0 renders.
111+ mesh_culling_buffer [slot ]. life = select (1 .0 , 0 .0 , dead [i ] != 0 .0 );
110112#else
111- mesh_culling_buffer [slot ]. dead = 0 .0 ;
113+ mesh_culling_buffer [slot ]. life = 1 .0 ;
112114#endif
113115}
You can’t perform that action at this time.
0 commit comments