Community
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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

create weightmap based on proximity

25 REPLIES 25
SOLVED
Reply
Message 1 of 26
userX4542
4798 Views, 25 Replies

create weightmap based on proximity

Hey,

I would like to create a weightmap based on the proximity between two objects (closest location). The closer the objects are to eachother, the higher the values should be.

 

I tried following the transfer CPV data tutorial on youtube and downloaded the compound but it doesnt seem to work for me. No colours appear. Also, I don't want to transfer colorset data, I just want to create it. 

Ultimately I would like this to be live and usuable in a shader network. 

Thanks!

25 REPLIES 25
Message 2 of 26
mjcg91
in reply to: userX4542

You first need to get the closest location from one mesh to another, then subtract the source position with the sampled position, and get the length from these vectors. From there you can manipulate the result data to fit your needs.

 

color_by_distance.gifcolor_by_distance.jpg

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 26
userX4542
in reply to: mjcg91

Thank you!

That's exactly what I need. Makes perfect sense. Would you be able to share the scene/compound? I have recreated it but not getting the same result. I'm probably missing the correct values and property names. 

 

**edit**

 

Never mind, I got it working. Thanks a bunch!

Message 4 of 26
Anonymous
in reply to: userX4542

hi! would you be able to share your version? Is speed acceptable for larger meshes? (50-100k polys) Thanks!

Message 5 of 26
alfosici
in reply to: Anonymous

For everyone that had an issue with the compound from the image above not working :

 

You need to change the value node connected to the sample_proprety default port, to a float3 before connecting sampled_data to the subtract node.

 

my settings so far are :

- sample_property is set to from closest

-either make sure you have a big enough cutOff distance on the get_closest_locations, or simply turn it off

-on the change_range, 0-3, 0-1 , with from_end (at 3) is giving more falloff distance in my scene

-set_geo_property i have propriety = color , set at 1 , 1 , 1 

 

hope it helps.

 

 

Message 6 of 26
darioOrtisi
in reply to: alfosici

There is a way to save the map generated to a file\texture or file\texture sequence?

Message 7 of 26

Interesting....what I am asking myself is, if there is a way to color MPM Particles this way, based on proximity to a Mesh??

 

I am struggling to get is working with Voxel Positions.

 

regards,

Stefan 

Message 8 of 26

I managed to color MPM Points but I wonder if there is a better way to do it. 

 

I created a emitter mesh and a geo for coloring like described above. Everything works fine. 

Then I color the MPM Points by the color of the emitter mesh. 

I can share my compound later on, when I finished my setup to my likings.

 

It would be very good if there are more prebuilt options for coloring or adjusting particles, mpm particles, cloth or fluids by things like properties (velocity, age, distance to objects, etc...)

Message 9 of 26
jalixko
in reply to: alfosici

I am trying to replicate this bifg but it seems I am doing something wrong.

Capture.JPG

I get an error message about type data "no promotion exist from a value of type Animo::Object type  to a value of type Array::math_float3"

Any idea?

 

Message 10 of 26
TasticAd
in reply to: jalixko

@jalixko, to begin with you should replug to a blank output. Best practice is to always plug it lastly 🙂

Message 11 of 26
TasticAd
in reply to: mjcg91

Thank you so much for this solution MJ.

 

Now would there be a way to keep the color on its highest value once the sphere goes aways..? 🤔

 

In other words to draw on the plane with the sphere?

Message 12 of 26
mjcg91
in reply to: TasticAd

There you go !

The same setup, with an additional compound using a feedback port. If the current value is greater than the last one, It will be saved in the feedback port.

paint_with_mesh.gif

 

 

I attached a sample scene, you can adapt it as you wish.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 13 of 26
TasticAd
in reply to: mjcg91

Haha this is great! Thank you so much MJ for this little compound, love the math behind it 😄

 

 

Message 14 of 26
jalixko
in reply to: TasticAd

Thanks all.

I´ll have a look to all carefully.

 

Message 15 of 26
absoluteKelvin
in reply to: userX4542

can more the one influence mesh be added to get_closest_location ?

https://www.artstation.com/kelvintam
Message 16 of 26
absoluteKelvin
in reply to: userX4542

i figured it out. Just had to drag all the mesh into the graph. and then pipe it into a merge_geometry node and replace the connections.

https://www.artstation.com/kelvintam
Message 17 of 26
happyip12
in reply to: userX4542

Hi everyone!

I've been studying the graph, and I am wondering could this be used as the start setup of a dynamic trigger like

when a foot touches the ground, it triggers ground dust particles? How would you setup something like that in the graph?

I just started learning about bifrost graph and I am learning a lot from the forum posts 🙂

Message 18 of 26
darioOrtisi
in reply to: userX4542

Hi @mjcg91 

There is a way to change the color to a vector map value? I will like to use to paint and get this data as vector map for vector flow. As long as I can

Message 19 of 26
darioOrtisi
in reply to: userX4542

I'm trying to use a curve instead of a mesh. There is a way to do it, because it seem not work with a curve.

Message 20 of 26
darioOrtisi
in reply to: userX4542

Ok, i got it

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

Post to forums  

Autodesk Design & Make Report