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: 

Trouble exporting bifrost density channel

Message 1 of 11
1263 Views, 10 Replies

Trouble exporting bifrost density channel

Hey I'm currently making a sea bifrost sim with foam. I would like to be able to control the opacity of my foam based on its density channel.

I have set my bifrost shape node to export density, velocity and vorticity. However on export the only channels available are the latter... Density doesn't seem to appear in my color set editor when I check my cached out mesh.


I created a user data float node and plugged it into an aiflat and then set the attribute of the data node to "bifrost_density". However, the render comes out black since the density doesn't seem to exist, as previously mentioned.


I can force density to appear, by making a new color set named "bifrost_density", but this results in it rendering with an equal value of 1 throughout the entire meshed liquid and doesn't seem to be taking the values from the sim...


Does anyone know how I can export density? I've followed the documentation closely and I'm pulling out my hair here trying to work out why it's not working!!!



Message 2 of 11
in reply to: cowlishaw1988

talked to dev about this today and they reminded me that density is uniform throughout each emitter_prop node. So if your simulation has 1 emission source (bifrostEmitterProp) then that holds the density value (default 1000) which once again is uniform. In order to use the density channel you would need more than 1 emitterProp nodes with differing density values, this however probably won't work in your case.


Perhaps what you could use is vorticity, churn, or curvature channels to direct your foam.

Message 3 of 11
in reply to: syracoj

Hmm very interesting. The reason I mentioned density is because several videos online explain to use density to control your foams opacity...

I guess I could use some of the other channels but surely how dense the foam is would be the best channel to use...


Thanks for your help however I will give it a go before accepting as a solution.


Since you are here at the moment would it be possible to ask another question quickly?


When converting my foam to a mesh, I'm finding the mesh to come out very blobby even at low master voxel scales... (0.04) I have also played with the meshing options and increased the the resolution factor, droplets come out perfectly round and too large.


Is the only option here to render the foam as particles instead of a mesh or is there something I'm missing? When as particles it seems to look far more detailed and as a mesh it just looks bad...

Thanks in advance!

Message 4 of 11
in reply to: cowlishaw1988

yes, there is a Channel dropdown on the Foam shape (under the bifrostLiquid1 container after foam has been added to the sim) that enables one to control the opacity of the foam based off of density, but this I believe is the density of the foam, not the liquids. 


I am unsure if we mesh the foam if it will embed a foam density channel that can be accessible from a colorset/aiUserData node workflow for further post modification. Will try a few things on my side and possibly ask around to see if there is a way to do this.


Message 5 of 11
in reply to: cowlishaw1988

I'll have to explore a bit with the meshing to give you a better answer regarding your other question. Back to you shortly.

Message 6 of 11
in reply to: syracoj

Fantastic. Yeah in regards to the density, that's what I was referring to in my original post. It's not exported out with the meshed version of the foam.


The only way I've found to export density is as follows...

Select the mesh, right click and go to colorsets editor and add a new attribute called "bifrost_density".


 I do this and export it out as an alembic making sure to turn on export vertex colours...


However as I said before when I import the alembic and turn on export vertex colours under the arnold tab of the mesh, I then hit render (after applying a aiuserdatafloat node and putting in bifrost_density under the attribute section) and it renders the density but with a value of 1 everywhere... 


It's clear under the bifrostfoam1 shape node that there are different values since if I add density to the opacity section of the foam node it displays with different opacity levels.... So as far as I can see it isn't properly exporting out the density channel...


Let me know what you get! Thanks!

Message 7 of 11
in reply to: syracoj

great thanks. In regards to you answering my question about the meshing for foam,I added this question as a seperate question on here so perhaps it may be better if we talk on that other forum? Thanks again for your help with these problems!

Message 8 of 11
in reply to: cowlishaw1988

So yes, it does look like the only option is to render the foam particles as points through Arnold. See image below.



Message 9 of 11
in reply to: syracoj

Ok, so foam as a mesh is absolutely not doable then? Since a) you can't get enough resolution and b) you can't view density...


I guess if I didn't want to have all the bifrost nodes in my scene I could export it out as a volume? What would be preferable if I wanted to take it out of my scene and have it as a cached out volume? I guess I could combine this with the aivolumeshader?

Message 10 of 11
in reply to: cowlishaw1988

I am curious if I can export a bifrost liquid as bifrost object and keep the density property.

I am using density to shade an object, but I need to sample the color information on each point in a bifrost graph. I can only get velocity exported. 

My bifrost liquid emits from a mesh object and gets the density from the object's vertex colors.

I can only make use of the density visually in arnold. Is there another way to access it and set as a property on my object before exporting as bob seq?

Message 11 of 11
in reply to: brandaosa

For this one, you would try to cache your bifrost liquid and than import the sequence using a read_bif_particle node. This node will import particles with all properties you exported, including density. Now, these particles doesn't include a mesh. You can generate one, or if you want to transfer this properties, say, to an alembic mesh, you will need to sample (or transfer) from one source to another.

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

Post to forums  

Autodesk Design & Make Report