Shader overriding for reflection, diffuse contribution, etc.

   7383   11   2
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Hi everyone,

I'm wondering if there's a way to override an object's shader for how it's seen by different rendering aspects in scene, such as reflections, refractions, i.e separate shader for object rendering, separate one for when it's seen through other object's reflection / refraction, separate diffuse contribution shader. Much like Vray Override Material, if anyone familiar.

Thanks for any ideas. I think I've probably seen some topic like that with the solution, but could be wrong. Couldn't find it.
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Takes!
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
You mean passes approach? Not sure if understood correctly. Any beauty rendering solution?
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Oh sorry, misunderstood. You'd have to customize your VOP network, and have different appearances at different Ray levels, i.e. if raylevel > 1 then switch to a different shader.
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Thanks!

Not sure how would I go that way though. I see this Ray Bounce Level VOP, is that the thing? Help card says after level 1 rays aren't those sent from camera, but reflection rays, that's cool, I could probably mix something with that. But how do I distinguish between reflections like specular and PBR diffuse contribution which I understand are some secondary rays too?

I'm sorry if not understanding something, really not an expert
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Excellent question, and I'm not 100% sure to be honest. Perhaps:

getglobalraylevel()

might help?

Cheers,

Peter B
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Please excuse my ignorance if you open the file, I never dealt directly with vex before, so tried to mock something up in a random manner. I'm afraid I didn't use the function correctly.

What I'm trying to achieve now is some reddish (instead of yellow) diffuse contribution from the sphere to the ground.

Ray Bounce Level seems to work though. Which is very cool, thanks a bunch, Peter. However getting to separate reflections and refractions would be very cool as well

Attachments:
shader_overriding_964_h125.hipnc (2.2 MB)

User Avatar
Member
1390 posts
Joined: July 2005
Offline
Take a look on anim's example [forums.odforce.net] from this thread [forums.odforce.net].
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Thanks, SYmek!

That's the post I was thinking of. And it seems to be perfectly what I need, but doesn't seem to work with PBR

What could possibly be the reason?

Raytracing with GI (as in anim's file)


PBR

Attachments:
shader_overriding_965_h125.hipnc (2.2 MB)

User Avatar
Member
258 posts
Joined:
Offline
I am curious, this is fairly trivial to set up in mental ray and I have seen this, but I have always been unsure why someone would want to do this. I would love to understand what one gets from this. Thanks in advance
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Hey Jordan,

It's just a good level of control, look-wise. Probably yea, not too often needed, but still.

For my case I need it to alter what my object is contributing to diffuse bounces (as well as reflections). Something like that:

http://help.chaosgroup.com/vray/help/150SP1/examples_vray_overridemtl.htm [help.chaosgroup.com]
(Scroll down to GI section)
User Avatar
Member
258 posts
Joined:
Offline
I kinda figured along those lines…thanks for answering.


Jordan
  • Quick Links