Jump to content

Interior Fluid Shader


wvonjess

Recommended Posts

Hey wizards! I have a challenge I need help solving. I'm doing a flip sim where I have to mix two different fluids together, I.E. water and lets say molten aluminum. Clearly these two fluids need 2 different shaders, but when doing a sim you'd want one one mesh to keep everything clean without gaps or ips. I've already created a single shader driven by surface attributes to get the two different materials to work on the same mesh. There's only one massive, glaring issue with this method. You don't get any of your interior attributes back from your particles when using a mesh. The many solutions I've tried all fall short including using volume representations of the interior fluid, this is because a volume cannot receive lighting information that surfaces can I.E spec, refraction, SSS, etc. One idea that I haven't been able to fully explore, due to my lack of shading knowledge, is the way that ocean shaders use particle and volume data to create the deep ocean looks that Houdini is great at.

 

So TLDR my question is: Is it possible to recreate a shader that works like the ocean shaders in that I can take volume and particle attributes to drive things like sss, spec, refraction, etc. using the principled shader. If so, if anyone has any basic leads or can point me in the right direction to get started that'd be huge. I really want to get this shader to look incredible so I can share it with the rest of the community down the road if anyone needed to tackle something similar. Have at it team!

Edited by wvonjess
Link to comment
Share on other sites

You can grab attributes from points in a shader, no problem. This is what point cloud functions (pcopen, pcfilter) were intended for. If you cache out your points to bgeo, you can take your shader global position P, convert it to world space using a Transform VOP, then use that as the position for a point cloud open VOP, with your points as the input geometry. This way you can grab and filter any point attribute you like. With volumes you can use the Volume Sample and Volume Sample Vector VOPs to grab voxel data from any cached volume primitive.

Link to comment
Share on other sites

@toadstorm I tried your method, and It seems I'm doing something wrong, I've linked a screenshot of the shader, is there anything glaringly obvious that I did wrong? The render turns out matte white where as before it had its respective values when I bound the attributes in. 

copy.jpg

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...