Jump to content

Fluid with colour field problems


JaydenDP

Recommended Posts

Hi!

I'm having issues adding a Cd field to my fluid sim. I have the Cd field being generated in SOPS fine, it updates every frame.

When I use sop vector field to add it to DOPS and gas advect it works fine and I get colour in my sim, being advected by the simulation.

HOWEVER!..It only adds the colour to the volume at the first step, then continues to pump out black smoke. So I thought fine, just change the SopVectorField to "Set Always"...nope, stops advecting completely because it completely replaces the colour every frame.

I'm confuzzled :S Any advise or ideas would be much appreciated.

Hip file attached.

Thanks in advance

Jay

Link to comment
Share on other sites

you need 2 fields

1) Cd - to advect by vel field (accumulated colour values)

2) Cdsrc - fetch new data from sops every time/

use gas calculate for example to get Cd += Cdsrc and then advect Cd

Works a charm!

Thanks!

Link to comment
Share on other sites

spoke too soon :( isn't doing quite what I was expecting...

If I add the fields together it gets very bright and mixes almost immediately.

Trying some other options gets some interesting results but I think I missed something fundamental here...any ideas?

Link to comment
Share on other sites

spoke too soon :( isn't doing quite what I was expecting...

If I add the fields together it gets very bright and mixes almost immediately.

Trying some other options gets some interesting results but I think I missed something fundamental here...any ideas?

Like this, it shouldn't be going black!

ColourFluidTest.mov

Link to comment
Share on other sites

Actually, I can stop it from going black, but then it keeps getting brighter and brighter, and very washed out, the coloured area's don't keep their distinct colours,.

Maybe it the dissipation of this field I should be worried about...

Edited by JaydenDP
Link to comment
Share on other sites

Hi, any ideas for a better way to get this working would be great. I'll attach my HIP below.

At the moment it works to some extent, but the colour becomes very diffused and I have to remap the range in the Vis between 0 and 20 just to stop it from burning out.

This doesn't seem ideal to me and my goal would be for it to keep a sharp advection of that colour field where it doesn't constantly add and get brighter. This is a tricky problem for me :(

I think i'm missing something in the gas calculate step?

Thanks for the help so far

Jay

FluidWithColor_v2.hip

Link to comment
Share on other sites

you can source the colors in the same way you do for density avoiding using gas calculate in DOP.

FluidWithColorFix_v2.hip

hope it helps.

Yeah thanks, that's a bit simpler doing it like that!

Unfortunately it still doesnt fix the additive problem where the fluid almost immediately blends the colours and gets really bright. Is there no other way to deal with that except for remapping in the shader over time?

Thanks again,

Jay

Link to comment
Share on other sites

ARG! it doesnt work! I'm going to cry...

Just tried it in my proper setup and seems in my test scene i was lucky because of the wind. If the source is constantly near the fluid it will still keep getting brighter and brighter!

I need it to only add a limited amount of colour if the volume already has the correct values. This is futile :(

Link to comment
Share on other sites

Did you try the various options in the Source Volume DOP?

In the Volume Operation tab, you will find the various options for how to add the fluid for the three sources, two floats and one vector source (called Velocity but I now wish it was named Vector Field...). The Vector source is used to add the Cd vector volumes from SOPs in to the Cd vector field in the DOP simulation.

If you have "Add" as the Volume operation, then you will be pouring in Cd on every timestep with no bounds what so ever.

There are other options you can try.

Copy completely overwrites the Cd field on every timestep. Not what you want.

Try out the other options for interests sake but I think that Blended Average at the default settings might be what you want.

Carefully inspect what you said. You mentioned that if the fluid moves very slowly, then the Cd is accumulating too much. In other words, if the velocity is very small around the region of emission, you don't want that much Cd to be emitted. This is essentially what Blended Average does. It takes the vector attribute (Cd in this case) around the emission area and based on the weighting, will add more Cd until the settings are reached.

---

If you are interested, dive inside the Source Volume DOP and have a look at the micro-solvers used to manage the addition of the vector fields. The nodes are in the upper right hand side of the network. You'll see that inside the vel part of the network, temporary fields are created to do the mixing in of the velocity depending on which option you choose. You can also see the mask field which is used to multiply the vector emission rate.

Ultimately you can unlock the Source Volume DOP and hack away inside it until you get what you want. Then make a version of this asset and offer it to the community if you develop a novel way to source Cd in to the simulation.

Hope this helps.

Link to comment
Share on other sites

Did you try the various options in the Source Volume DOP?

In the Volume Operation tab, you will find the various options for how to add the fluid for the three sources, two floats and one vector source (called Velocity but I now wish it was named Vector Field...). The Vector source is used to add the Cd vector volumes from SOPs in to the Cd vector field in the DOP simulation.

If you have "Add" as the Volume operation, then you will be pouring in Cd on every timestep with no bounds what so ever.

There are other options you can try.

Copy completely overwrites the Cd field on every timestep. Not what you want.

Try out the other options for interests sake but I think that Blended Average at the default settings might be what you want.

Carefully inspect what you said. You mentioned that if the fluid moves very slowly, then the Cd is accumulating too much. In other words, if the velocity is very small around the region of emission, you don't want that much Cd to be emitted. This is essentially what Blended Average does. It takes the vector attribute (Cd in this case) around the emission area and based on the weighting, will add more Cd until the settings are reached.

---

If you are interested, dive inside the Source Volume DOP and have a look at the micro-solvers used to manage the addition of the vector fields. The nodes are in the upper right hand side of the network. You'll see that inside the vel part of the network, temporary fields are created to do the mixing in of the velocity depending on which option you choose. You can also see the mask field which is used to multiply the vector emission rate.

Ultimately you can unlock the Source Volume DOP and hack away inside it until you get what you want. Then make a version of this asset and offer it to the community if you develop a novel way to source Cd in to the simulation.

Hope this helps.

Yeah I have been trying to find good setting with the Source Volume DOP, I do run through everything I know I want to get before asking on here as a last resort.

Unfortunately none of that is giving me what I want, but maybe, as you say, if I try hacking the micro solvers of the source for a while I might find an interesting way to add it, here hoping!

Thanks for your suggestions

Jay

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...