TomRaynor Posted November 22, 2013 Share Posted November 22, 2013 I am trying to make a material that catches shadows from other objects and casts shadows onto other objects but doesn't cast shadows on itself (be able to toggle this functionality on and off). I have attached a scene where I have a shader that catches shadows from other objects but doesn't cast any shadows at all. Is it possible to make a shader that does this? Thanks everyone! shadowCaster_v01.hip Quote Link to comment Share on other sites More sharing options...
Green-Man Posted December 6, 2013 Share Posted December 6, 2013 Hi! I think the there is no way to do such kind of a trick in surface shader. That's why you should probably customize the shadow shader of the light. I've attached the basic setup for that. Everything interesting is in the Inline of /shop/customShadow and some code inside of /shop/lambert As soon as we want to have a control of this feature on per object basis we want to place the "Cast Shadow On Self" toggle on the surface shader. This is a little bit limited version in comparison with default ASAD shadow shader in a way that in this particular implementation there is no support of any shadow parameters defined on the light. So you should upgrade code a bit to have it. Feel free to ask If accidentally something is not working there. By the way this version should work well only with H13. Previous release had some bugs with simport() that is not crucial but really needed for performance. shadowCaster_v02.hip Quote Link to comment Share on other sites More sharing options...
Green-Man Posted December 19, 2013 Share Posted December 19, 2013 Just realized another way of doing such kind of a trick. It doesn't need custom surface shader and is based on using categories not masks. This one also has some other pros and cons. shadowCaster_v03.hip Quote Link to comment Share on other sites More sharing options...
TomRaynor Posted December 19, 2013 Author Share Posted December 19, 2013 Thanks very much for the suggestions guys, I will check them out now! Quote Link to comment Share on other sites More sharing options...
Serg Posted December 26, 2013 Share Posted December 26, 2013 (edited) Another way is to dig into the surface model vop, find the direct lighting vop and uncheck the shadow checkbox. No sure if it exists in the h13 compute lighting vop. edit: nevermind that, just realised you want it to receive shadows from other objects which wont work with this. Edited December 26, 2013 by Serg 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.