-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Particle Colors #277
Comments
Original thinking behind the particle system data class is to have arbitrary channels like colors, vorticities, texture coordinates, etc, so that the particle system can be as compact as possible if all these channels are not needed (i.e. have positions and velocities only). However, I can see the value of color channel being there by default (or at least toggle-able). Let's first add color channel to the system just like positions. Once we have something working that meets the need, we can then iterate on the design. |
Yes I also thought that having a system to attach arbitrary data to particles would be better. I am glad you brought this up. Since it felt wrong to add color as its own channel since it is not required data for the fluid simulation. I have it almost implemented but have no objections removing it in favour of a generalised system, since I would also like to add additional information to particles as well. Do you have part of this new system in place already in one of your other branches? |
@doyubkim I consider |
ParticleSystemData class already has full ability to add arbitrary/optional channel (see addScalarData/addVectorData). I would rather focus more how to make it interact with other modules such as the emitters and mesher For example, a particle emitter will generate pairs of position and velocity and append it to a particle system. If that particle system has other channels, new particles will have zero values for such an non-position/velocity channels. So what should be added to the code is an API to specify default values of an arbitrary channels from emitters (and then particle system data which emitter should communicate with). Mesher is actually more complicated and I don’t have good API design in my head yet. Ideally a mesher should take a particle system data with arbitrary channels, generate a mesh as well as interpolated channel values per vertices. That could be done by also making triangle mesh somewhat similar to a particle system data then we can not only handle colors, but also can handle any other channels that we couldn’t think of right now. Lastly, the actual algorithm that interpolates color (or any values) from particles to mesh needs to be implemented which I think is quite straightforward if SPH style interpolation is used. |
@doyubkim Are you consider this way? These variables is declared in
|
@utilForever Yes, something like that. We can also make the color channel optional by taking a boolean parameter from the ctor. While having a dedicate color channel is useful for many cases, it also impacts memory cost if it's turned on by default. |
I would like to add color information to the particles. This would also involve adding an initial color to the emitters.
@doyubkim Are you in favour of this, or should I look for an alternative way of implementing it so that it is external to the Jet Framework? I don't want to break away from the main branch so any changes I make to the Jet Framework I would like to be integrated, if approved, otherwise I will look for an external approach.
The text was updated successfully, but these errors were encountered: