Switching between RMA and ORM packet texture in a material, via switch

Hello! I’m putting together a multilayered master material that allows me to combine three different materials or more.

I’d like to add the feature to switch between RMA and ORM packed textures in my material instances and I don’t know any better than using a bunch of switch param like in the example I put together in the picture.

It, doesn’t look terrible, but gets quite busy in my actual material as there is quite a lot going on already and I was wondering if there was something more elegant and streamlined to achieve the same result. Thanks for any help you could give me :slight_smile:

You could do it this way, but it might be bad as the material grows. Each Switch node creates a permutation of the material. So with this material, when you compile it needs to compile 9 times (If my calculations are correct). It compiles one time for each possible combination of the switches.

A better solution would be to use a normal Switch node:

Then plug the float / scalar into the SwitchValue input to control which one is selected.

You should only use one texture, and simply swap the channel order with Appends or Swizzles. This will in turn reduce the texture samples.

I hope this was helpful! :slight_smile: