Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Turn off primary rays for an object using shaders rather than geometry switch ?

Turn off primary rays for an object using shaders rather than geometry switch ?

Anonymous
Not applicable
1,212 Views
6 Replies
Message 1 of 7

Turn off primary rays for an object using shaders rather than geometry switch ?

Anonymous
Not applicable

Is it possible to turn off primary rays for an object using shaders rather than unchecking the "Primary visibility" on the shape node. I want to achieve this so I can feed networks into AOVs.

So I want to achieve like the image on the right, but do it with shaders rather than using the shape node attribute for Primary visibility.


Thanks

Alan.

screenshot-2020-12-19-16-25-12-077-comandroidchrom.jpg

0 Likes
Accepted solutions (1)
1,213 Views
6 Replies
Replies (6)
Message 2 of 7

Stephen.Blair
Community Manager
Community Manager

I don't think that's possible. By the time shaders are evaluated, Arnold has already determined that the object is visible (or not).



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 3 of 7

maxtarpini
Collaborator
Collaborator
Accepted solution

Turn your primary rays into transparency rays.

shaderprimaryraysswitch.png

0 Likes
Message 4 of 7

Stephen.Blair
Community Manager
Community Manager

Yup, that occurred to me last night!

1608654708880.png



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 5 of 7

maxtarpini
Collaborator
Collaborator

You mean the reflection in the ball ? But he asked for 'primary rays' 😉 ie. that would occur also by turning off 'primary visibility'. You can plug the transpmat into specular reflection slot.. the only problem is that the part exposed to the background would still be visible (see black spot in refl sphere)... one can fix that by using a dome sphere.


primaryandreflrays.png

0 Likes
Message 6 of 7

Stephen.Blair
Community Manager
Community Manager

No, I just meant I thought of the same thing as you, and I was echoing your suggestion (you beat me to it, when I went to post my answer you had already answered)

I just put in the chrome ball to show that I had "turned off" primary visibility, but left everything else.



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 7 of 7

Anonymous
Not applicable

Awesome that's great, so I can now use userData variables on objects to turn off visibility of objects in AOVs - retaining their reflections etc in the AOV.

0 Likes