Jump to content

Mantra Surface shader Issue


Recommended Posts

Hi all,

 

I have a simulation where my liquid change viscosity based on particle age, everything controlled with a spline ramp.

Now my wish is to let the liquid change color based on viscosity. I'm not sure if I'm on the right direction but in viewport I have some results, not in render.

 

Few notes:

 

- material is a mantrasurface material

- materials computation has been done  in SOP with vopsop, importing viscosity attribute and exporting r g b values as per material values.

 

Please refer to attachments,

Any help to show me the way will be really appreciate.

 

Thank you all,

 

E.

post-15117-0-16363900-1451341742_thumb.j

post-15117-0-98193500-1451341767_thumb.j

ViscosityR&D_02.hipnc

Link to comment
Share on other sites

don't decompose the vector into floats.  instead, pass it a vector called "diff_color".  the "r/g/b" is appended to the individual components of vectors and are really only useful in channel references.  the actual shading parameter is "diff_color" and it's a vector.

Link to comment
Share on other sites

Thank you for your reply, is working in some way but I still have one issue.

 

Viscosity of my fluid is on range from 25 to 5000, so I used a fit range  sourceMin 25 sourceMax 5000 with destination 0-1, this cut me all the areas where my viscosity is 25, I don`t understand why.

 

I wish to use a ramp parameter to control colours based on viscosity but as you can see is not happening.

Please find screenshots and files attached.

 

Thank you again!

E. 

 

 

ViscosityR&D_03.hipnc

post-15117-0-33664800-1451385177_thumb.j

post-15117-0-48597900-1451385178_thumb.j

Link to comment
Share on other sites

Your ramps position lookup isn´t connected. all particles will pick the blueish color at beginning of the ramp(position 0). That is later multiplied with the normalized viscosity (0-1), returning black att the lower viscosity value.

 

so.

Connect your fit1 node to the position of the ramp and take the output of the ramp into the diff_color node.

ViscosityR&D_03.hipnc

Link to comment
Share on other sites

Everything works perfectly, thank you both for your help, I will post renders soon.

 

I would like to keep this occasion to ask you 2 things,

 

1 - Is possible to export attributes to max/vray? Like viscosity in this case

 

2 - Is possible to emit fluid of 2 different colours mixed together?

 

Something similar has been done here, 

 

https://vimeo.com/132239252

 

Thank you again

 

E.

Link to comment
Share on other sites

since flip is a particle-based system, you can easily add color to your source particles and then, when you go to generate your mesh, query the original colors from your particles to color your mesh.  you'll get blending based on how many particles you sample and the size of your filter (using attribute transfer or direct point-cloud queries).

 

as for exporting to max/vray... i'm sure there's some means to do that, but i'm not sure what the state-of-the-art is there.  i would presume alembic can handle the attributes, but i'm not sure what you can do with them once in max/vray.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...