ageller / Firefly

A WebGL interactive particle viewer
GNU Affero General Public License v3.0
64 stars 12 forks source link

'disabled' particles are visible #83

Closed agurvich closed 2 years ago

agurvich commented 2 years ago

So this one is definitely wonky. I got into this situation by having both the gas and stars colormapped. Then I was fiddling with the filters for the stars, then I clicked playback and let it do its thing for a while. then i disabled playback, then i clicked invert filter, and then I turned off the star particle group. As you can see, only the preivously visible right before I clicked the button to turn off are displaying so something about them is different from the filter. Only realizing it as I'm typing it out now, interesting...

When I minimized the controls the icon was there but then when I clicked on it again to expand it disappeared!

Whether we can reproduce this or not, I think this could be related to why the m1 is taking such a performance hit when we zoom out... it seems like even setting the sizes and alphas to 0 it's still trying to render those particles. I think the depth and blending might have something to do with it as well....

image
agurvich commented 2 years ago

it looks cool though, kind of like a black hole accretion disk or something

agurvich commented 2 years ago

looking at the geometry arrays, while i still have it open,

viewerParams.partsMesh.PartType4[0].geometry.attributes.alpha.array.includes(1) -> true

while viewerParams.partsMesh.PartType4[0].geometry.attributes.radiusScale.array.includes(1) -> false

So somehow the alphas aren't getting updated for this subset of particles. Really hoping that this will lead to an m1 performance fix as I keep digging... 🤞🏻

agurvich commented 2 years ago

using filter x > 0.1 instead of includes for the radiusScale array returns an empty array, so no worries about includes(1) not hitting because of floating point precision or something

agurvich commented 2 years ago

why are they black though... we don't change the color ever... and if we did b.c. we were zeroing them out then surely that would hit the alpha as well....

agurvich commented 2 years ago

turns out the issue is with filter + radius scale + colormap. fixed it by moving update_particle_mesh_radius_variable into update_particle_mesh_filter.