wvonjess Posted March 5, 2018 Share Posted March 5, 2018 (edited) 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 March 5, 2018 by wvonjess Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 5, 2018 Share Posted March 5, 2018 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. Quote Link to comment Share on other sites More sharing options...
wvonjess Posted March 5, 2018 Author Share Posted March 5, 2018 Beautiful, I'll test this out in a bit and get back to you. Just now learning some better shading so I'm excited to dig into this. Quote Link to comment Share on other sites More sharing options...
wvonjess Posted March 5, 2018 Author Share Posted March 5, 2018 @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. Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 5, 2018 Share Posted March 5, 2018 You're using the wrong node... you want the Transform VOP, converting from space: current to space: world Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.