something really @simple@ but not having any luck at work, trying to help colleague get a KCM_Density which controls density of particles and lets us animate these values (not possible in the master UI)
i am thinking that the final density is multiplied by the density exponent, so if i have a working render at final: 5 , exponent: -9
i am assuming the final density is calculated by multiplying 5 times ( 10 to the -9 power), which should be something like 5e-9
however when trying to make a simple kcm this formula does not work, i have one float1 as final density, multiplied by another value, which is float2 to the power of float3,
but this does not give same result, i also tried putting global density to 1 and 0, so that it would be 1 (since kcm densitys are still multiplied by overall master density)
but had no luck,
we would like a kcm_density which gives us same result as the master UI, so if master ui is 5 and -9 how can i get this same result in a KCM (and putting master UI to a default number)
Your KMF is missing the “Density Input Channel” multiplied by the rest of your flow.
If you have a PRT Volume, a PRT FumeFX or a PRT Loader where the Density is not 1.0, your particles will come in with a non-1.0 value and rendering with the Global Density multiplier will modify THAT value.
In your KMF, you overwrite the density with the assumption that the Density channel contains 1.0.
For example, if I create a PRT Volume from a Teapot and set it to 1 Subdivision to give me around 750K particles, rendering with Global Density of 5/-2 produces the same result as a KCM which multiplies the Density by 5.0 * (10^-2) and outputs as Density while Global Density is set to 1.0/0.
But if I load your KMF, the original Density is not respected and I get much higher values.
This is because the PRT Volume is tweaking the per-particle density to produce the same overall density per cubic unit regardless of the number of particles you generated in the voxel. Thus increasing the number of particles per region using the “Multiple per Region” option in the PRT Volume will produce more particles, but with lower Density stored in each particle.
If I open the Particle Data Viewer and look at a default PRT Volume with Spacing set to 1.0, each particle has a Density of 1.0 (in this case, your KMF would work).
If I check the Subdivide Region and set Subdivisions to 1, PDV shows each particle with a Density of 0.125 (1/8th of the original density, because one subdiv. produces 2x2x2 sub-regions in the voxel).
If I uncheck the Subdivide Region but reduce the Spacing to 0.5, I get the same 0.125 because now there will be 8 particles per cubic unit instead of just one.
If I set the Spacing back to 1.0 but check “Multiple Per Region” and enter 10 in the Count field, I now get Density of 0.1 because there are 10 particles per cubic unit and so on…
So you should not assume that the density per particle is always 1.0, because most PRT objects that come with Krakatoa tweak the Density channel to preserve spatial consistency… kcm_density_bobo.zip (641 Bytes)
i did realize the global density is multiplied by the local KCM density, but did not realize the prt objects came with its own density as well,
i did not assume density is automatically 1.0, which is why i set global density to 1.0 and exponen 0, that should give me 0 right?
and with that setting i tried that kcm, but still did not get same result
even now, this new kcm is better, but i guess i wanted a kcm that gives me same result as i got in the global UI (when set to 1),
but since i will never get same result as global ui values have, i just get input density multiplied by scalar going out, that is easiest way to animate density i think
Wrong, it is 1, not 0. Exponent of 0 means 10^0 = 1. Times 1.0 is still 1.0.
I have no idea what you are doing, but it works perfectly well for me.
The Global Density Multiplier takes what is coming from the particles and scales it. So it should be 1.0/0 to be neutral.
If you set the KCM to exactly the same values you had in the Global Density previously, it should produce 100% the same look.
Remember that there are a bunch of other factors affecting Density, including Material Opacity, Visibility track etc.
So if you wanted to animate the Density of a PRT object, you could just keyframe its Visibility track between 0.0 and 1.0 (or even beyond that) to scale its particles Density without changing the Global Density multiplier… Or keyframe its material Opacity. Or even add an animated gradient map to wipe it out… gradually.
when i have global final desnsity at 1 exponent 0, equaling together 1, then theoretically i should have same result with the kcm_density at 5, -9, but it was not same result when i had these,
but yes there are other factors as you said how density is determined, i think best thing is just to have input density multiplied by a float, and that works…
With an extremely low value like this, you might need to use a higher precision for the Output channel, like Density float32[1] or float64[1]. It defaults to float16[1], which might not be enough to represent 9 decimal places… I haven’t tested that (since it is close to 0 and I would need a billion particles to see them), but it is worth trying.
If I were you, I would have tested with less particles and higher Density like 1.0/-3 or something reasonable like that to make sure it is producing the exact same result before going down to the cellar with the values…