field magma test

Playing around using a animated noise map in with field magma .not sure if this is the best way to work with textures but it seems to work. Not sure what the density does does that also affect the field or is that just for visual reference.


fieldmagma.mp4 (1.21 MB)

Your flow is valid and can be used as is. You are using the gradient of the magnitude of the texture’s color. The alternative would be to use the RGB of the texture by scaling it up by 2 and subtracting from [1,1,1] to produce vectors between [-1,-1,-1] and [1,1,1]. But the results would look significantly different. The R would represent X where 0.0 would mean -1 and 1.0 would represent 1.0, with G and B defining Y and Z…

The Density is not necessary for driving Stoke Particle simulations, but it is good for visualizing (filtering out only samples where the Density is positive), or for converting a field to particles via PRT Field if you intend to render the field in Krakatoa…

I have an issue with this now where the particles are clumping around the force lines.

youtube.com/watch?v=h2tfuBcoYjA#t=145

In this video you solve that by check box for divergence free. Is it possible to add that into this flow.

There are several ways to achieve this:

*When using Stoke Field Magma object (History-Independent), just add a SimpleFluid operator before the Velocity channel output.
*Alternatively, drop a Stoke Fluid Motion modifier on top of the Field Magma object. This has the benefit of being represented on the modifier stack, letting you easily switch it on and off. (Note that you could expose the On/Off toggle of the SimpleFluid node above to achieve a similar level of control).
*When using a Stoke Field Simulator (History-Dependent), there is a drop-down list in the UI that specifies the fluid solver. It defaults to “Simple Fluid Solver” which removes the Divergence automatically. This is equivalent to what you saw in the Ember video - Ember had only a HD simulator and no modifier options, but it did have the SimpleFluid node in Magma. You can use the SimpleFluid node in the flow instead of the “Simple Fluid Solver” option if you want the divergence-free solve to be part of the node logic and not part of the simulation itself. In that case, you can switch the simulator to “No Fluid Solver”.

Thanks, that works but what if you wanted some clumping, adding that Stoke Fluid Motion modifier seems to have reduced the effect of the field quite a bit.

You could try blending two fields - one divergence-free and one not.

EDIT: I just tested it: Created a Noise field, passed it to a Blend operator, passed the SimpleFluid divergence-free version of the same field into the second socket, added a Float input and clamped it between 0.0 and 1.0. Then I exposed that Float in the UI and could slowly blend between the original velocity field and the fully divergence-free version by changing (or animating) the value between 0.0 and 1.0. You could of course control the blend factor per sample with another field, for example a texture or a node distance gradient to have the fluid behavior in some areas and not in others…

Here are two example scenes - the one blends a Noise Field with its Divergence-free version over time, the other in space (inside a spherical region it is divergence-free, outside it isn’t!)

Note that these were made with Stoke Pre-Beta 2, I hope they will operate as expected in Beta 1.
STK2_FluidBlending_Examples_v001.zip (45.3 KB)

HI I am getting this error now when I try to edit the magma flow in the stoke field. I thought it was specific to these files that you sent me, but even in a blank scene if I make a stoke field and click on Open Magma Editor I get this msg.

BTW that works really well blending the fields like that and Thanks for making those files :smiley: .

You must be running a wrong version of the MagmaScematicControl.ms script.
“EmberSchematicFlow” was renamed to “StokeSchematicControl” in Beta 2.
That file was missing in Beta 1 and I posted an extra copy for Beta 1, but you may not use that in Beta 2.

Please reinstall Beta 2 and try again.

The content of the file is only one line:

		StokeSchematicControl hc "" width:800 height:600 pos:[0,0] 

Thanks that was it. Wonder why that happened.