Q about Is Front Face VOP and displacement

   1113   2   0
User Avatar
Member
109 posts
Joined: June 2008
Offline
Shader/material quickie: is there a way to use “Is Front Face” vop when adding displacement? Currently i have “i” and “n” from surface globals connected to IFF and it works fine. When i try to use returned value with displacement nodes Mantra cries out that the global variable is missing. Displacement globals has “n” but where do i get the required “i”. I'm trying to create a shader for an line that has displacement only on front face.

Cheers
-k
User Avatar
Staff
429 posts
Joined: Sept. 2016
Offline
You sort of can. Although technically “I” (the camera ray) doesn't exist in displacement shading, as long as the displacement shader is running in camera space, you can simply use “P” as camera direction. However Is Front Face node uses “I” variable in its code (even if you've wired in your own “I” and it shouldn't be using the global's), so you may have to replace it with your own to avoid shader error (just a switch based on dot product between I and N should suffice).
User Avatar
Member
109 posts
Joined: June 2008
Offline
Thank You!!! It works Fast test attached. Green color is for front face
Edited by KiLa - March 26, 2019 16:03:21

Attachments:
displacement.png (58.7 KB)

  • Quick Links