Category: Blender

  • Blender part 9 – GameDev III

    Blender part 9 – GameDev III

    Orc painting!

    Last time, I had made a nice looking orc1.

    The next stage was quite complex and not very visual for blogging purposes, except that the end result was obviously an image. It involved baking textures and it’s why we spent time on getting the musculature and the facial features right. It’s all to do with poly count.

    The number of faces (polygons) in a model is an important factor in 3D modelling. The more faces you have, the better your model will look. The drawback is that these polygons take some time for the computer to calculate. This slows down your work and can result in the computer crashing.

    By way of illustrating this, the face count for the model shown at the end of the last section and below was 14.5 million and a file size of 160 MB. By baking the textures onto a lower poly duplicate of the original, this comes down to 47,000 faces and a 64 MB file.

    Two orcs, one white the other painted.
    The unpainted orc on the left as 16 million polygons, the painted one on the right has 47,000 and more detail. The down side is that I can’t easily change anything about this model.

    Baking is the process where details from a highly detailed model, such as shadows from clothes and weird veins and scars, get painted onto a lower poly mesh. The details aren’t there, but look like they are.

    Baking textures allows you to use a low poly mesh that looks like a high poly mesh. The disadvantage is that you can’t change you mind about, for example, the position of the clothes once the bake is done. You can always repeat the bake, which takes a bit of time and isn’t very exciting.

    painted orc figure posed in a grabbing manner against an industrial backdrop.
    Now that the rigging is in place, I can move the orc to give it an action pose. Might need to move the loincloth, it looks like it’s digging into the thigh.

    In the end, I’m happy with how Steve turned out. There are a few mistakes with the painting, but if you can see them keep it to yourself. I should go back and re-do where I went wrong as an exercise.

    So I had an orc with bones that I could manipulate and pose in a threatening manner. But the hands were wrong – the fingers looked awful when I tried to make them grab anything. That was the next thing, because I wanted to make Steve grab things and make a fist. That was for another time, though.

    Two views of the orc’s right hand. The rigging allows you to move body parts and the controls for curling the fingers are simple enough. However, I did something wrong when I set the fingers up because the fingers don’t move properly.

    So that was the course finished. Next up, I’ll have a look at getting realistic textures onto objects and then I’ll try and get those hands looking right so I can pose and animate Steve. And don’t forget to look for science-related opportunities for Blender.

    1. You know what I mean. ↩︎

  • Blender part 8 – GameDev II

    Blender part 8 – GameDev II

    Let the orc begin!

    When I made Bob the non-demon (see below) I was introduced to sculpting in Blender. Virtual clay you manipulate with a mouse without having to consider gravity and then paint any colour you like offers huge opportunity for creativity.

    3D rendered image of a demon with orange eyes and horns.
    After lighting and colouring, here’s Bob.

    This promised to be a longer sculpt, since we were making not only a head, but a body and some rudimentary clothes – boots and a loincloth. I’ll split into three parts. Second part will look at the finishing of the sculpt, the third will look at some of the other stuff we can do with posable figures.

    We used squashed spheres to block out the main shape of the head, body and hands. It’s the hands that proved the most tricky to get looking good. Later, the hands were to cause quite a lot of frustration when it came to rigging. But I’m getting ahead of myself.

    Triple image showing progression of orc sculpt.
    Progression of the orc sculpt. From blobs, to a bit of shape, to rough definition of muscles and hand. We only did one half because we can apply a mirror to the sculpt once we’d done fiddly stuff.

    The body was the first part that got any proper attention. We added clay to the spheres and built up the main muscle groups. For much of the lessons I wasn’t sure what the end goal was, other than the final orc. So we spent some hours adding and refining the musculature, getting the boots right and sculpting a loincloth and belt shield.

    Progress of the sculpt. The face was a detailed task, since we want to give the orc some personality. Then adding detail to the body muscles and then adding clothes to cover such bits as an orc feels it necessary to cover.

    I’m not sure why, but I didn’t save any of the progress during the face sculpt; it followed a similar path to the work we did to create Bob, but adding tusks and shaping the mouth around them was different.

    Next was to make the basic figure a bit more characterful. As with Bob, this involved adding asymmetry, scars and general wonkiness to the face. Further, this time we added ugly lumps and diseased parts to the orc. It was a shame to do this, I’d spent some time getting the musculature of the shoulders right and they were covered by the shoulder plate and the hideous growth that I added.

    To make the orc a bit more interesting and to seem like he’d had a bit of a life, we added unsightly lumps and a horrible growth to his left shoulder. That’s what happens when you mess with wizards.

    Raised veins were added using a texture brush – basically paint on a texture and it makes whatever shape is on the brush. I’d need to go back and be reminded how to do that again.

    As part of the messification of the sculpt, we had added some detail to the belt boss and bashed the metal bits around because this orc has seen action.

    It was about here that I showed the sculpt to our daughter, who named him ‘Steve’.

    So I had an orc ready to colour in and use to learn about animating characters. But that’s for next time.

  • Blender part 7 – Gamedev I

    Blender part 7 – Gamedev I

    This is another paid-for course, again with Grant Abbitt as the tutor. This took me a while to complete, there was a lot to learn. But, again, Grant took us through everything and explained why things were being done. I got the course through Gamedev.tv, there are quite few other courses to look at, mainly for game design.

    First we learned how to add shapes (mainly blocks) to a scene and add textures to the blocks. This is the sort of thing that familiarises the user with the setup of Blender and how to change things. It’s also useful if you’ve already done a course covering these things but forget quite easily.

    Secondly, we made a ‘mech’. This was a stylised all-terrain mobile gun and sort of a cross between ED 209 from Robocop and the two-legged transports in Star Wars.

    Two images. On the left, a white all-terrain walker from Star wars. One the right, ED 209 from Robocop.
    A comparison of the two-legged all terrain walker from Star Wars (left) and ED 209, the enforcement droid from Robocop. The mech we designed is inspired by these machines.

    The build was an exercise in hard-body modelling, one of the things I wanted to learn so that I could design things for 3D printing. Hard-body modelling is one of those things that you learn by doing. This became apparent as Grant guided us through the build and showed how to get from a cube to the cockpit by cutting and shaping in a particular order.

    A chassis and legs came next, then the guns.

    Grey scale images of a cockpit, then with added legs and finally added gun turrets.
    How the mech was assembled. The cockpit came first, then the chassis and legs, and finally the guns

    It’s a very angular look, this is done on purpose to achieve a ‘low poly’ aesthetic. The number of polygons (individual faces) affects how quickly a computer running a game can operate. You want the computer to be able to present good gameplay without a fiddly, highly detailed object slowing the computer down. The ‘low poly well’ I made earlier in this series is another example of this idea.

    Rendered image of a low poly well
    A low poly well made using as few ‘faces’ as possible to get a nice-looking but quick to render object.

    The artistic side is the painting. We can add colours and textures to any ‘face’ in the model, so that the guns have a range of colours and glowing parts and there’s a green glow around the windscreen.

    Stylised two-legged mobile gun.
    Completed mech with colouring and glowing guns. The green glow around the windscreen is a classy touch.

    Setting the scene is another arty part and it’s best to get it right to show off the work. I changed the colours, because the sort-of camouflage was a bit dull, so I thought some vibrant colours would work well1.

    Stylised mechanical gun, a two-legged machine with pink and yellow colouration.
    An alternative to the original mech, this one is pink and yellow and standing in a spotlight.

    Finally, I made a more fabulous version, with glitter (which took a while to learn how to do). I added a camera circle so that the true magnificence of the final design can be appreciated.

    Fly-round of the glittery mech.

    The next parts of the course leads up to sculpting, colouring and animating an orc. This took a few weeks to complete, I’ll post the progress in a couple of separate posts.

    A man talking with an orc behind him
    Grant Abbitt, the tutor for the course I’m doing, and the orc that we will spend the next few weeks sculpting.
    1. Work well for image purposes. Maybe not so well on a battlefield. ↩︎
  • Blender – playing with light

    Blender – playing with light

    Having finished the course on Udemy I had a look round for the next thing to have a go at. In the mean time I’ve done a few more tutorials from YouTube and been mostly pleased with the results.

    A minor issue with the videos is that the Blender software has been updated many time over the years and some features have moved, so I do hit a wall occasionally.

    Luckily, the internet is full of advice and there is always someone who has had the same problem.

    One such issue has centred on Rendering. This is the process of getting from the grey blobs and lines, to coloured images and finally to a .png file or a usable animation.

    Some 3D objects rendered using the EEVEE render engine.
    This is a collection of objects rendered using EEVEE. The results are fine, and the image is produced quickly.
    Some 3D objects rendered using the Cycles render engine.
    This is a collection of objects rendered using Cycles. The results are much better than with EEVEE, especially with the transparent materials. This does take longer to produce an image, though.

    If you look at the glass doughnut in the two images, you can see why cycles is preferred for end results. The light from the yellow pyramid has been diffracted in a realistic way in the Cycles render, but EEVEE doesn’t do as good a job. You can fiddle with the settings to improve matters, but I will leave that for the future.

    The EEVEE render engine (Extra Easy Virtual Environment Engine) is the fast renderer in Blender. It acts as a game engine, so it produces good quality images for the purposes of quickly seeing what you have made.

    For better visuals, you need Cycles, which takes more time to come up with the goods because it cycles through the image properties to perform ray-tracing. This is where the paths of the lights are calculated so that, as in the images above, the light from the yellow cone is refracted in a more realistic way through the glass torus. Reflections also look better in Cycles.

    Fiddling with the settings of the glass will give better results, for example changing the index of refraction (IoR) of the glass will change how the light interacts with the material. I did this for the spinning beer mug, stills are shown below. One has a glass edge (IoR = 1.45), the other has a diamond edge (IoR = 2.5).

    Beer mug logos rendered with different materials as the surround.
    Light behaves very differently when the surround is given the index of refraction of glass (left) and diamond (right).

    You can also use a change in IoR to make different lenses. Since we aren’t concerned with reality there is the potential to make a lens with a IoR of less than 1. Such a thing is not possible (at the moment for visible light1), but since Blender computes light rays we can have fantasy physics.

    Changing the refractive index of the surround to the beer mug does odd things to how it looks. The position of the highlights changes, as does the brightness of the reflections. You can go further and change the index of refraction for each wavelength of light.

    So I made two lenses, both biconvex like the lens of the eye. In the picture below, the one on the left has an IoR of 0.8, the one on the right’s IoR is 1.45 (glass).

    Two lenses in front of gingham cubes. The left side one is a reducing lens, the right hand one magnifies.
    Demonstration of the effect of refractive index on lens behaviour. Both lenses are biconvex, but the one on the left has a refractive index of 0.8 (impossible (at the moment)), the one on the right simulates glass and magnifies the block behind it.

    I’m not sure what application this will have in 3D modelling, but it is interesting to muck around with what’s possible.

    1. This has been done for microwaves using metamaterials, but that’s not relevant to what I’m talking about here. ↩︎

  • Blender part 6 – meet Bob

    Blender part 6 – meet Bob

    Sculpting is the name of the game for the final part of the Udemy course.

    It’s like virtual clay with the advantage that if you muck up, you can just press ctrl-z to go back.

    We start with a blob of virtual clay that we use various tools (with exciting names like ‘Grab’ and ‘Clay’) to pull and push the material around.

    Got some personality now. The eyes help.

    The idea is to get an exaggerated face, suggestive of a creature not of this world. Grant shied away from the word ‘demon’, but there is something demonic about the face that’s emerging.

    The lips are made by pinching the clay and the philtrum similarly, but also pressing into the clay to give a more realistic look.

    The eyes are just spheres. Getting them in the correct place needed a bit of reference to real figures. I never knew that the average face is 5 to 6 eyeballs wide.

    Adding and shaping the ears was fun.

    Ears are essential, of course. These started out as discs but grabbing, pushing and pinching yielded Spock-like ears for that authentic demonic / otherworldly appearance.

    Some final additions include giving Bob (as he was now called) a cleft chin and horns. Warts, too – a nice double set, just like Lemmy out and off of Motörhead had. And horns, which Lemmy never had.

    Fully coloured Bob, with a dimple in his chin, Lemmy warts, horns and some back lighting.

    The clay can be painted on directly, using a variety of brushes and all the colours you can wish for.

    An important part of the visual set-up is lighting. Grant didn’t shy away from this part, which too many tutors do. There are four lights1 for this image, two back lights an area light and a main light.

    Overview of the lighting set-up for the final rendering of the demon head. A small, intense area light and a large, diffuse area light at the front and two small spot lights at the back.
    Lighting setup around Bob for the final render. Four lights in all of varying power and size. the little black triangle at half past four is the camera.

    Unlike a real studio, you’re not restricted in how many lights, what colours and how bright you want the lights. Virtual clay doesn’t melt under your 3000 W spotlight.

    The finished Bob. I didn’t know how to get the camera to to a 360 around the object, so I had him rotate instead.

    I also gave Bob a nick in his right ear. I’ve had the same mark since I was five (or so), when I ran into a door frame and gashed my ear. There was much blood.

    I tried adding an earring, but that didn’t look right somehow. Although I can make a gold-looking thing with no problem, the earring sat in the lobe like a toad on a drum.

    The whole thing took me about 5 days, a couple of hours a day.

    If I think on, I might tweak a couple of things. The back of his jaw is a bit odd. I might give him a head tattoo, I think Snaggletooth would work well.

    Motorhead's 'Snaggletooth' logo, a gorilla-wolf-dog combination with boar tusks, according to the designer, Joe Patangno.
    Motörhead’s ‘Snaggletooth, the War-Pig’ logo, designed by Joe Petagno for their first album, Motörhead. It featured the song ‘Mötörhead’, a cover of the song ‘Motorhead’ by Hawkwind.

    So that’s the first paid-for course done. I’ve not really covered much in the way of Blender for 3D printing, or decided what it is I want to do with the app. I had in mind doing fluid simulations, as a visual aid to rheology training.

    1. Insert Cpt Picard reference here ↩︎
  • Blender part 5 -animate!

    Blender part 5 -animate!

    UV shading and animation!

    UV shading sounded scary when I first watched videos on the subject, but having Grant to hold your hand helps. As he explained it, a UV map is like making a label to fit on your 3d model as you would for a bottle. Only 3d models are usually more complex (they have challenging topology, as he put it).

    Fitting a flat image of a Spitfire to a model was an interesting exercise. I think the end result was ok.

    Spitfire, modelled in 3D, then colouring applied from a photo using the magic of UV shading.

    Then we did some scenery building and basic animation. Having learned how to add images to 3d objects, putting images of buildings onto cuboids and simple shapes was relatively easy. So a basic street could be made.

    Then the Spitfire was added to the scene and we were shown how to make an animation of a flyover. This stretched the capacity of my laptop, it took a while to render but I got a flying plane.

    I added a turn to the plane as it flew over to get the final animation.

    Next, we did some more on animation basics. In Blender, just about any aspect of an object can be animated, so cameras will move, items change colour and all sorts of fun.

    At the end of this, we built a simple humanoid with a telly for head (as you do) and learned how to animate the figure for a walking motion. As a bonus, we added video to the screen on the face.

    A man with a telly for a head and a lovely gingham suit. His best friend keeps him on his screen.

    I went a bit further and animated two figures, one in gingham, the other in denim, and put the gingham figure on the screen of the denim man.

    Little man in a smart denim suit with a picture of his friend on the screen. I may have got the animation wrong somewhere, it look like it’s skipping at one point in the cycle.

    It’s sculpting next. Sounds like fun.

  • Blender part 4

    Blender part 4

    I’ve not updated for a while, but I’ve not neglected the course. I’m nearly finished the course I started, having made a dungeon scene and a low poly dinosaur.

    Dungeon scene, with crates, barrels and ineffectual lighting.

    The dungeon was interesting to do, I can see why that would be useful for a game engine. How you put it into a game and how you make a game is not really anything I am thinking about right now.

    Low poly dinosaur with trees and a mountain.
    I am a mighty dinosaur! Hear me roar!

    Not a very convincing scene. I’m sure there are ways of improving the look of the landscape and making it look like the T Rex is further away from the trees.

    We’ve started what sounds very scary – UV mapping. So far, it’s using downloaded images to make barrels and crates look authentic without faffing around and adding texture, like we did for the dungeon scene. Grant has likened this to putting labels on jars, which is a nice cozy way of describing it. I’ll be finished with this part soon and will post if I remember.

  • 3D printing an SEM image

    One of the things that has been rattling round my head for many years is the idea of 3D printing from an SEM image. I know, it’s a common issue and one you’ve all heard many, many times.

    In a previous post, I mentioned how I’d done some of this already using Blender and a bit of artistic licence. What I made needed to be printed in two part (one white, the other yellow) because I didn’t have access to a multicolour printer.

    3D printed oil in water droplet
    Original version of a 3D printed oil in water droplet. Some artistic licence required and I had to design and print in two parts. You can see the join.

    Scrolling through Blender instruction videos (as you do) I saw a post by Architecture Topics on how to convert an image into a 3D Element.

    This pinged a synapse in my brain and I wondered if the SEM of the broken oil droplet I took some years ago could be used in the same way.

    Scanning electron micrograph of a split oil droplet. I took this image about ten years ago and have been thinking about making a 3D version ever since. I can work faster. Honest.

    How hard would it be to convert the original image to a 3D Element?

    Rendering of convertion a SEM image to a 3D element

    Rendered version of the converted image. I’ve stuck to black and white since electrons don’t do colour. I could reasonably render this with a gold effect since the sample prep involved coating with gold to get better imaging.

    It took a while, but I got there. For the final render, I put the converted image into a box to hide the ragged edges of the conversion. Also I had the opportunity to go into my old work and have a go on the 3D printer there.

    After a bit of faffing (because I’d not applied a solidify modifier to the final image) I got a .stl file that the slicer said would print.

    My first attempt wasn’t great. I’d only applied enough solidify modifier to give the final print a thin shell. To quickly fix this, rather than going back into Blender and increasing the solidify level, I set the slicer to do 100% infill.

    That didn’t work. I’d need to go back to Blender and learn how best to use the 3D toolbox that I learned about while I was doing this.

  • Blender Part 3

    Blender Part 3

    I’ve spent more time on Grant Abbitt’s course; I’ve been finding out about low poly landscapes and how to add lights and glow.

    Finished lighthouse scene. I like the glow from the lighthouse and how it reflects in the sea. Maybe I will learn how to make it flash and post that, too.

    Having more than one colour on a single object, adding street lights of the right colour (the glow by the houses matches the sodium lights I grew up with in the 1970s.) Grant also covered how background affects the scene and where lights go. This is often skipped over in lessons by other presenters.

    Besides this course, I’ve had a look at how to make shapes for 3D printing applications. I went through a short vid on how to make a spiralised ball. It was titled ‘how to make a spiral in one minute’, but it took me over half an hour, stopping and starting the video to squint at what the presenter had. done. Maybe I’m being unfair – if he wasn’t intending to make an instructional video, then I shouldn’t have expected one.

    Spiral balls in Blender. These would be interesting to 3D print, maybe adapt for Christmas decorations.

    I’m still a long way from being comfortable with the interface and I doubt I will ever fully know how to use the program. But as long as I have fun and a creative outlet and don’t scare the horses, it’s all good.

  • Blender part 2

    Blender part 2

    I started a course and, unusually for me, I paid actual money for it. It’s presented by Grant Abbitt, some of whose free video tutorials I’ve seen. I did finish the low poly well, it took me a few days (no idea how many hours) and I was pleased with the result.

    Not sure where such low poly work would find a home, but it’s good to do something creative that I think will lead to better 3D prints. I just need access to a 3D printer.

    Learned quickly how to change materials and do lighting so that you get these great effects with transparent materials. This was done on the second day of the course, maybe four hours to get this far.

    What’s so good about this course is that Grant takes you through the steps to make a thing. This isn’t unique, but I see a lot of courses that show you how to use tools in Blender and other programs (Excel, for example), but there is no context.

    What he also avoids is the “Draw the rest of the fucking owl” trap that I see so often. You’ll be shown how to design something, then magically it’s all lit with a background, multiple lights and a camera fly-round.

    The original “Draw the rest of the fucking owl” meme. Original artist unknown, but it’s been around since 2010. Which is medieval by internet standards.

    I got the course through Udemy, it may be available elsewhere. It’s called “Complete Blender Creator” and I reckon it’s been worth the £15. If I was making stuff in real life it would cost me at least that much to buy some clay or paper and paints.

    More to follow. There’s a lot to learn, but I’ve got time while I’m on gardening leave. I can’t spend all day looking for work when there’s no suitable jobs.