3
$\begingroup$

Material Index:

enter image description here

This socket just outputs index pass set by user, just like simple Value node.

At first I thought it can play a role with material override, to see passes of real materials. Unfortunately, it doesn't work that way, as it also overrides all passes.

So, what is usecase for it?

$\endgroup$
4
$\begingroup$

Maybe a slightly obscure one.. I've used the Material Index for discriminating between materials hit by a forward-cast ray in OSL.

Examples here and here... it's one of the few attributes actually returned by a shader-cast ray, at the moment..

$\endgroup$
1
  • 2
    $\begingroup$ Quite a voodoo magic you have here... $\endgroup$ – Serge L Jan 16 '20 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.