- Mon Aug 07, 2006 11:43 pm
#176371
¦¦ WARNING - LONG POST
¦¦
For 1-layered materials :
I'm going to be using this colour map :

First, here's a ball with a 1-layered material on it. I've mapped the colour texture to the ref(0) channel and it has NO weightmaps at all.

This method works great until you start changing the roughness values of your one bsdf layer.

In the above image, because we are only using one layer, the roughness value has affected the entire object, including the decals. Again, if this is the look you want, then you can leave it at that. However for the camera, I wanted to have seperate roughness values for the decals. So I had to add another BSDF layer, and start using some weightmaps.
The weightmap I'm starting with is a black + white version of the colour map. The white is RGB 255,255,255 and the black RGB 0,0,0. When using weightmaps, your layer weight percentage values are over-ridden (notice the T next to the layer name,) and Maxwell takes this info from the colour values on the weightmap (white 255,255,255 being 100%, and black 0,0,0 being 0%.)

In order to ensure that the textures are affecting the correct parts of the object, we invert the weightmap on the decals channel, so that the decals are now receiving 100% and the rest is receiving 0%.

For now, we will add the original colour map back in the ref(0) channels on both layers. If we change the roughness value of the base layer to 30%, but leave the decals layer as labertian, we get this (shiny ball, dull decals) :

By unloading the colour maps, and changing the ref(0) values ourselves, we can remap the colours of the sphere :

For 2-layered materials and beyond:
If you see above, we actually ended up with a new decal layer alongside our original layer (now converted to use a weightmap.) The principal with a 2 layered material (or any number above that) is basically the same; you end up converting your existing layers to work with weightmaps, and you also add an extra decal layer.
The only real difference is that on most occasions your original layers will have different percentage layer weights, as seen below, so we have to compensate for this.

We know that Maxwell remaps these values, with values taken from the weightmap. But how do we get the 60% or 40% values from a weightmap? Its actually pretty simple. We do this by altering the colour of the white parts of the weightmap.
100% layer weight = 255,255,255 (or pure white) on the weightmap
We already have shown this to be true above. As the weightmaps are always going to be greyscale (I.E the three RGB values will always be the same) we can rewrite this as :
100 % = 255
In order to find our new percentage, we must first find 1% of this figure, so we divide 255 by 100 :
1% = 2.55
Now, we can multiply this figure by our existing layer weights, and in doing so, we will find the corresponding RGB value :
2.55 x 60% = 153 or 153,153,153
2.55 x 40% = 102 or 102,102,102
(Sometimes you end up with a decimal number here, which would not work. What I usually do is round to the nearest whole number.)
So, we now know what values we have to substitute into our weightmap. One of the easiest ways to do this is to open the weightmap in photoshop/gimp and load up the levels dialogue.

From here you can cap the maximum white output to a value. Add in one of your rgb values, and apply. Save a copy. Now re-open the original, and repeat as needed with your other layers.
Its then just a case of adding these grey/black weightmaps into the material editor (which explains the grey weightmaps in my previous post) and then adding in the new decals layer, with the original white/black weightmap inverted :



You now have control over the decal's attributes, in a 2 layered material
I apologise for the long and rambling qualities of this (although I think the expertly created decals map somewhat makes up for it
), but I had some time to kill. Its also REALLY noisy outside at the moment (someones building something somewhere...) and I can't hear myself think, so I really hope that at least some of this makes some sense
Cheers,
Dr Merman

For 1-layered materials :
I'm going to be using this colour map :

First, here's a ball with a 1-layered material on it. I've mapped the colour texture to the ref(0) channel and it has NO weightmaps at all.


This method works great until you start changing the roughness values of your one bsdf layer.


In the above image, because we are only using one layer, the roughness value has affected the entire object, including the decals. Again, if this is the look you want, then you can leave it at that. However for the camera, I wanted to have seperate roughness values for the decals. So I had to add another BSDF layer, and start using some weightmaps.
The weightmap I'm starting with is a black + white version of the colour map. The white is RGB 255,255,255 and the black RGB 0,0,0. When using weightmaps, your layer weight percentage values are over-ridden (notice the T next to the layer name,) and Maxwell takes this info from the colour values on the weightmap (white 255,255,255 being 100%, and black 0,0,0 being 0%.)

In order to ensure that the textures are affecting the correct parts of the object, we invert the weightmap on the decals channel, so that the decals are now receiving 100% and the rest is receiving 0%.

For now, we will add the original colour map back in the ref(0) channels on both layers. If we change the roughness value of the base layer to 30%, but leave the decals layer as labertian, we get this (shiny ball, dull decals) :

By unloading the colour maps, and changing the ref(0) values ourselves, we can remap the colours of the sphere :

For 2-layered materials and beyond:
If you see above, we actually ended up with a new decal layer alongside our original layer (now converted to use a weightmap.) The principal with a 2 layered material (or any number above that) is basically the same; you end up converting your existing layers to work with weightmaps, and you also add an extra decal layer.
The only real difference is that on most occasions your original layers will have different percentage layer weights, as seen below, so we have to compensate for this.

We know that Maxwell remaps these values, with values taken from the weightmap. But how do we get the 60% or 40% values from a weightmap? Its actually pretty simple. We do this by altering the colour of the white parts of the weightmap.
100% layer weight = 255,255,255 (or pure white) on the weightmap
We already have shown this to be true above. As the weightmaps are always going to be greyscale (I.E the three RGB values will always be the same) we can rewrite this as :
100 % = 255
In order to find our new percentage, we must first find 1% of this figure, so we divide 255 by 100 :
1% = 2.55
Now, we can multiply this figure by our existing layer weights, and in doing so, we will find the corresponding RGB value :
2.55 x 60% = 153 or 153,153,153
2.55 x 40% = 102 or 102,102,102
(Sometimes you end up with a decimal number here, which would not work. What I usually do is round to the nearest whole number.)
So, we now know what values we have to substitute into our weightmap. One of the easiest ways to do this is to open the weightmap in photoshop/gimp and load up the levels dialogue.

From here you can cap the maximum white output to a value. Add in one of your rgb values, and apply. Save a copy. Now re-open the original, and repeat as needed with your other layers.
Its then just a case of adding these grey/black weightmaps into the material editor (which explains the grey weightmaps in my previous post) and then adding in the new decals layer, with the original white/black weightmap inverted :



You now have control over the decal's attributes, in a 2 layered material

I apologise for the long and rambling qualities of this (although I think the expertly created decals map somewhat makes up for it


Cheers,
Dr Merman
I don't really take anything people say seriously until they've used at least 20, sometimes 25, words...