Blending multiple normal maps on Separate UV channels

Good evening.

I am trying to blend a Normal Map Trim texture that is on a different UV channel (Channel 2) using DeriveTangentBasis. My main tiling normal map is on Channel 0 and Light maps are using channel 1.

I was following the info here:

I have unchecked Tangent space normal map in the Material and converted the normal map from Channel 0 using TransformVector - Tangent Space > World Space.

In Picture 1 it appears to be blending as expected, using the material setup from Picture 2. However when I try to blend using Material Functions I am getting poor results. Picture 3 shows my material using material functions and Picture 4 shows that result. Does the math need to change when using material functions?

If someone could take a look and provide feedback, that would be great!

Thank you.

.

Okay, so you wanna blend two textures together from different channels. that’s easy, start with two textures and feed them different coordinate channels. you’ve got that part done:

but then… you convert one to world-space for some reason?? and then use really complicated math on the other? to combine them? why?
Why did you make your texture a world-space one in the material by un-ticking tangent space, then convert your tangent space texture to world space?! Why not just keep the texture in tangent space and save yourself all the trouble?

…hmm, ok, i read the post you’re referencing. I did not know that was a thing, but I have also run in to that problem with arches/etc… so this is new to me but useful info. Ok then! Tangent bases are a *****, good to know.
Do the tangent to world thing, and the tangent base derivation. That’s right, apparently.
But then you’re just… adding them together. The math there is wrong. You should be do this.
add the red and green channels, multiply the blue, then recombine, instead of just adding:

In theory that should be all? Why does putting any of this in a function matter? What errors does that bring up?