Jump to content
Sign in to follow this  
curveU

How to render smoke with different colors

Recommended Posts

Hello everyone, I'm doing some test about volume smoke dynamics and now meet with one problem. I try to get a smoke with different colors. For example, I want the smoke to be more yellow when it has a higher position.

I read one post from SESI forum, where David asked a similar question about "attribute per voxel". One developer replied the question but I don't quite understand the workflow.

So if anyone here could let me know some way to render a smoke with different colors, that will help me a lot.

Thanks,

Edited by curveU

Share this post


Link to post
Share on other sites

Two replies:

If you want to do that in the viewport, this is not possible. Volumes are monochromatic!

As for rendering.

1) At the shading level: the workflow is no different from surface shaders where you import/call attributes with a parameter VOP with the name of the proper attribute.

2) At the "volume level"( in SOPs): thing is there is no such thing as volume attributes. What you have instead is you must merge several volumes together ( like coming from a fluidsim, typically).

And for each volume which plays the role of an additional attribute you use the primitive attribute "name" and set it to the name of your attribute ( 1 volume= 1 primitive, this gives you the "name of the volume") This is EQUIVALENT to volume attributes ( instead of "attaching" attributes to a volume, you merge several volumes together which will play the role of the attributes. note that volumes are scalar fields ( floats), so if you want vector attributes you need 3 volumes).

Example:

Coming from a fluid sim, if you want to use the burn field as the color attribute for your volume ( whose shape is represented by the density field), what you have to do is typically to merge the "smoke object" ( the "density" field) and the "fire object" ( the "burn" field) together.

Fluid simulation sets the "name" attribute properly for you already ( you can check that in the geometry spreadsheet, you'll find "burn" and "density"). Note that you can import any other field with the Dop Import SOP, as long as it is displayed at the DOP level.

If you want to use the input field "burn" as the input for color in your shader you just use a parameter VOP with the same parameter name: "burn", and you pipe it to the piece of code in the shader which computes final color. Names are not relevant, as long as the name in the parameter VOP and the name of the "field" match.

Now if you want to create other volumes attributes from scratch ( without fluidsim) you create other volumes with proper "name" attributes at the SOP level ( with an AttribCreate SOP) and you merge them with the volume which will play the role of density.

You can do that at the DOP level, create your own field with (SOP)scalar/VectorFields DOPs and the name of your field becomes the name of your "name" attribute when re-imported in SOPs.

The same idea applies to motion blur and "texture advection".

The whole thing may seem unintuitive. I thought that at the beginning, but it's actually perfectly consistent with the rest of fluid implementation

This may change with H9.5 though.

Hth

David

Edited by David Gary

Share this post


Link to post
Share on other sites

Hello David,

Do we have any tutorials on it on ho to render smokes animations in Houdini??I think this is one of the area were not much has been their in term of resources.So there has been a lot of confusions about it.

Thanks .

Share this post


Link to post
Share on other sites

Hello David, Thanks for your detailed explanation. It's very informative. I will try to do some test to see if I could get some results.

The whole thing may seem unintuitive. I thought that at the beginning, but it's actually perfectly consistent with the rest of fluid implementation

This may change with H9.5 though.

Yeah, I really hope the fuild dynamics part of Houdini could be improved in the coming version.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×