merlino Posted December 26, 2013 Share Posted December 26, 2013 Hi, I'm kind of stuck trying to emit fluid from a shader attribute. The problem is that I have a ramp material and I would like to emit fluid only from the opaque part, not the transparent one. I found some help but reading a texture, not a shader. How can I do that? Quote Link to comment Share on other sites More sharing options...
Skybar Posted December 26, 2013 Share Posted December 26, 2013 Wouldn't it be easier to do it the other way around? Create an attribute on your geo that you both emit from and control your opacity with. Quote Link to comment Share on other sites More sharing options...
mightcouldb1 Posted December 26, 2013 Share Posted December 26, 2013 You can link the ramp in the shader to one in obj with vops Quote Link to comment Share on other sites More sharing options...
merlino Posted December 27, 2013 Author Share Posted December 27, 2013 Wouldn't it be easier to do it the other way around? Create an attribute on your geo that you both emit from and control your opacity with. Hi David, the problem is that I use the ramp shader witch works with the facing ratio and I don't know how to store that info to the points ... Maybe the solution is in what Jason says, even if I don't know how to reach it right now ... tomorrow I'll do some test Many thanks! Quote Link to comment Share on other sites More sharing options...
theWingedPlatypus Posted December 27, 2013 Share Posted December 27, 2013 hello ! not sure it's possible, since shaders are evaluated at render time (i think...), but as skybar said, the other way around should work, and if your probleme is to get the facing ratio, it is just a dot product (or cross? i always mix those two) between point and camera ! Quote Link to comment Share on other sites More sharing options...
merlino Posted December 27, 2013 Author Share Posted December 27, 2013 Actually I'm trying with the suggested solutions but how can I get the cam info in the vopsop? Quote Link to comment Share on other sites More sharing options...
mawi Posted December 27, 2013 Share Posted December 27, 2013 Use a object merge set to "transform into this object" and fetch the cam origin point. facingCamera.hip 1 Quote Link to comment Share on other sites More sharing options...
merlino Posted December 29, 2013 Author Share Posted December 29, 2013 Many thanks Mawi! That's exactly what I was looking for! And thanks to all! Just a question: subtracting the points position from the cam position gives you the vector pointing from the cam to the points? Is it right? Quote Link to comment Share on other sites More sharing options...
mawi Posted December 29, 2013 Share Posted December 29, 2013 (edited) Vector from point to camera. Edited December 29, 2013 by mawi 1 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.