Open PavelBlend opened 5 years ago
This feature is not available at the moment but sounds like a good addition. Will add to the feature list!
It turned out to blender means to implement the painting of the mesh:
I implemented the mesh color using Vertex Colors. Because of this, the transition between colors looks stepwise. Perhaps the color of the mesh can be realized using textures and UV coordinates? Each particle source will have texture coordinates that will be transmitted to the particles.
Thanks for the experiment! Yes, I think that’s a good idea. Let me try letting particles to sample texture coordinates from an input mesh and carry the values throughout simulations.
I would also like to be able to set the color of particles and also grid cells. Have the colors of cells advected throughout the domain. I am happy to set the colours myself, I don't need any sampling from textures done by the framework itself.
It would also be nice to set the color for the emitted particles as a parameter to the emitters, just set a Vector3D(red, green, blue) between 1-0.
The emitters could also have a callback to let us set the sample colors ourselves. Similar to the way addTarget works, but let us specify the color of each particle based on its location. I could then sample volumes and textures within Cinema 4D to set the colors myself.
I'll take a look this weekend.
Are you want to add feature for setting the color of particles and grid cells?
Only particles are really required.
Hi @utilForever, just wondering if you have added color support for particles yet? If not then I may start on it myself. I won't be worrying about LevelSetSolver for now and will just add support throughout for setting a color for particle emitters and having that data stored for each individual particle in the ParticleSystemData.
@utilForever I decided to start with this. Looks simple enough to add. So if your not working on this yet then do let me know, otherwise I could submit my own changes for a pull request.
Actually I think what I am doing is not part of this particular Issue. Since what I am doing is adding colors directly to the Jet Framework and this issue is about using particle colors to set the vertex colors of a mesh, these are two different topics although they are related. I am going to open a new issue for this.
@kentbarber @utilForever Here's what I was envisioning for this feature:
For the particle-based solvers, add additional channel (color channel) to ParticleSystemData3
. After performing mesh generation using marching cubes, enumerate over the mesh vertices, "interpolate" colors around the vertices using SPH-style interapolation and/or nearest neighbor approach (maybe have an option to pick one). Then the colored mesh could be achieved.
For the grid-based solvers, add color channel to GridSystemData3
, make them "advectable", and when performing marching cubes, directly interpolate color values from the grid which now has color channel.
@kentbarber if you are already working on the particles, then please feel free to post a PR! We can discuss from there.
@kentbarber Oh, I'm sorry. I've been very busy with my company. Are you started implementation? If you not working on this yet, I'd like to start next week. p.s. I'm working on many projects such as RosettaStone. Thank you for reminding me.
@utilForever Yes I have started adding support for particles, but it is still under discussion. I have opened a new issue for adding color information to particles: https://github.com/doyubkim/fluid-engine-dev/issues/277#issuecomment-562773481
I haven't touched GridSystemData3 yet, so if you would like to do that then feel free. I would consider it to be a separate task and perhaps could be its own issue as well.
Then once color has been added to both of the above, this particular issue could be used to track the interpolation task for creating the color for the generated mesh.
@kentbarber Hmm... If you haven't started implementing the code yet, I'd like to work on both.
I think that since color data is not essential, it would be good to provide additional data as an extension such as std::optional
or new design.
@utilForever That is ok with me. I will hold off on any further work in the Jet Framework itself and will instead get my code ready to create and use the color data once it is in place. I would prefer the ability to add arbitrary data to the system, with color being one of them, so a more general case system that is usable throughout Jet would be a better solution. Thanks.
@kentbarber Thank you for your consideration. I'll discuss this design on #277.
Hello.
I have particles that have color: Is it possible to transfer these colors to the mesh of a liquid?