User avatar
By DrMerman
#176371
¦¦ WARNING - LONG POST :D ¦¦

For 1-layered materials :

I'm going to be using this colour map :

Image

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.

Image Image

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

Image Image

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%.)

Image

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%.

Image

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) :

Image

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

Image


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.

Image

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.

Image

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 :

ImageImageImage

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 :roll:

Cheers,
Dr Merman
By superbad
#176374
That needs to be in the tutorial section. Great post.
By glypticmax
#176375
Incredible!
Thank you very much Dr. Merman for takin the time to clearly explain the demonstrate what you are doing.
I think its worth posting in the Tutorial page of the Maxwell website.
And when I get around to helping my uncle out by rendering the front porch of his "Watson's Gator Farm & Inner Tube Repair" I will be well equiped to get'er done.
Thanks mate.
By samsam
#176394
Thanks for posting this. :P
User avatar
By ivox3
#176563
Doc, ...superbly laid out and written. :)
By jespi
#176612
Thanks Mr Doctor!
User avatar
By x_site
#176617
Thank you 8)
User avatar
By -Adrian
#176737
Great man, very easy to pick up!
User avatar
By DrMerman
#176844
Thanks guys, glad to help :)
User avatar
By glebe digital
#176862
Thanks Doc, that fills in some big blanks for me. :)
User avatar
By abgrafx3d
#177747
Thank you very much! Very helpful tutorial. :D
By richardfollett
#242858
Sorry to be a pain but I am really struggling with this, can someone please help me before I just give up..
I am trying to get the ipod decals on the back of a 5th Gen ipod.
I was working with a platinum material with ior link and trying to add a decal as a weight map, is this correct? If so how the hell do I do it?
Also i don't want it to stretch over the back plate.
Image
Sketchup 2025 Released

Thank you Fernando!!!!!!!!!!!!!!!!!!!!!!!!!!! hwol[…]

I've noticed that "export all" creates l[…]

hmmm can you elaborate a bit about the the use of […]

render engines and Maxwell

Funny, I think, that when I check CG sites they ar[…]