(SOLVED) Iray Shader Mixer help needed to create tricky PBR Metallicity Base shader

soup-sammichsoup-sammich Posts: 31

The goal: To create a PBR Metallicity Base (hereafter PBR-MB) shader with an extra color channel.  The Base Color setting needs to control either the surface of the object, or the backface.  The additional color channel needs to control the opposing part of the mesh.

Let me start off by saying that I'm a Shader Mixer NOOB but, I've spent the better part of today (and about 6 hours yesterday) researching, watching tutorials, searching forums and the Internet, and experimenting.  Comments about "spend some time searching" will not be appreciated UNLESS they include a link to an answer to any of my questions.  (Forgive my turseness, but I've been searching/learning for 18-ish hours and already wrote this out once, but due to some interesting issues with attaching a file, lost it all.  I'm not looking forward to typing this all out again, but I need help from you)

This forum was quite helpful in the early stages, but diverted from my goal pretty quickly and left me with a lot of unanswered quesitons: https://www.daz3d.com/forums/discussion/242936/an-iray-shader-mixer-cookbook

This doc was a little helpful, but it's ultimately useless: http://docs.daz3d.com/doku.php/artzone/pub/software/shadermixer/start

I found the following image and some closer help here: https://www.daz3d.com/forums/discussion/246076/any-way-to-do-a-two-sided-shader-material-in-iray

-------------------------------------------------Posted by aaráribel caađo-------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------

As you can see from the attached image, I've gotten quite a bit closer to my goal by recreating the network in the above image (with some interpretation of the missing bricks), and have a shader with a different surface and backface color.  Well, before I added the PBR-MB and Add Weighted Layer bricks, anyway.  However, I can't change the colors from a "user" standpoint, and I have no PBR-MB default settings to change things like diffuse, roughness, glossiness, normal, etc.  I'm thinking that I need to fill in the various inputs on the PBR-MB brick (not sure where to start there, but it's probably just floats, colors, booleans, and intigers), and I'm not looking forward to that.  But, if that's what is needed, then I'll get it done.

My questions:

  • Do I need to fill in all of the PBR-MB brick inputs in order to see the settings, or is there a simpler way to get default values?
  • How do I convert the result of the Material-Structs brick to a color?
    • If I can't, what other bricks have a Surface and/or Backface result of Color?
    • I'm thinking I'll need to use two Material-Structs bricks (one with surface input to the BaseColor, the other with backface input) and the Add Weighted Layer brick to combine the PBR-MB brick with the opposing face Material-Structs brick.
  • Am I even going in the right direction?

Thank you in advance for your help!

Post edited by soup-sammich on

Comments

  • I've not done much (at all) with the MDL version of Shader Mixer (in 3delight I wouod simply handle this by a dot product of the surface normal and the eye vector) but I think partial answers are structure accessor bricks to get at details such as colour, and a User Parameter brick to allow you to set the inputs via the Surfaces pane. Sorry for the lack of detail.

  • Thank you Richard!  I'll be doing some more experimenting/learning/researching tonight and quite a bit tomorrow.  I appreciate your response!

  • soup-sammichsoup-sammich Posts: 31
    edited September 2018

    After a LOT more research, experimentation, and a much needed break to let my subconscious work on it, I got it!

    image

    This is a research induced version of the surface I started with:

    image

    It was functional, but SEVERELY lacking in the specific settings I need for my project.

    I then imported the default "!Iray Uber Base" shader into Shader Mixer (discovered that function in my additional research laugh), and was quite surprised at the size and scope of it.  Had I tried to figure all of it out myself, I'd be working on it for quite some time ahead (kudos to any of you Daz employess and PAs who work with the Shader Mixer on a regular basis, y'all deserve a medal).  I copied my starting texture and pasted it into the Uber Base.  My "UserParameters" brick was deleted because you can only have one UserParameters brick, apparently (makes sense if you think about it).  Since the Uber Base already had a "Base Color" I no longer had a need for two Simple Glossy BDSF bricks, so I removed one and did the same with my "Bump or Normal Map" brick and "MDL Surface" brick.  I added an "Inner Color" User Parameter and connected that to my Simple Glossy Tint input.  Then, in order to eliminate the default reflective surface, I connected the Uber Base's "Diffuse Roughness Map" output to the Roughness U/V values.  Now I could control how shiny the interior color is with the default Diffuse Roughness slider.  However, I still needed a way to combine two Material outputs (MT) into one.  Along comes a wonderful accidental discovery of mine, the "Override Material Field" brick (Bricks>Functions>MDL>Material Editors>Override Material Field).  This brick allows you to input MANY materials into a single material output!  Granted, you need to have the appropriate values.  However, for this texture, I only needed two.  The "Base" and "Backface Scattering" inputs.  I dropped that brick between the Uber Add Volume and MDL Surface bricks of the Uber Base, connected the Uber Add Volume output MT to its Base MT input, the MT output of my Material - Fields brick to the Backface Scattering MT input of the Override Material brick, and connected the Override Material MT output to the MDL Surface MT input.  Clicked "Apply" and BAM!  Double sided material with all of the default Uber Base properties and settings.

    Helpful links:

    Iray MDL Module Base information: https://www.migenius.com/doc/realityserver/4.4/resources/general/iray/mdl/base_module/index.html

    The MDL Handbook: http://mdlhandbook.com/

     

    DoubleSided1.PNG
    921 x 428 - 177K
    DoubleSided2.PNG
    993 x 575 - 86K
    Post edited by soup-sammich on
  • After a LOT more research, experimentation, and a much needed break to let my subconscious work on it, I got it!

    image

    This is a research induced version of the surface I started with:

    image

    It was functional, but SEVERELY lacking in the specific settings I need for my project.

    I then imported the default "!Iray Uber Base" shader into Shader Mixer (discovered that function in my additional research laugh), and was quite surprised at the size and scope of it.  Had I tried to figure all of it out myself, I'd be working on it for quite some time ahead (kudos to any of you Daz employess and PAs who work with the Shader Mixer on a regular basis, y'all deserve a medal).  I copied my starting texture and pasted it into the Uber Base.  My "UserParameters" brick was deleted because you can only have one UserParameters brick, apparently (makes sense if you think about it).  Since the Uber Base already had a "Base Color" I no longer had a need for two Simple Glossy BDSF bricks, so I removed one and did the same with my "Bump or Normal Map" brick and "MDL Surface" brick.  I added an "Inner Color" User Parameter and connected that to my Simple Glossy Tint input.  Then, in order to eliminate the default reflective surface, I connected the Uber Base's "Diffuse Roughness Map" output to the Roughness U/V values.  Now I could control how shiny the interior color is with the default Diffuse Roughness slider.  However, I still needed a way to combine two Material outputs (MT) into one.  Along comes a wonderful accidental discovery of mine, the "Override Material Field" brick (Bricks>Functions>MDL>Material Editors>Override Material Field).  This brick allows you to input MANY materials into a single material output!  Granted, you need to have the appropriate values.  However, for this texture, I only needed two.  The "Base" and "Backface Scattering" inputs.  I dropped that brick between the Uber Add Volume and MDL Surface bricks of the Uber Base, connected the Uber Add Volume output MT to its Base MT input, the MT output of my Material - Fields brick to the Backface Scattering MT input of the Override Material brick, and connected the Override Material MT output to the MDL Surface MT input.  Clicked "Apply" and BAM!  Double sided material with all of the default Uber Base properties and settings.

    Helpful links:

    Iray MDL Module Base information: https://www.migenius.com/doc/realityserver/4.4/resources/general/iray/mdl/base_module/index.html

    The MDL Handbook: http://mdlhandbook.com/

     

    Thank you for all this information! I'm trying to make one too and am rather lost with all those bricks!

     

Sign In or Register to comment.