Jump to content

Reflecting and refracting custom image planes (AOVs)


Recommended Posts

you'd have to edit your material to manually grab the AOV data from the refracted ray using the gather() function, then export that value like you would the AOV from the original material.

i'm attaching an example file. check out /mat/sphere_mtl to see the Inline VOP that uses gather() to sample the exported "matte" value.

refract_aov.hip

Link to comment
Share on other sites

14 hours ago, toadstorm said:

you'd have to edit your material to manually grab the AOV data from the refracted ray using the gather() function, then export that value like you would the AOV from the original material.

i'm attaching an example file. check out /mat/sphere_mtl to see the Inline VOP that uses gather() to sample the exported "matte" value.

refract_aov.hip

Wow, thanks for the pointer!

Curiously, though, I had to edit your inline code, as it had typographic open / closed quotes. I wonder if it is somehow related to OS locale.

uc?id=1InRa11eWjXKPrA_AEvJ_k9rhU04ScJ25

Other than that, it works excellent and makes me wonder why such functionality is not built in.

 

Edited by lamer3d
Link to comment
Share on other sites

And how would you approach rough reflections / refractions?

Edit: I kinda figured out, you can use angle argument to somewhat fake it. But it appears there is no way to match reflectivity / roughness of the surface shader?

Edited by lamer3d
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...