jon3de Posted August 15, 2016 Share Posted August 15, 2016 hello, I have a gid with an torus object on top. The torus object is rendered as matte. I would like to have a reflection pass of my torus object in a separate channel or in the beauty pass. Is this possible? kind regards Jon reflectionPass.hip Quote Link to comment Share on other sites More sharing options...
3dome Posted August 15, 2016 Share Posted August 15, 2016 do you want the torus reflected on the grid or vice versa? you can use AOVs. tick on direct lighting (per component) and above in export components make sure there is reflect. then you have the reflection as pass. reflection on the matte torus, i have no idea if thats possible in one render. i dont think so. make another rop and set it up so you have the reflection of the grid visible on torus 1 Quote Link to comment Share on other sites More sharing options...
jon3de Posted August 15, 2016 Author Share Posted August 15, 2016 Yea I wanted the reflection of the grid on the "matte torus" but of course it makes sense to me that this is not so easily possible. I thought if I am able to render it in one go I can save some time and space with the ifd files because my actually scene is much more complex. Thank you very much Dominik. Quote Link to comment Share on other sites More sharing options...
3dome Posted August 15, 2016 Share Posted August 15, 2016 I'm sure it is somehow possible by hacking the shaders. like setting the matte option in a shader instead on the geo level. or hacking mantra directly. but i'm no expert on this area. maybe @dennis.albus can help Quote Link to comment Share on other sites More sharing options...
sekow Posted August 15, 2016 Share Posted August 15, 2016 look for ray switch here in the forums Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted August 16, 2016 Share Posted August 16, 2016 I am not 100% sure if this is what you want. I've used a fog shader to adjust the final output color / alpha before they get written into the actual AOVs. reflectionPass_fog.hip 1 Quote Link to comment Share on other sites More sharing options...
jon3de Posted August 16, 2016 Author Share Posted August 16, 2016 wow. Thank you for the file Dennis. Its kind of what I wanted to achieve except for the torus reflection channel. It should only show the reflection/specular element of the torus. Like a normal reflection pass but only for the torus object. I´m very impressed that even the current way what you did is possible with houdini. I will try to comprehend this. Thanks again. Jon Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted August 16, 2016 Share Posted August 16, 2016 (edited) To get exactly what you are looking for I actually had to customize a little bit more. This is neither recommended nor a good way to do it (it is just hacked for this single case). I basically made the same changes that I did in the fog shader, but this time directly inside the pathtracer that mantra uses for rendering. This way we get access to all the export variables (AOVs). Note that I did not change the actual pathtracing, but only the results!!! Heres what I added: // Custom Exports export vector4 torus_reflection = 0; .... // custom code goes here string object_name; renderstate("object:name", object_name); if (object_name == "/obj/torus_object1") { torus_reflection = direct_comp[1] + indirect_comp[1]; // sum up the direct and indirect components Af = 0; // set Alpha to zero for the color channel Cf *= Af; // premultiply the color channel } You can see the full code when looking at the code section of the pathtracer vop node. Maybe this is interesting to someone. The problem is interesting enough that I will spend some more time with it and see if I can find a better (more convenient) solution. Cheers, Dennis reflectionPass_pathtracer.hipnc Edited August 16, 2016 by dennis.albus 2 Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted August 19, 2016 Share Posted August 19, 2016 (edited) Here's basically the same setup but this time in VOPs. Hopefully this is even more useful, especially for people not comfortable with code. I was struggling with this as I tried to do it in a fog shader, but the pbrlighting VOP was not available in that context. Doing it in a material shader context solved this problem. Just be sure to export your needed variables (all_comp in that case) into the fog context and not only into the surface context. reflectionPass_pathtracer_vop.hip reflectionPass_pathtracer_vop_simpler.hip Edited August 19, 2016 by dennis.albus Added a stripped down setup with less nodes. 1 Quote Link to comment Share on other sites More sharing options...
jon3de Posted August 22, 2016 Author Share Posted August 22, 2016 awesome!! 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.