Jump to content

separate reflection pass of matte object


Recommended Posts

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

 

  • Like 1
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 by dennis.albus
  • Like 2
Link to comment
Share on other sites

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 by dennis.albus
Added a stripped down setup with less nodes.
  • Like 1
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...