The Anti-Entropy Machine

By Shamus Posted Friday Sep 10, 2021

Filed under: Projects 45 comments

This was a mistake. I knew it when I did it. But sometimes we’re slaves to our obsessions and you don’t have any choice but to make mistakes and hope you can escape the consequences.

(I did not escape the consequences.)

When you’re learning something new – 3D modeling, carpentry, programming, filmmaking, baking, etc. – then the thing to do is to take on many small, quick projects while you’re learning the ropes. If you’re learning to draw, then you should probably start with a small sheet of paper and not try to make a mural to cover the side of a building. You’re going to make a lot of mistakes at first, and it’s best to make them quickly, learn from them, and move on. The stuff you draw in your second hour will be much better than your first, your second day better than the one before, and so on. If you start with a mural then by the time you’re halfway done you’ll have progressed so far that you’ll no longer be satisfied with the first stuff you drew.

My first few Blender Renders reflect what you’re supposed to do: Make something simple, iterate on an idea, get it done, and move on. But then I started making gears and I was really into the idea of making this crazy clockwork machine that moves marbles around. This is the result:

Link (YouTube)

Normally I’d put music over this to hide the uncanny silence, but I’m SO done with the project at this point.

Let’s talk about the problems…

You can see I stuck to my initial idea at the beginning. There are beveled gears, inset gears, a rack-and pinion setup, and a couple of different tumblers that were driven by gears that were driven by a chain. That part is fine. But then the project started to get away from me. The scene got to be frustratingly complex. The physics simulation slowed down my PC and made testing slow. Work got slower and slower. By the end I’d spent way too much time on it, I was sick of the whole thing, and I was left with a half dozen little annoyances and broken bits that were keeping me from finishing.

By the end I’d moved away from setting up complex gear animations and I was just building simple ramps for marbles, just to get it over with.

Finally I just gave up and rendered what I had.  Towards the end you can see holes and gaps in the scenery, the lighting is flat, and several scene elements are floating in space with no means of support. The pacing is a mess and it all drags on for much too long. If I wasn’t so sick of the project, I’d edit the thing down to thirty seconds of the best bits.

What I’m Happy With

I think it was a good call to build the thing around the idea of colored marbles on flat white scenery. From experience, I knew that trying to texture the world would result in me chasing my tail forever. You can spend a ton of time crafting special shaders and materials, and that’s a road that leads you inexorably towards the thankless time-sink that is photorealism.

Hm. This chrome texture is too simplistic for my gears. They would look better with slightly rusty metal.

(Hours later.)

Okay, the metal texture finally looks good now. That took a lot longer than I expected! And now I think the lighting looks off. It was okay when the walls were white, but now these metal textures need more light, and they need light that comes from specific angles so I can really show off the brushed metal.

(More hours pass.)

Arg. Okay, I think I finally have the light levels balanced. And I’ve created apparent light sources so the light is coming from part of the scene. And I have the black levels balanced to provide good contrast without losing any details in the shadows. But now these ramps need a better material.

(More hours pass.)

Okay, I have different materials on the different parts of the scene, but now I see that the woodgrain texture looks wrong on the ramps. The grain is going in different directions on different faces. I need to unwrap this and manually set the UV values.

(DAYS pass.)

Now the scene is starting to look photorealistic, which means some of these simple objects look goofy and fake. I need to re-make them.

(More days pass.)

Okay. I guess it all looks mostly okay. Although there’s still something off about it. Do I need a gloss map? More subtle specular highlights? Maybe a bump map taken from reference photos?

The flat-white look was a good way to save me from that trap by limiting the number of different concepts I’d need to learn. I could focus on modeling, animating, and physics, while ignoring lighting, shaders, textures, and UV wrapping.

Also, I still like the trick at the end where the balls magically sort themselves. I realize I’ve told this visual joke before, and I’m the millionth person to tell it. But I still enjoy watching the last few fall down, creating order from (seeming) chaos.

I like the marbles. I like the rainbow colors and the way I was able to create all of those different patterns using Blender’s procgen textures. (Okay, this means I dabbled with shaders a bit. But this was kid’s stuff and not the rabbit-hole of photorealism.)

I like that first batch of machines, from the initial tumblers, to the mixer, to the gate that moves back and forth. That’s a fun 45 seconds.

What I’m Not Happy With

Conceptually I divide the set into three sections: The machines at the start, the “basement” area with the conveyor belt, and the final Galton board. I’m really only happy with the start and end. I think the entire basement should have been tossed out, and the other two sections should have been shorter.

The conveyor belt was a complete nightmare. So was the chain turning the gears. There are a ton of tutorials on YouTube showing you how “easy” it is to set up a “working” conveyor belt in “just five minutes”. These tutorials have someone throwing the whole thing together at the world origin. It seems so easy.

But if you want to build away from the origin? Well, there are a lot of wrong ways to do that, and these videos don’t tell you about it. Also, things get a lot more complex if you want the conveyors to use looping animations and you also want physics objects to ride them. That stupid ugly conveyor in the basement? With nothing driving the belt, nothing holding it up, and no coherent lighting? I spent an entire day getting that ghastly thing working.

It’s nobody’s fault, really. The tutorials aren’t bad. It’s just that in a system this complex, there are four mutually exclusive correct ways to do something, and fifty wrong ways to do it. Even if a tutorial shows you the correct thing, it’s not always clear why it’s correct or what other options might break it.

Early on, I decided that I was going to embrace a deliberately low-poly, flat-shaded look. But then I drifted away from that and started using smooth shading, and in the end the flat-shaded stuff just looks ugly and primitive.

In terms of layout, I really did make things hard on myself. I had the action take place in a small room, flowing counter-clockwise along the outer wall. The plan was to have all of the stuff connected so that the gears for one thing were also driving the machinery for the next thing. That’s good as a concept, but I didn’t start with a layout or plan in mind. I just started placing gears and decided to wing it. In the end I had all the drawbacks of having everything packed into a small space, but without the interconnected design that would make it worth the trouble. You could take the existing machinery and have it travel in a straight line along a single wall without losing anything in the process. The result would be about ten times easier to work on, for basically the same gag.

(Yes, I know about collections, and I know you can hide collections of objects. I used that extensively. It helped, but it couldn’t save me from my own lack of planning. I still wound up with the problem where I’d need to hide a bunch of machines just so I could see what I was doing. But then I’d build new stuff that overlapped with the existing machines because they were hidden and I misjudged how much room I had to work with.)

A WEEK. That’s how long I spent on this three and a half minutes of animation. I should have gone smaller and simpler, gotten it done in two days, and moved on.

Ah well. Those first couple of days were fun, and I did manage to learn the stuff I set out to learn.

After this boondoggle I aimed much lower, and just did the famous donut tutorial that Blender newbies are supposed to start with:

NO! Some of the sprinkles intersect and it's driving me crazy!
NO! Some of the sprinkles intersect and it's driving me crazy!

That took about an hour, which is much more in line with the sorts of things I ought to be doing at this point in the learning process.


From The Archives:

45 thoughts on “The Anti-Entropy Machine

  1. ydant says:

    This is really cool – thank you for sharing. I think if you added some music you’d probably have a chance at getting a decent amount of views on youtube, especially if you cross-posted on some key subreddits. Obviously not why you did this, but it never hurts. You should be proud of this effort.

    The physics of the balls seemed “off” the entire way through – they fell too slowly, didn’t quite bounce at times, and sometimes get pinched(?) and fly off with massive speed – by the end my mind decided they were air filled beach balls (although the pinch acceleration doesn’t seem to fit). Is the physics a standard “earth normal” style of thing, or did you tweak that?

    Also, what prevents the balls from rolling off of the tread/conveyor belt? A few got right to the edge, but didn’t fall. Did you just tweak it until it was it “just wide enough”, or is there something more at play?

    The final payoff is definitely worth it – it’s really satisfying watching the balls sort. Even knowing the mechanism (listened to the Diecast about it), it still has a really tense feel to it. I think you could skip some of the middle part of the machinery/video and even give a bit more time to the sorting – it’s definitely oddlysatisfying territory.

    I don’t need more things to dive into and obsess over, but you’ve made me want to try Blender.

    1. Drathnoxis says:

      Putting the video at double speed makes the balls look like they behave a lot more naturally.

      1. Philadelphus says:

        Yeah, I just tried it, and they suddenly look convincingly like rubber super balls.

    2. Shamus says:

      Another mistake I made: The balls are all 1m, which is why the speed feels off. As far as physics is concerned they’re not marbles, they’re bowling balls. (And then some.)

      There are some invisible walls keeping stuff on the conveyors. I intended to make some sort of guard rail, but then I came to my senses. :)

      1. ydant says:

        That explains the “thud” when they land.

        But then the pinch-launches are even more impressive. That’s a lot of mass flying off.

        Overall they definitely feel more like wiffle balls or beach balls, but it generally works fine. I don’t think that impacts the quality of enjoyment of the video for someone who isn’t well versed in modeling this sort of thing.

        While I’m sure all of the problems are blatant to experts, that’s always going to be the case.

        A week of effort feels about right for what you produced and learned. Hopefully you can use this to make some more programing style articles about the process.

      2. Randint says:

        I think the main issue with the scale is that there’s no real frame of reference for the viewer. Without any direct reference, I think the viewer subconsciously uses the size of the room under the assumption that it’s a normal room, which is a problem because if those are 1m spheres then that room is actually a massive multistory warehouse.

        As a result the viewer looks and thinks that those gears and conveyors at the beginning are a few feet across, when really they’re massive multi-story gears, and the machine occasionally drops balls the equivalent of 10-20 feet as part of its operation. I think that having the balls pass by some doors and a maintenance catwalk towards the beginning would help with those issues.

        1. Syal says:

          I think it’s better not to draw attention to that; none of it requires things to be huge, and it’s got a very “candy-making machine” zoomed-in vibe to it that’s going to be undone by pointing out the scale. Leave it for the comment section to notice on their own.

  2. Darker says:

    So, how does the sorting trick work? Do you run the simulation backwards with inverted gravity or something similar?

    EDIT: Never mind, it turns out I am one the readers that rarely listen to Diecast :)

    1. ydant says:

      I’m not 100% on the specifics, but generally:

      Blender lets you run the simulation once and then lock all future renders to the same parameters so everything happens the same way every time. Then you assign the balls their colors based on how they ended (will end) up in the simulation. Then re-run.

      Fun little trick.

      1. Richard says:

        One of those rare cases where time travel makes life easier.

  3. Drathnoxis says:

    Honestly I thought it was really cool. The only thing that looked just wrong was the polygonal shafts on the worm gear by the conveyor belt. They obviously weren’t spinning at the same speed as the gear and it was quite distracting. Just replace them with a cylinder and add some music and it’ll be perfect.

    1. Syal says:

      I think there’s an obvious choice for music.

      1. Sabrdance says:

        I has going to suggest Wintergatan’s Marble Machine. Although I guess my mind doesn’t like silence -I heard music when it was playing (nothing fancy, mostly just plinking on a piano), and it took me a moment to realize it was actually the A/C in my office shuddering.

  4. Lino says:


    That’s how long I spent this three and a half minutes of animation

    Should be “spent on”.

    As for the project itself, it was quite fun to watch. And I actually laughed out loud once I saw where it was going!

    Although, I also think you should have slapped on some music, even if it doesn’t exactly fit. It would make the video an easier watch for a potential non-blog-reader.

    1. Socks says:

      That was awesome. Very impressed with the skill and creative ideas throughout. Thanks for sharing!

  5. Ninety-Three says:

    All this prompts an obvious question: What are you learning Blender for? Did you randomly decide it seemed like the kind of skill that would be cool to have or is there a project in mind?

    1. Shamus says:

      I use Blender once every six months or so as part of a Unity project or whatever. But I always end up stumbling around because I don’t really know how to use the program properly, but don’t want to stop working on the Unity project to learn Blender. Basically, I only ever use the program when I’m trying to do something else and can’t give it my full attention. So I thought it might be fun to just learn the dang thing.

      Also, I haven’t really done any real 3D modelling since the late 90s / early aughts, and I was feeling a bit nostalgic. Why not revisit the fun of my old job, only using a tool that’s ten times better on a computer that’s a thousand times faster?

      I doubt this will last long, but hopefully the next time I need blender I won’t have to Google all the hotkeys and waste an hour hunting through menus just to do something simple.

      1. Lino says:

        Why not revisit the fun of my old job, only using a tool that’s ten times better on a computer that’s a thousand times faster?

        If you’re ever strapped for retrospectives, you could consider doing one called something like “Modelling in the 90’s sucked”, where you compare Blender’s capabilities with the equivalent software you used back in the 90’s/early aughts. You could even make it like a challenge where you try to do the same (simple) project in Blender, and in whatever it was you used to use back then.

        Not only will it be a fun to see how far things have come, but it could also be educational for readers like me, who don’t know all that much about the finer details of animation.

        The animation challenges people faced in the 90’s were quite rudimentary compared to the ones we have today, and are something relatively easy to wrap my head around. That could serve as a good building block for understanding the problems animators face today.

        Also, making fun of 90’s 3D never gets old!

      2. Richard says:

        I have exactly the same problem, it’s maddening but I don’t foresee any future time that I can actually dedicate to learning Blender.

  6. GreyDuck says:

    Ah, the Blender Guru Donut Tutorial. My final exam piece came out… okay, I guess? I kind of miss futzing around in Blender, but I came up against a pretty big mental block AND the pandemic hit THEN the video card in my new computer crapped out long before its time so I’m back to the old one… ugh. I gave up.

    (My other “self improvement” project that I started at the same time as learning Blender? Breadmaking. A few months after I started that, I found out I’m diabetic. WHOOPS.)

    At any rate: I really liked your camera path through the machine, though you’re right about some of the pacing. Once you know that the “sorting” illusion is happening, though, you can’t help but watch and think, “Now how is THAT one going to end up OVER THERE?” and it’s kind of fascinating.

    Maybe someday I’ll try to afford another good video card and pick this stuff up again. Maybe.

  7. Geebs says:

    That’s weirdly relaxing to watch. Seriously, just stick ASMR somewhere in that video’s title and you’ll get 55 million views and some sort of commemorative plaque from YouTube.

    1. Mr. Wolf says:

      Every time I read “ASMR”, I think “ASMD”. Also relaxing, but not something you’d want to find on YouTube.

  8. RamblePak64 says:

    Even with your specific reasons for it, I find it admirable that you just are capable of working on things and picking up skills like this. It leads me to feel lazy in comparison. Oddly enough, it had me thinking on how I wanted to make my own Minecraft skin (I just got it, well over a decade after it is the new hotness), which led me to thinking about how I tried making my own sprite art in middle school when I found an amateur RPG maker program online, and now I’m contemplating learning how to sprite art.

    So, if I end up learning how to sprite art effectively, I’ll have you to thank as indirect inspiration. So I guess there’s some solace to be found that, even when spending a week on something that inevitably gets you tearing your hear out, it’s having a positive effect on your audience to see the output.

  9. bobbert says:

    I enjoyed the video.

    Maybe this says something about me, but I found the colored orbs to be distracting. I would rather that they had been removed entirely, so the movie could have more deep close ups on the gears. Many of the gear pairs seem to be poorly mated and periodically come in and out of engagement. On repeated viewings I was unable to tell if the RPMs of the driven gears realistically fluttered up and down. (those orbs are very distracting)

    I guess all of this was a very long winded way to say, “I am a very boring man and like CAD more than art.”

    Overall, Shamus, thank you. I hope you do more with gears in the future.

  10. John says:

    Oh, that’s neat. For all that you may be unhappy with it, I think it looks very nice.

    Polish is my least favorite part of any software project. By the time I get a program or a game into a functioning, reasonably feature-complete state, my patience and my energy have usually been exhausted. If the program is for my own use, I’m not likely to care if it’s a little unpleasant to look at or a little awkward to use. I recently completed a small game prototype with the world’s least-inspired title and score screens (which consist entirely of plain text rendered at a scale totally unsuitable for the bitmap font I’m using) and I can’t see myself changing them any time soon. All this is to say that I respect your decision to limit the scope of your project and declare it complete.

    Incidentally, thank you for mentioning the invisible walls in your reply to Ydant. At first I thought you’d simply gotten lucky with the physics simulation. It wasn’t until the final conveyor belt segment (starting at around 1:25) that I started to get really suspicious. If Ydant hadn’t asked you what was going on, I would have.

  11. maxoverdrive says:

    The ending contrast with the long but fascinating to watch (the first time) ‘random particles flowing through an environment’ simulation totally paid off, and I feel like the 3 minutes wasn’t too long. The camera could move faster, but you’d lose the deliberate ‘random motion’ and the ending ‘order from discorder’ contrast would be lost a bit.

    100% didn’t notice any flaws.. even the ‘stuck balls’ in the last bit just added to the realism. (Tilting the board a bit so they aren’t falling straight ‘down’ might prevent that?)

  12. zackoid says:

    Do I recall correctly that there’s a Captain Disillusion episode that explains the sorting trick? Shamus, you’re probably familiar with his youtube channel, but if not, you’d definitely enjoy it.

    1. Dreadjaws says:

      Ah, so that’s why that bit looked so familiar! I remember that video now.

      Here it is, for the curious:

    2. Amstrad says:

      Shamus specifically mentions Captain D in the most recent Diecast episode where he discusses both this render and a previous one he put together with just the Galton Board trick.

  13. Dreadjaws says:

    I found the whole video mesmerizing. I understand that after days of work all you see are flaws and problems, but from a watcher’s perspective it looks great. Just add some music to it and it’s the sort of thing I’d watch for a bit of relaxation.

  14. baud says:

    I like the trick of having the balls’ color set depending on the bucket where they fall at the end. At first I though you were cheating by changing the color of the balls when they arrived, but then I realized the simulation would be deterministic and so you’d be able to know where each ball would arrive

    1. Syal says:

      And here I was thinking the balls in the Pachi — er, Bean — Machine were magnetized to their ending locations, and would choose paths that got them to their goal. I guess this way is easier.

      is it easier? How easy/hard would that be to program?

      1. Philadelphus says:

        Based on playing around with Blender’s particle simulations several years ago (which is a different system than this physics simulation, I think), you could maybe do it by using multiple particle systems for the different colors and creating simulated forces (I think there might be a literal “magnetic force field”) that act only on a single system, while also having other fields that act on all of them. Run the simulation and all the particles will react the same until they get within some defined range of their individual attractors, which will separate them out. Might be an interesting project to try.

  15. Your Diecast mention of your project caused me to spend about a day exploring it myself. My own exploration was just 2D, though I wrote the physics engine and renderer myself. Here’s a sample video of the result, and my source:

    My original plan was for the bins to be bottomless and for the machine to run endlessly. To determine the colors correctly, the program would run two instances of the same simulation concurrently separated by some number of seconds, with the front simulation informing the back simulation what colors to use. However, instead I punted on the color sorting part and settled for a live plot of the distribution.

    1. John says:

      I am sorely tempted to imitate you. I wrote a little elastic-collision simulator not too long ago. All I’d have to do would be to add gravity and fix a few objects in place and–nope! Uh-uh. Gotta remember that I have too many projects already.

  16. DaveMc says:

    Sir, I’m gonna have to ask you to step away from the device and show me your license and registration. We’ve got some serious Second Law violations, here …

  17. Philadelphus says:

    Wow, that’s pretty incredible for a “first project”. I’ve used Blender in the past, so I have at least some inkling of the amount of work that must’ve gone into that. Watching it with no music was strangely relaxing for a Saturday morning, and definitely satisfying watching the colored balls and wondering how they’d end up waaaay over in the right bin. The flat matte white with varicolored spheres was also pretty neat, aesthetically.

    On the topic of “big first projects,” I did something similar when I took up painting back in 2018 where instead of doing a bunch of little projects first for practice I jumped right into a large 80cm×80cm landscape piece (which I think is still the largest painting I’ve done). At least it came out well overall—I can see how I improved over the ~3 months I spent on it, and I’d definitely do things a bit differently now, but I still quite like some aspects of it.

  18. The Rocketeer says:

    Wow, PREY looks awesome

    1. Mr. Wolf says:

      Looks complete balls to me.

  19. bobbert says:

    Also, I agree that the physics-defying sprinkles are creepy.

  20. unit3000-21 says:

    Great, now I really want a donut :(

  21. Paul Spooner says:

    If you’d like to fix the sluggishness from the ball size, all you need is to increase the gravitational acceleration. Or scale the whole thing down. Or change the “Speed” of the simulation.

    There’s lots you can do to optimize the physics simulation too. I’m guessing you’re using the “Convex Hull” or “Mesh” collision shape? Did you bake the physics?

  22. A WEEK. That’s how long I spent on this three and a half minutes of animation. I should have gone smaller and simpler, gotten it done in two days, and moved on.

    The unintended shade being thrown at animators in this statement!

  23. Echo Tango says:

    Re: wood textures.

    That’s actually easy to have coherent wood textures on objects, if you just use volumetric textures instead of surface ones. That was literally one of my projects in university a decade and a half ago, and we generated the wood grain at program start too. Could have used shaders to do it on the fly too, but I think those were only becoming available a duffle years later. :)

  24. Jack V says:

    That’s very cool!

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun. Your email address will not be published. Required fields are marked*

You can enclose spoilers in <strike> tags like so:
<strike>Darth Vader is Luke's father!</strike>

You can make things italics like this:
Can you imagine having Darth Vader as your <i>father</i>?

You can make things bold like this:
I'm <b>very</b> glad Darth Vader isn't my father.

You can make links like this:
I'm reading about <a href="">Darth Vader</a> on Wikipedia!

You can quote someone like this:
Darth Vader said <blockquote>Luke, I am your father.</blockquote>

Leave a Reply

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