Compute Mtlx utilities before displacement

   694   1   1
User Avatar
Member
4 posts
Joined: July 2017
Offline
Hi, I already sent a RFE to Sidefx about this (#140766), but I wanted to know if anyone has a workaround. Right now, the displacement gets calculated before the shaders are being processed. Which means that if I have a procedural mask using N in world space (MtlxNormal) for example, it will calculate it using the displaced geo instead of the pre-displaced one, which is not something I want in many cases. It makes doing procedural masking a bit inconvenient as the displacement completely change the way the Mtlx Normal, Curvature or any other utilities are working. One solution would be to bake, or precompute them in SOP first, but in my case it is not viable as I need to generate them on the fly. Did anyone face this and had a workaround for the time being? Would be amazing to have the ability to decide what cam get computed before displacement!
EDIT: added a quick exemple using a shader mix using a N mask

Cheers!
Edited by tbattistetti - March 3, 2025 02:43:54

Attachments:
Photoshop_S9TNnbyLM0.png (1.1 MB)

User Avatar
Member
9271 posts
Joined: July 2007
Online
You can do it easily in VEX Shaders for Karma CPU, by exporting variables from displacement shader and importing in surface shader

For MtlX I think storing N under different name in SOPs or LOPs and accessing in the surface shader is one of the workarounds
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links