Home Marmoset

Custom Shader - Metalness Remapping

polycounter lvl 10
Offline / Send Message
Lt_Commander polycounter lvl 10
I've been working on a custom shader fragment that replicates a custom shader we have in our game engine, which is Unity/PBR. One of the features I want to port to toolbag is the ability to remap smoothness and metalness values of texture masked sections on the fly.

Long story short, I've had luck with remapping the smoothness since it's the gloss variable in the Microsurface pass, but metalness is a bit trickier since it's more of an indirect input of the the Reflectivity pass, I think.

Is there an injection point where I can manipulate the metalness input before it is factored into the reflectivity? Or would I be better off rewriting the reflectivity pass with a custom metalness conversion?

Replies

  • Lt_Commander
    Options
    Offline / Send Message
    Lt_Commander polycounter lvl 10
    As an update to this, I chose to make a local copy of   void  ReflectivityMetalness   that used the sampler's metalness values instead of sampling the texture directly. I called it in my Reflectivity custom function after I had done what I needed to the metalness map.

    Strangely, it appears broken in normal view but renders perfectly with raytracing on. Visually, reflectivity goes to black for metallic surfaces with RT off. We're already using raytracing when using toolbag so it's not a problem for my use case, just a strange outcome.
  • iam717
    Options
    Offline / Send Message
    iam717 greentooth
    Just echoing the blackness situation, same for me with lights (current project), used to crash but just turning off the offending light fixes the issue, could be too many lights or a combination of light and (configuration settings / where bloom is and all those options, unsure if the options play a part) I had about 15 or less lights, on/off testing the reason.

    Though i find this update and situation helpful if i feel to fool about with these things myself.  If they ever make a similar addition of marmoset to what "epic" or any other shader graph has, i hope they leave their defaults as references to review for noobies to look at to make their own, shaders.
Sign In or Register to comment.