Exploring LEGO Material Part 3

The classic 2×4 brick.

If you have read part 2, you might think, well that minifigure looks kinda nice and all, but what about good ol‘ classic bricks? And what happens if we go even closer, so we can see all the micro details?

Taking it to the next level

Please pardon me if my blog posts are not completely straightforward. Part 1 is a bit more theoretical and part 2 more practical. In this 3rd part, I want to revisit everything and see if we can improve upon it. This means that there might be some overlap, but since I am learning at the same time as I am typing this, I hope that this is alright.

Angles matter

We already know how important the viewing angle and the light position is. While inspecting classic LEGO bricks more closely, I took some pictures which show the fresnel phenomenon and light interaction in general quite impressively.

This is the very same brick from 4 different angles

Did I nail it?


CG vs photography – brick on side

CG vs photography – brick upside

This is the final result. While building the shader, I constantly switched between the two photographs and I tried to match both of them at the same time as closely as possible. This was a good quality check for myself, to see if the shader would hold up with different viewing angles.

LEGO Shader Breakdown

The brick we are looking at is from my parents’ attic which I used to play with in the mid-90s. What we see here is an honest example of many many years of wear and what happens when a kid is not too cautious with their toys. Everything annotated below is what we already discussed in one of the previous blog posts. Let’s stack up all these effects one after another. While doing so there will be some new discoveries/techniques in it that weren’t in the previous posts. We will take a closer look at those findings.

Since I got asked quite a lot what my textures look like, there is now always the texture map right next to it. I also included links where I got the textures from – whenever I didn’t create them myself. This should allow you to to build your own LEGO shader.

What we discovered so far

Red Diffuse Brick

BRDF: GGX vs Beckmann

GGX is known for its hot core with a long tail. It got quite popular in recent years – especially for metals. While being more expensive to calculate, the added fidelity is easily worth it. Looking at our photo reference, the hot specular highlight with its long falloff is quite apparent.

Beckmann

GGX

Smudge and Fingerprints as Roughness Map

This has been covered in part 2. The tricky part here is to grade the roughness map, so it has an overall very low value but has still enough contrast to create variety.

🔗 smudge texture – corneliusdammrich
🔗 fingerprint textures – https://texture.ninja/

Grease

Even though we use GGX, it feels like there is an additional veeery broad long falloff. The side facing the light is considerably brighter/paler than the stud side. An additional very subtle coating/reflection layer can help to simulate this kind of grease.

overall high roughness value so we don’t create additional highlights.

🔗 grease texture – https://cc0textures.com

Subsurface Scattering Revisited

In part 2, I stated sss would be ‘nice to have’. Let me rephrase this to: ‘SSS is absolutely essential’. Looking at the edges of the brick, we can see the red-yellow color shift quite easily. When comparing the two renderings with and without it, it almost looks like a model change because the edges got so soft. A good quality check is to expose up the reference and the rendering to see if the color shift matches. The sss brings us a big step closer to our photograph.

brick side diffuse
brick upside SSS
exposed up rendering – diffuse vs SSS
brick upside diffuse
brick up SSS
final result – CG SSS vs photography

Displacement vs Bump

I think we all agree that displacements are always better than bump/normal maps in terms of realism. I didn’t really bother with displacement maps yet, because I thought LEGO bricks would be too tiny and it wouldn’t make any real difference. While this might be true for a complete set, looking at our pirate from part 2 again, it becomes clear that, no matter how many bump maps we throw at it, the geometry, especially the silhouette will always look perfect. And yes, LEGO is extremely precise and that’s one of the reasons we love it so much, but it’s not mathematically perfect. The edge wear is the most obvious candidate that would benefit from being displaced since it’s modifying the edge and therefore becomes visible in the silhouette.

a simple noise texture with sparsely spreaded dark areas to simulate scrapes/dents. It might be helpful to mask this to edges with a curvature map.

Unevenness

The unevenness helps to deform our perfectly circular highlights. This is discussed in part 2.

very subtle broad noise texture

Micronoise

micronoise to get rid of the perfect roughness cg look. Also covered in part 2.

highly frequent minute noise

Vertical Stripes

I’m running out of names for all those bump maps, so I decided to call this phenomenon ‘vertical stripes’ Any better suggestions? I was able to take some pictures showing this effect quite drastically. Not exactly sure why certain bricks have it, but with a heavily stretched noise texture this one is easy to mimic.

stretched noise texture masked by a ramp

Microscratches/Spiderwebbing

This is something probably everyone has already seen a million times, but for some reason, I never really bothered with it. However, the more I am inspecting it, the more I love this phenomenon. While scratches on a surface are usually completely random, it looks like they would have a radial flow around hot highlights. That’s because those scratches are in fact tiny cuts into the surface and thus the outer walls inside those cuts catch the most light, creating this illusion. This is especially apparent on metals, but also on our favorite plastic toy.

There are 3 main ingredients to make this work.

  • A lot of very thin, long random lines packed together on a texture
  • No filtering/mipmap whatsoever for the texture (high res)
  • super low bump strength
very dense high resolution fine random lines

Broader/Thicker Scratches

additional variety, as seen in part 2
sparse thick random lines

Dents/Scrapes

aaand even more variety, as seen in part 2
heavily graded, cleaned up texture so we only get a few of these deep dents/scrapes

🔗 dents/scrapes/random wear texture – corneliusdammrich

Dust

One thing I ignored until now is dust. It seems this is also something that hasn’t been done for the first LEGO movies either. However, for The LEGO Movie 2, it is an important design element/cue for the story and it greatly supports the scenario. On newer bricks, you can actually see the individual dust particles as they settle onto the bricks over time. The only way to recreate this would be to actually simulate particles/curves on our LEGO geometry and render them. This is something I definitely would love to explore at a later stage.

However, looking at our old brick reference again, the dust looks a bit more “baked in”. This can be achieved with shading/textures, I think. Additional tiny hairs/fuzz can help to break up all those little random dust particles/points.

Dust Layer

There are probably multiple ways of implementing this. I think it would make sense to implement this as a separate layered shader. That way we have full independent control over it. If we mask it with a triplanar projection in the Y-axis, we can make sure that the dust only settles on the normales facing upwards. For larger scale sets, we could also mix in an AO as a supporting mask.

dust especially around studs where it’s hard to clean up with your fingers.
accumulated dust around studs, with random sparkles and additional tiny fuzz/hairs

🔗 dust textures – https://blog.spoongraphics.co.uk

That One Special Stud

Another little detail is the little circle on top of one stud. Every brick has one of those. I guess this is where the liquid plastic gets injected into the mold? This is something I modeled in.

Conclusion

That’s it for part 3! This post was – again – far longer in the making than I intended it to be. I think the main takeaway here is, that it’s important to get the fundamentals right. I was trying to render big LEGO sets and I just wasn’t completely satisfied. I realized, that I still didn’t know enough about plastic shading to pull off a believable rendering. So I decided to go back to square one and try to nail a single brick to really understand what is going on.

There are still a lot of things I haven’t looked into too much, like slopes, transparent bricks, rubber for tires and cloth for sails/flags. Well, I guess, lots of opportunities for more blog posts to follow smile


Posted

in

by

Tags:

Comments

31 responses to “Exploring LEGO Material Part 3”

  1. jonah Avatar
    jonah

    could you post an image of the ending node setup for reference:)
    thanks for the great blogs love them do much!

    1. stefan Avatar
      stefan

      Hey Jonah!
      I have done some further rework of the shader and plan to post a video/breakdown of it soon smile

  2. Timbit Avatar
    Timbit

    Hey Stefan, awesome study! It’s definitely a good read and helps a lot in recreating a shader like this. Just like Jonah says: a node setup or values would help even more to fully get the head around the shading. Like SSS values for example: I don’t feel I get it right while I am trying recreating a plastic shader for LEGO.

    1. stefan Avatar
      stefan

      Hi Timbit!
      Thank you very much smile
      I’m not sure how useful a specific value would be. Depending on the units, the renderer and the specific shader somebody is working with, this might vary a bit. However I did some further work on my Material and I plan to post a breakdown soon. I hope that will help smile

  3. Michael Avatar
    Michael

    What renderer did you use ?

    1. stefan Avatar
      stefan

      I used redshift. But it should be possible to get similar results with every modern physically based renderer.

  4. Mike Avatar
    Mike

    Great research from you. And thanks for this great adventure on how LEGO sets look and how you replicated it. Please I want to render a lego set, and I want to know in rendering the LEGO figure did you put textures on each piece to get those details or you merged the pieces. I wanted to know wether I have to change the properties for each brick or just an overall shader will do.
    Thanks.

    1. stefan Avatar
      stefan

      Hey Mike,
      Thank you for the kind words smile
      I use the same base Material for every LEGO brick, however, I’m using material overrides for a lot of individual bricks. So the original material would look different depending on the specific bricks it’s applied to. For example, a minifigure’s hat or wig is usually much much rougher and has a stronger bump than its head. You can even feel it when you scratch over it with your fingernail. So for a convincing shading, it’s necessary to adapt the base Material properties to the individual brick’s qualities.

  5. Elliot Avatar
    Elliot

    Incredible. Any pointers on getting better at this sort of thing? Or is it just keep trying haha. Can’t wait to see what else you create

    1. stefan Avatar
      stefan

      Haha, it’s really just keep trying. I created the first LEGO material study post back in 2016 and I’m still improving it to this day tongue

  6. Niels-Peeter Avatar
    Niels-Peeter

    Hy great work

    are you planning to release the shaders
    i can’t figure this out i am on c4d and redshift

    1. stefan Avatar
      stefan

      Hey!
      Thank you very much smile
      I work with Houdini, so releasing the shader might not be a great help for you. However I’m planning to do a more detailed breakdown, hopefully, that helps to recreate it for yourself in c4d!

  7. Ricardo Alzate H. Avatar

    Reading various articles on the Animal Logic website and works by independent 3D Artists Lego Digital, Finding the Bricks Exported from programs like Lego Digital Designer, Studio 2.0 or Mecabricks are not fully optimized for production within Maya. So I wonder what the topology would be more correct or closer to what is being worked on at the cinematographic level? Any comments can be very helpful. Thanks in advance.

    1. Ricardo Alzate H. Avatar

      Reading various articles on the Animal Logic website and independent works by 3D Artists, I find that the bricks exported from programs like Lego Digital Designer, Studio 2.0 or Mecabricks are not fully optimized for production within Maya. So I wonder what would be the most correct or closest 3D mesh or topology to what is being worked on at the cinematographic level? Any comments can be very helpful. Thanks in advance.

      1. stefan Avatar
        stefan

        The topology from the Mecabricks bricks is not perfect, but for the most part pretty decent. The raw output from LDraw is not really that good, since the format is quite dated. However, this blender plugin does an incredible job at cleaning up the raw LDraw geometry and it’s even possible to add more subdivisions and bevels.
        https://github.com/TobyLobster/ImportLDraw

        Mecabricks or LDraw with the help of that plugin should be sufficient for everything medium close up. However for actual close ups, I find myself often refining the geometry to be able to subdivide it so that it holds up.

        1. Ricardo Alzate Avatar
          Ricardo Alzate

          Thank you very much for your answer, if indeed until now I am using Mecabricks, converting to fbx in blender and then finishing my work in Maya and Redshift. Since when using other formats such as obj or stl the geometry is very triangular. However, the FBX has a problem, it is that the faces are not welded to each other, this works for bump, normal and corner maps, but not for displacement. I don’t know what I’m doing wrong or what I’m missing, anyway from your comment I’m going to try Ldraw. I would like to take the opportunity to show you some of the work that I have been doing. https://www.artstation.com/artwork/v2EqPD

          1. stefan Avatar
            stefan

            Hey Ricardo!
            That looks pretty cool. What I’m wondering is, why the atmosphere changes per light type? I think one would expect to have similar density/cloudiness everywhere for a small LEGO model like this. It might be nice if those strong beams on the front would also be broken up a little like you have done it for the back. And all the other tiny lights might also benefit from a tiny bit of light scatter around them, so everything looks more like sitting in the same world.

            For the vertex issue: yeah, for some reason I often have issues with that with geo coming from blender. sad However you should be able to weld them relatively easy in Maya. Forgot the exact name of the button, but there is an autoweld that merges vertices that are close enough to each other, defined by a threshold.

          2. Ricardo Alzate Avatar
            Ricardo Alzate

            Hi Stefan.
            I am not exaggerating when I say that I am very excited that you took some of your precious time to view my humble work. I will take into account all the recommendations to continue growing as an artist.
            Regarding the lego fbx parts imported from blender to autodesk maya, I tried to weld them with the Merge tool, however that has some considerations. When all faces are loose, smoothing modifiers can be applied to make the brick teeth completely round. However, when the faces are joined, loops must be added so that the geometry does not deform more than necessary on certain edges.
            Something that does catch my attention is that the models that I export from Mecabricks do not have a bevel, so I have to use the corner edge option to add the bevel from the shader, while the LDraw models do have an edge included in the geometry. . Which of the two models do you like to work with?

            PS: In order to communicate with you I use a translator from Spanish to English, for which I apologize if there is any sentence that is not well understood. Again I must thank you for all your time.

          3. stefan Avatar
            stefan

            Hey Ricardo,
            Sorry for the late reply! Yeah, the way the bricks are modeled, it’s not always straight forward. As you said often it requires some manual hands on work to be able to subdivide them. https://github.com/TobyLobster/ImportLDraw
            This tool does a pretty decent job at cleaning up ldraw models. I use a mix of both. By default I usually go for mecabricks, but sometimes ldraw has models that are not available on mecabricks.

  8. M2m Avatar
    M2m

    This guy: https://www.flickr.com/photos/lego_nuts/ is using Mecabricks end exports to 3D Studio – his results are quite amazing. So I think Mecabricks’ bricks should be sufficient. Maybe if you talk about blockbuster cinema this might be not sufficient. But I think what matters more is lightning and texture then the level of detail of the bricks.

    1. stefan Avatar
      stefan

      Ya, I agree, for the most part, the topology is pretty good, only for real close-ups certain bricks might not quite hold up.

  9. itai Avatar

    Wow, great article, thank you!

    1. stefan Avatar
      stefan

      Thank you, I appreciate it smile

  10. Ben Avatar
    Ben

    Fantastic breakdown. I’m curious, did you create a HDRI to match the image lighting? Looks just like the photo smile

    1. stefan Avatar
      stefan

      Hi Ben! Thank you very much smile
      I wouldn’t call it an HDRI, I just captured a 360 spherical image of the room with my phone. I then augmented it afterwards and applied artificial dynamic range to it. Really a poor man’s “HDRI” at best haha bigsmile Unfortunately, I don’t have the equipment to do it on a professional level.

  11. Steven W. Howard Avatar

    This is such a game changer, Stefan! Thank you for the in-depth look. I currently use Octane with C4D, but will be getting and learning Arnold in a month or so. I plan on using Arnold for a future project and these tutorials will be key in achieving the realism I am looking for with my digital builds and animations. Thanks so much for this! You can check out my work here: https://www.flickr.com/photos/187560633@N05/

  12. Nick Avatar

    As a stretch goal – Try generating applying a brick displacement map to an organic model in Maya. Eg. Turn a terrain into a Lego terrain.

  13. LegoMe_TheOG Avatar

    Hey Stefan!

    Love your content! I was wondering if you’d ever make an in-depth breakdown of how you make these photorealistic LEGO materials. That would be great!

    Thanks again!

  14. nubnoobsly Avatar
    nubnoobsly

    I think that the details such as nicks should be less fine since dents in Lego from either shipping, handling, playwear, or teeth is normally pretty noticeable up close, whereas your bricks have very precise and small nicks and dents.

  15. lucas Avatar
    lucas

    Hello, this is such a great detailed tutorial! Can you sell this project? so that I can better observe and learn texture details?!!!

  16. Rufino Herrera Avatar

    Lovely article! If i may help, from the manufacturing point, the ‘vertical stripes’ are effectively ejection marks from the mold. Because walls of the mold have to be perfectly perpendicular, they leave a mark in some bricks when they are extracted (ejected) from it. Usually plastic molds have a slight angle in its walls cause it helps air to flow back in the mold, so there is no vacumm, and there is no friction neither. But Lego bricks by design had to have these vertical walls (as a compromise, inner walls *do* have a slight inclination).
    And yes, that ‘special’ stud has that mark because the reason you mentioned.
    The Engineer Guy has a wonderful video about this (look for ‘plastic injection molding’) in Youtube, I hope you find it interesting if you have not discovered it yet!

Leave a Reply

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