Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPM grains - setting random point color and using color for meshing.

Message 1 of 4
485 Views, 3 Replies

MPM grains - setting random point color and using color for meshing.

Hi I am wondering if this is possible yet using the bifrost graph. I've set up a MPM snow which I'm semi happy with but am now struggling to use this to create any sort of usable mesh to render. Its a constantly emitting simulation which sort of makes a long tube of foam essentially. I would love to be able to map some procedural textures onto the mesh which of course is impossible without uvs.


So I have a little Houdini experience where I would give random color information on the points being emitted. Then during meshing, transfer the color and velocity information to vertex data for render.


I'm trying to find a workflow for this:

So on the source_mpm_snow. I can set an additional property "color" and animate it over time but I don't know how to target per particle and give each a random value.

I thought i could use a point_id post solve and base random values off the id but the mpm solve doesn't seem to have a point_id attribute I can see.


Then on the meshing, I was converting to volume and meshing the volume but I dont know how to transfer the point velocity or the color information form the points to the mesh.


Thanks to anyone with any insight. I am enjoying bifrost graph and exciting to use it more.


Message 2 of 4
in reply to: info

About transferring point properties to the mesh, both convert_to_volume and volume_to_mesh allow you to specify which properties to transfer via the properties input. On both nodes, this defaults to "*" which means all properties will be transferred. I just tested this, and e.g. point_velocity does get carried through all the way.


As for point_id in MPM, you can enable that on the mpm_solver_settings node ("Label Point Id"). Unfortunately, this property is not currently being carried through by volume_to_mesh. The reason is that point_id is an integer and integers cannot be interpolated. Perhaps we need to improve the behavior so that in cases where we encounter an integral type like int, we instead fetch the nearest voxel. I hope you can work around this limitation for now.

Message 3 of 4
in reply to: morten.bojsen-hansen

Thanks for replying and thanks for pointing those parts out to me. I tried to put it all together and I have something, it'd be great to improve the kind of random values it creates with some of the noise nodes but not sure how to use the ids instead of position to set the color.Screenshot 2021-01-08 220147.png


Message 4 of 4
in reply to: info

The noise nodes that take a position as input are meant to generate noise that varies smoothy over space, so if you feed something else in than a position you might get unexpected results. That said, nothing is preventing you from passing in any float3 you like. 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums