Exploring LEGO Material Part 2

In this blog post, I would like to take a closer look at how to actually render LEGO. If you missed Part 1, you can still read it if you like smile Because I grew up in the 90s and I love the old LEGO pirates sets, I decided to do the lookdev for the infamous Captian Redbeard.

 

Modeling

This is a blog post about shading, but obviously, a model is kinda mandatory to do that. So first things first: Let’s get a minifig model! Of course, I could have modeled one, but then I found one on Mecabricks, and I decided to just buy it since I was interested in doing shading, not modeling. The model looks gorgeous when it’s subdivided and the model feels pretty accurate.

wireframe

 

Choosing a renderer

Nowadays it feels like there is a new raytracer out there every other week, so the possibilities are almost endless. Blender with its cycle renderer seems to be quite popular in the LEGO community, but my personal favorite is Redshift. It’s incredibly fast, image quality is great and most importantly: The Redshift material is one of the best shaders in the industry. It’s heavily inspired by the alSurface shader for Arnold, but it can do even more. Additionally, Redshift got a lot of useful shading nodes over the last year.

But of course one can render great LEGO imagery with any of the other modern rendering packages as well. That’s why I’ll try to avoid specific parameter values or Redshift specific workflows. Instead, this blog post will cover the general concepts and everything I discovered on my (long) journey of LEGO lookdev and how one can achieve a certain effect.

 

Diffuse

Luckily, there are texture maps for Redbeard on the Mecabricks workshop as well. In case you were wondering if there is anything that I did by myself. Yeah, we will get there wink But before we apply the diffuse textures, let’s start with a solid color.

diffuse

 

Reflections

Now this is the fun part. In part 1 we found out, that for lego plastic we would probably have these IOR values:

  • 1.6136 for Red
  • 1.5959 for Green
  • 1.5862 for Blue

Let’s feed our shader with these values. Sadly, there isn’t any noticeable difference, between those and a simple averaged 1.6 IOR.  bigsmile To be honest, my hopes weren’t that high that there would be a big difference – the values are just too close. The IOR split is more useful, or actually quite important, for metals but not really for dielectrics. Actually, an IOR of 1.5 felt better than 1.6.

ior_1_5

 

Nailing the roughness

This is a tricky one. Let’s do a wedge test and see what happens. The roughness 0.4 comes the closest to the minifigure in the photo. The problem here is, that in real life there is no such thing as a roughness value. It only emulates an imperfect surface. The specular highlight in our rendering is way too smooth compared to the real thing. So what we do instead is, we use a high-frequency noise triplanar as a bump map to mimic the microsurface imperfections and therefore we can use a much lower roughness value like 0.25.

 

Imperfections

While noise maps are always nice to get something done quickly, it still looks too clean and especially the specular highlight on his head screams CG. Let’s add a bump texture with lot’s of tiny dents to break up the surface. This helps, but we can still see this straight “line” on his face. Let’s replace our roughness value with a smudgy texture map. With the help of a color correct node, we can bring it into a similar range as our previous value but with additional variation. Again, this helps, but there is even more we can do.

rough_noise_breakup

 

Unevenness

What really differentiates a truly well-executed shading from something that was thrown together in 3 minutes is, when it holds up in many different lighting conditions. Let’s step back a second to a simpler shading to better illustrate this. Let’s see what happens when we point a light source directly at our model. This immediately reveals a big flaw. We get this big white ugly circular reflection. If we look at the reference, we see that our light source gets distorted on the torso. That is because the mold process makes it a bit uneven. Our model, on the other hand, is mathematically perfect.  We could do some modeling now, but because we are not crazy, we just use a second bump map. This time, a noise triplanar with a very low frequency.

Let’s turn our shader into a chrome like thing and turn off the roughness and the other bump so that we can really see what is going on. If we apply our low-frequency noise as a bump map now, we can see how the reflection gets nicely distorted. If we test this with our dielectric shader, we get this nice distorted reflection now, that looks a lot more like what we see in our reference. But we can push it even further.

If we look closely, where the torso and the hip meet, we can clearly see a break in the reflection. The torso was of course molded independently from the hip and has a completely different unevenness. Our noise pattern makes it look like the torso and the hip belong together. So what we need to do, is to offset the noise pattern on the hip to break up the distortion. We can do this with a user data vector node. This way we can still keep our single shader for all our pieces and we don’t need to create multiple ones.

 

 

Variation is key

Now, with our unevenness in place, it’s time to add our textures from our previous step back to our shading network. Another important concept is variation. We can find it everywhere in the real world, and surfacing is no exception. While we added large and small noise maps, smudges and dents, it would be great to add another element that looks completely different. How about long thin scratches scattered randomly onto our model? This texture is – again – from the Mecabricks model.

 

Edge wear

This is a great one. Edge wear is usually a relatively subtle effect. You usually don’t find this on brand new bricks, but it’s pretty noticeable on older ones. Over time lot’s and lot’s of dents appear on the edges of the bricks because we put them together so many times. This can be easily achieved with a curvature map. This way we can just apply another dent bump map to the whole shader and mask it with our curvature map.

 

Mold lines

Another piece to the puzzle are those mold lines we see on a lot of LEGO bricks. Since we still want to keep our single shader for the whole minifigure, I use a shader switch here and assign unique integer values to a custom attribute for every piece. If you use arnold or renderman you could use filename tokens, which is a bit more convenient. This way we can assign individual mold line maps to every piece. Those maps ship with the Mecabricks model as well. (Have I told you how awesome this thing is???)

Okay, enough bump map layering madness for now, we’ll come back later…

 

Fingerprints

In most modern shaders we have a secondary reflection lobe we can layer on top. We will use this one for fingerprints. We put the fingerprints texture (you know where I got it from…) in the weight channel so that we can use the IOR to control its visibility. I have no idea what the correct IOR for greasy fingerprints is, but if we look at a real brick, fingerprints are really hard to see and mostly appear on sides which are facing away from us, which suggests a low IOR value. Additionally, they are way more apparent if a light source points directly at it. We can mimic this behavior with a relatively low roughness value. If we look at the turntable (at the end of this post), we will see that the fingerprints only pop up at certain angles.fingerprints_layer

 

Diffuse – again

Now, this is the moment we have all been waiting for. Let’s assign our diffuse textures. I use the same shader switch trick here as for the mold lines.

color

 

Bump maps again

I promised it, we need even more bump maps tongue The prints are printed (surprise) on top of the geometry, which means they are slightly elevated. If we convert our color maps to black and white we can simulate this effect.

print_bump

 

Subsurface Scattering

Last but not least plastics have some SSS going on. It is relatively subtle and it’s not a deal breaker, but still very nice to have. One needs to be careful with this, though. The general rule of thumb is, if we can see the SSS effect it’s probably too much. All we need is some bleeding to soften the edges a bit. The radius is the most important slider here to get the scaling right.

beauty

 

Turntable

Aaand it’s turntable time smile

Does it hold up?

And this is a proof of concept with the CG Redbeard next to the real thing. I rendered this one with prman, and it has a slightly different setup. While the shader above is more procedural and could be universally applied, this one has a lot more individually painted maps, a separate shader for every piece, and specific adjustments to accommodate to the specific situation, but the overall concept is the same.

integration


Posted

in

,

by

Tags:

Comments

31 responses to “Exploring LEGO Material Part 2”

  1. Rob N. Hood Avatar
    Rob N. Hood

    Thank you for this article, I’m trying to make realistic Lego bricks in Blender cycles and I can tell this will be very helpful.

    1. Rob N. Hood Avatar
      Rob N. Hood

      By the way, which one is the CG Redbeard in the final image?

      1. stefan Avatar
        stefan

        Thank you. I am happy to hear that it is helpful!
        It’s the right one smile

  2. Dinesh Dumas Avatar

    WOW that’s super cool ! I’m a isart digital student in my third year, we have a 1 min lego movie project on arnold. I got Titanic (I couldn’t choose the movie). I built all the scenes. I’m a huge lego fan and I wanted to go further and make it photorealist instead of having a shitty blinn on my model. For a long time I wanted to tdo a project like that I’m getting into the surfacing now. Your work is a goldmine! Thank you so much for this ! btw I think Animal Logic is hiring for surfacing artist smile

    1. stefan Avatar
      stefan

      Haha thank you, man! Send me a link when you have it ready. Would love to see a Lego version of Titanic. Yeah I know, people keep telling me I should apply at AL. While I would love to work on a Lego movie, at the same time I very much like it here at MPC as well. smile

  3. Jimmy Avatar
    Jimmy

    Just wondering if you have a link to the model of Captian Redbeard.
    I searched Mecabricks, but in the shop area I only see 3 items for sale?!
    Thanks for the info, I might have more questions later if that’s cool?

    1. stefan Avatar
      stefan

      Hi Jimmy, I used the generic minifig found in the shop and mixed and matched it with the Redbeard specific parts from the Mecabricks workshop. You can also get the prints for the torso and his head there. You would need to adjust the texture layout though since the uv layout for the low res workshop minifig models and the high-res one does not match.

      And yes, of course. Feel free to ask anything smile

  4. Paul Avatar
    Paul

    This is a fantastic guide! I have redshift for Maya and have been trying to get my LEGO to look realistic. Can you share your node setup?

    1. stefan Avatar
      stefan

      Hi Paul,

      I would love to share my node setup, but the problem is, that it currently uses a lot of textures that I can’t share. Another issue is, that I only tested it on this minifig and I want to test it on a broader range of bricks first, because I am sure I need to do further refinements before it works on more types of lego bricks.
      I am currently working on part 3 for my lego material study. I’ll update this post if I have something that is good enough to be released into the wild smile

      1. Paul Avatar
        Paul

        Ah I see, well specifically what kind of textures did you use? I see that you must have had one for scratched and one for the microbumps and the rest seems like fractal noise. I am looking forward to part 3.

  5. Mike Avatar
    Mike

    According to this site (http://www.matweb.com/search/datasheettext.aspx?matguid=72a2464fccb14746903cd8533be5d125) ABS has Refractive Index, Average value: 1.54 Grade Count:7

    1. stefan Avatar
      stefan

      oh nice! Great find. Thank you very much smile

  6. Mike Avatar
    Mike

    Would you be able to share your rib file or shaders (without textures) ?

    1. stefan Avatar
      stefan

      Sorry, I bought the minifigure from Mecabricks. Therefore I can’t redistribute it.

  7. Sim Avatar
    Sim

    Hi,
    Can you develop more the shader switch for mold and diffuse through an attribute please ?

    Cheers

    1. stefan Avatar
      stefan

      Hey Sim!
      I’m not exactly sure what you mean. Since redshift doesn’t support string user data a shader switch is needed to change mold and diffuse textures on a per-object base. However, with Houdini, it is possible to do material overrides for any arbitrary value with redshift including strings (texture paths)

  8. […] you have read part 2,you might think, well that minifigure looks kinda nice and all, but what about good ol‘ […]

  9. Jordi Cortés Avatar
    Jordi Cortés

    Hi Paul,

    I have been texturing a lego minifigure this past days, and recently came across your post and decided to buy the same figure from mecabricks. The one I had been using was from there as well but came as a CAD file, so I had to retopo and create the bumps/displ maps, and wasn’t as accurate. My surprise came when I open the figure and it doesn’t have any UVs. Did that happen to you as well? Also, did you have to create the UVs from scratch?

    Thanks!

    1. stefan Avatar
      stefan

      My name is Stefan wink
      The minifigure from Mecabricks should comes with UVs. Multiple in fact. Most of the pieces have actually 5 or so different UV layouts. If you use the collada files, they should be there.

  10. Redbeard's Cove Avatar

    Amazing work! I have shared it on Redbeard’s Cove LEGO pirate page!
    https://www.facebook.com/permalink.php?story_fbid=238184237589667&id=109709893770436

    Thank you!

    1. stefan Avatar
      stefan

      Amazing smile That’s really nice, thank you!

  11. Ricardo Alzate H. Avatar

    HEllo. My Name es Ricardo Alzate. I am currently working with Autodesk Maya + Redshift. What I am doing is exporting from blender to maya using the FBX format. So far everything is fine, my problem is when I try to use the bamp, be it with procedural nodes or with textures, some of the character are strange artifacts like triangulated shadows. Has anyone had the same? Hopefully you can help me.

    1. Ricardo Alzate H. Avatar

      I solved it, I think the problem is that triplanar does not add the Bump node that comes before the Reshift Material.

  12. Ricardo Alzate Avatar
    Ricardo Alzate

    I just bought the Mecabricks High Poly model and as you mention in the article it is very accurate. I wanted to ask you if you used the UV edition that the default model brings, did you edit the UV? Or even if you used a triplanar node to avoid all this.
    In case you have edited the uv I would love to know what your final result was like.

    Thank you very much in advance for reading and answering each of my messages. I am a big follower of this forum.

    1. stefan Avatar
      stefan

      Hi Ricardo,
      Case by case. I use the UVs that come with the model for the prints and all the mold lines. Each piece comes with multiple UV sets (sometimes up to 6) so it’s important which one you choose, but then the print and/or mold lines should line up perfectly.

      For all the scratches/wear/dents etc. I’m using triplanar mapping so I can use my shader also on other LEGO pieces that don’t come with UVs and in general to avoid issues if different pieces have differently scaled UVs.

  13. Ruben BRAMI Avatar

    Hi Stefan ! This is not my first time watching this tuto but I want to thank you for your work ! It really helped me to do my own Lego in Blender.
    I’m trying to create my own Red Beard. Can you share what HDRI you used to light this seen ? I’m trying to have a perfect match between my image and yours to compare (I least I try 😅)

    1. stefan Avatar
      stefan

      Hi Ruben, I’m very happy to hear that it’s useful to you smile I used the walk of fame hdri from here: http://www.hdrlabs.com/sibl/archive.html
      But I additionally placed 1 or 2 area lights on the left hand side to make him pop.

      1. Ruben Brami Avatar

        Thank you very much for your reply !🙏

  14. Ethan Avatar
    Ethan

    Hello, is there a way you can send a link to where you bought the bump and roughness textures, or was it all made by you?

    1. Ethan Avatar
      Ethan

      Oh, what I meant by the bump is the dent bump map, by the way.

  15. … [Trackback]

    […] Information to that Topic: stefanmuller.com/exploring-lego-material-part-2/ […]

Leave a Reply to Redbeard’s Cove Cancel reply

Your email address will not be published. Required fields are marked *