Density in glsl

hello,

I’m trying to recreate this fluid simulation in POPs.

I’ve encountered a few bugs which are all in this test file
calcdensity.toe (9.8 KB)
1. Constant Rounding Error?
when using a constant value to have an input to the radius a value is only returned when uSmoothingRadius is >= the “radius” of the box

When i investigate the intermediate values it would appear that they shouldn’t go to 0 yet and if i write uSmoothingRadius out it is in fact either 0 or 1.

2. Math Mix after glsl broken
I can get around that by leaving radius as an actual value in the glsl code but my influence value seems to have unexpected effects. I would expect a simple scalar multiplication on N to scale but the value it outputs turns to garbage.

I fear somehow that I am clobbering the indices and my actual data vs. what my POPto shows me are garbage… ?
3. attempts at GLSL advanced
these glsl advanced objects are more of the same manipulation but with more or less the exact same output.

Curious to see what I may be doing wrong here or if fundamentally I can’t accomlish this which I would be surprised by based off some of the other glsl examples I have been working from

I also tried only writing to the ID of the current index which didn’t change anything
onlywritetoID.toe (4.7 KB)

BUT

If i use a math and write the influence value to a new attribute I am able to use it without clobbering any of my other attributes
writeOutBeforeUsing.toe (4.7 KB)

yayyyy I can move forward now lol

y’all im actually so dumb. i had to use the vectors tab rather than the constants tab…