Category Archives: Blender 3d

Procedural Skin Material

Lots of little stuff in this one.

First off, if you haven’t, check out this video on a super simple setup for the SSS node in Cycles. It’s a little long winded on the setup, so you can skip to about 7:30 for the actual nodework.

For my part, it’s a lot less complicated thinking about the node set up the way pauljs does in his video. The official stance is that the RGB colors in the ‘Radius’ setting are presented in that order from top to bottom. Presumably, the ‘1’ means full color and less than that is some percentage of that color coming through. In most cases, your main color is going to line up with your SSS color. Even with skin, the SSS color isn’t going to be terribly far from your base color for the model. Assuming that is the case (and even if not you’ll find some useful stuff in here) we’re going to make Suzanne pink.

lightSetup

So here’s the basic setup. Black body point light at 4800K / 100 Strength and .1 Size. Panel sized x3 rotated to 90 on the X and emitting at 5. Camera set at -4 Y (640X480) from full front. Suzanne is smooth shaded and has a subsurf on rendering 2 subs. (For the eyes, I duplicated the eye mesh, shurnk it along the individual origins to .95 and then set up two other materials, which I’ll talk about in a minute.)

Doing this with a skin tone of (.991,.440,.238) gives the following:

SkinMat(DiffOnly)_082614

Diffuse Only

BasicMatSetup

SkinMat(DiffNGloss)_082614

Diffuse and Gloss (settings to the right)

SkinMat(NoBump)_082614

Diffuse, Gloss and Subsurf (super low)

Couple of things to note here. First, the color (mentioned above) is input into both the Diffuse and the Subsurf, it also goes somewhere else, which I’ll explain next. The gloss is striaght up white. The order of the mix is important, because we want the information to fall together correctly. The Subsurf, then whatever isn’t covered by that take the Gloss, and whatever is left take the Diffuse. I’ve also tweaked the mix settings to look nice. I set the SSS up for Gausian (it’s faster) and notice that the Scale of the subsurf is super tiny. Here’s what it looks like when full 1:

SkinMat(Full1SSS)_082614

so you decide how supple you want that skin. I don’t have a good method for this, other than just toying with it. [I decided on a different number by the time I was done with this post than the one I started with. (0.25)]

 

 

So where does the color go?
Here:
SSSRadius

This is the really interesting part from the YouTube video above. Why toy with these setting independently if you don’t need to. Take your input color, flush it through a Separate RGB node, multiply each of them by a value, and then combine them back to make the Radius. Simple. The great thing about this is that you can pull the value and color out to input nodes for a group later, and if you want, you can separate the RGB value multipliers (so if you happen to want a blue blooded pink thing, you can make that happen.) Separating and recombining the values might seem like a chore, but it is necessary for the proper outcome of this method, beyond giving you the control options.

The image is still a bit flat at this point, but that might be all you want with it. Notice, you can stick a texture in rather than just a color for that input slot. Very useful if you are creating skin with a texture to go with it. But lets say you want more realism, without painting a whole bunch of textures in. Here you go, procedural bumps:

SkinMat(bumpClose)_082614Bumps

Notice the add node, this is important as it will alter the behavior of the textures interacting. Also, the conversion to B&W is important, I tried it with the factor and it didn’t come out looking near as natural. This bump gets thrown into all three shaders.

Final product:
SkinMat(Final)_082614

Right now, I’m toying with a way to make a voronoi cell texture (slightly disrupted by a wave texture) put some veins in the SSS color. It would be really neat to see that kind of thing work out. Some other considerations: run a dirty vertex and place the input from that as a modifier for the bump maps to create some wrinkles (dirty vert hits the crevasses where wrinkles would normally be), use a voronoi input to the vector of a noise shader to create fingerprint like structures,  grouping and saving the node groups for use with other projects and as varied inputs.

Happy Blending.

Oh, I almost forgot the eyes. This is very basically how I model all my eyes. Grab the exterior portion already on Suzanne and duplicate, then scale along individual origins to 0.95. Next grab all the stuff that’s in the front of the eye, and pull it back. Like this (interior on left, exterior on right)

 EyeMeshes 

For the materials, the interior gets this treatment:
EyeInterior

notice you can replace the white with a texture, and I recommend bump mapping your veins, it’ll really add to the realism.

then the exterior gets this tear treatment:

Tears

Boom. That’s it.

Blend available here: Skinned Suzanne.

Share your results with me, I’d like to see this material put to use!

 

 

Advertisements

Glowing Electric Material Without Compositing

Yesterday I shared a tutorial on making some glowing, animated cylinders. I composited some ghost blur on them, and it looks great, but it really bothered me that the cylinders were so ‘solid’ as emitters and I had to composite the glow on afterward.

So I made a new material.
First I made an emitter out of this sphere: (generic settings)

BasicEmission

Then I mixed it with transparency:

TransparencyMix

But that did nothing that I wanted, it just dimmed the emission (and kinda made it see through) So I added the ‘Layer Weight input and stuck that in the factor for the mix:

LayerWeightMix

and now, we are talking. Notice that slight blur on the edges, that’s what I’m looking for. So I cranked up the Blend setting on the ‘Layer Weight’ input and came up with this:

BlendedSettings

but now the sphere was really dim, so apparently the more transparent the less light it gives off, fair enough, just crank up the emission:

FinalWisp

and viola, glowy sphere of light without hitting the compositor.

Try it out on some other shapes and get some interesting results:

CylinderWisp CubeWisp SuzanneWisp

All of those were with untweaked settings as follows:

WispMaterial

Happy blending.

 

EDIT: forgot to add the inverted effect. If you flip the Emission shader and the Transparent shader and then crank the Layer Weight ‘Blend’ down to 0.1 you get this neat glowing bubble:
FinalBubble

 

Imgur Loading Gif in 3d

So, Alex Otten posed a question about this animated version of the Imgur logo. I decided to try my hand at it using curves to deform a cylinder. So here’s roughly what we’ll be making:

RingSpinFinal

 

So, clear a fresh scene and we’ll get started.

First step is to go to front ortho view and then add a circle curve: (Shift+A Curve->Circle)
Steps1

Make sure you tick the ‘Align to View’ box if you want easy numbers as we go forward. There’s a small point to be made here about the radius of the circle, which I’ll come back to in a moment. For now, leave it at 1, but just keep it in mind for the future.

Now, add a basic circle mesh (we’re going to make it cylinder in a moment): (Shift+A Mesh->Circle)

Steps2

The settings I’m using are for 16 verts and a radius of 0.1 (I want this cylinder to be very thin and long.) You won’t be able to see the circle, because it’s flat from front view, so alter your view slightly and then tab into edit mode.

In edit mode, duplicate the vertices (Shift+D and right click to commit) then grab and move them up 1 unit on the z axis (G, Z, numpad 1 and Enter to commit.) Now we have two circles of vertices, 1 Blender Unit away from each other. Select all the verts (Ax2) and then bridge the loops (Ctrl+E, L).

Steps3

This is the point where we’ll pick the resolution of our curve. To illustrate what I mean, go ahead and add a modifier to your cylinder so that it runs the course of the circle: Curve mod, Object is the BezierCurve, Deformation Axis is Y.
Steps4

You’ll notice That our cylinder is on the circle the way we want it, but isn’t deforming and isn’t covering the whole thing. We fix the deforming by giving it more geometry to work with. Create loops in the cylinder until you are happy with how many you have for the resolution. For this example I’m going with 63 loops (creating 64 vertical pieces.) Tab in to edit mode, mouse over the center of the cylinder and then push Ctrl+R and scroll up on the mouse wheel. You can look at the bottom left to see how many cuts you are up to. Left click then right click to accept and place evenly. Tab back out of edit mode and you should see a difference in the way it curves around the circle. (if you haven’t yet, change the shading on the cylinder to smooth.) But there’s a problem.

Steps5

This problem (the cylinder not going around the whole circle,) is exactly what we are going to use to properly animate the ring as it goes around the track. Remember back to my comments about the radius of the circle initially, we left it set at one, so now we need to set the size of the cylinder to match the circumference of the circle. Fortunately, we can animate this!

Steps6Bring up your right panel with the N key (if you haven’t already) and look at the cylinder’s Z size. It should be set at 1 if you haven’t done anything to it. Change it now to 6.283. It fills the whole circle because 2πr is the circumference of the circle, and since we left the radius at 1, that means the circumference is 2 times π. So the length of our cylinder needs to be 2π or 6.283. Use this value to animate the cylinder by setting 3 key frames, first frame, middle frame, and last frame.

Set the first frame to the full circle (6.283 in this case), the middle frame to 0, and the last frame to the opposite of the first. (-6.283 in this case.) simply mouse over the Z value in the right panel after you’ve set it, and push ‘i’ to set a key frame. You may get a squashed image in the middle frame, and there are a couple of ways to tease this out. The easiest is post processing the middle frame out of the compiled gif. The more complicated way is to set a key frame immediately to either side of the center frame after you’ve already keyed the middle frame, and then key the x and y values on the middle frame to zero as well.Steps7

Steps8

At this point, we’ll want to make all the circles, and the best thing to do is clear all the key frames (right click on whatever frames you’ve keyed and then select ‘clear keyframes’) so that there isn’t any confusion. To get a smaller circle inside this one, we’ll simply duplicate the bezier curve and then scale it to half its size. (S, .5) It’s important to pick your end caps at this point for the cylinder, as we’ll just be duplicating it. If you want, you can just grid fill it, though I recommend extruding in a couple of times before you do this and then beveling the edges.

Now that the end caps are established, go ahead and duplicate the cylinder from Object mode. You should see no change, but now you can go in to the modifiers and change the object influencing the curve to the other curve you just duplicated. You’ll notice it is already filled with the cylinder, but something isn’t right. Check the settings, and you notice that the size of the cylinder is off (should be 6.283) change this to 3.142 and you’ll have it set to the appropriate circle size. Go ahead and duplicate another version of the cylinder, remove the modifier and then hide it so that we can use it as our ‘blank’ for any future circles. Obviously the easiest values to work with are going to be direct multiples, but just remember, 2πr for the z size of the cylinders and you’ll be fine. If you get lost on how big your circle is, just look at the z dimension when it is selected and divide that by half to get the radius. If you want the cylinder to get thicker as the circles get bigger, just apply the modified circle size to the curve with Shift + A while you are in object mode.

Add a sphere to the center, smooth shaded, 0.1 size, 16 and 16 on the rings and segments. If the cylinders aren’t moving to your liking, you can simply rotate the curves (which can also be animated for a very cool effect.) Now, for materials, I just set a light blue emission at 5. I set the background to pure black, and then did some post before exporting the animation.

After you render a single frame, go to the Compositor and set up the following:

Steps9

for a light glow effect. Play around with the settings to taste. Then render the animation and load it up as a gif.

Keep in mind that all the circles are running in time in this tutorial. To get closer to Alex’s challenge, you’ll have to play around with the key frames a bit. This should be a pretty solid start though!

New Engine, Old Blend

Futuristic Glass Chess set displaying the Torre Attack

Created in Blender3d, rendered with the Yafaray Engine.

I’m not sure if it’s good that I feel like I’m cheating using Yafaray, but that’s about the highest compliment I can give in this case. This image rendered in 5 passes at a tremendous resolution (2120X1192) in under an hour, and that’s accounting for 3 additional anti-aliasing passes. The material setup was negligible compared to what the same image would have cost setting up in cycles, and the render time was dramatically less than something even close. Plus, flawless caustics, absorption, and jeez, just look at it.

I have to say a bit about this image before I do a Yafaray review, though. I made a version of this image very early in my time working with Blender (so about a year and a half ago.)Cycles Absorption Test It was sort of on a whim, because I had found out that you could do absorption in Cycles from BlenderDiplom and wanted to try it out. [result on the right] You can see what I came up with, it’s a little grainy (ignore the white squares, they are supposed to be frosted glass) and took over 2 hours to render. It was a fun image at the time, and it taught me a lot about the capabilities of of myself as a modeller, and the flexibility of the Cycles engine. It also taught me a lot about the frustrations of render times without a GPU, and the sheer volume of passes necessary to get a clean render. I learned a lot since then, and looking at this image, I can see there is nowhere near enough light, the bounces aren’t set high enough, and (inside the model) the geometry was fairly messy. It was more fun to revisit the image now, and see how I had grown.

Anyway, one of the problems I have with Cycles is that it is so ‘material-centric.’ Everything is determined at the level of the materials, which can make sense to some artists, I suppose, but it is counter-intuitive to me. What I’m interested in, with a background in photography, is light.

An example of the materials list, and the Shiny Diffuse Material

An example of the materials list, and the Shiny Diffuse Material

I think this is the biggest advantage that Yafaray has over Cycles, it is ‘light-centric’ in its rendering process. No more fiddling with insane amounts of settings and plugging in all varieties of material nodes / input settings/ etc. The light is going to do the work for you, and you just need to make sure that everything is set up to receive that light properly, and send it on along its way. The most intimidating thing moving from Cycles to Yafaray is the list of materials. Experienced Cycles users are going to balk at the paltry options, until they really dig in to the interface. The amount of editable content on each material is the equivalent of having 5 or 6 built in nodes on the Cycles materials, so that very little of the quantity is missed in favor of customization. Basically, the artist has to ask, ‘how is the light going to interact with this object,’ then pick the material accordingly, and modify it to precision. Once you find the material to light settings (they are hidden in the object panel in this engine) you’re golden.

The preferred render setting for most Yafaray users, 'Photon Mapping'

The preferred render setting for most Yafaray users, ‘Photon Mapping’

The rendering process is also quite a bit more intuitive, and as many who use Yafaray have found, the Photon Mapping setting does a great job of producing very detailed light effects. The documentation on Yafaray.org is very explicit in how to use every setting, and it doesn’t require much to figure out once you have your head around it. When I rendered Glass Tower Gambit, I had all the settings cranked up to 16 (ray depth, bounces, etc.) and even rendering on a crappy laptop it only took 55 minutes. I made the mistake of not reading up on anti-aliasing tests until after I had started the render, and so I probably could have shaved a little bit of time off even that.

There are some downsides to Yafaray.

  • Full support for some items isn’t integrated, yet.
  • There is no ‘node-editor’
  • There is no option to render on GPU (which I don’t miss, but some will.)
  • The engine inhales RAM, but the issue has been cornered in the code, and will soon be worked out.

In all, I’d say people cutting their teeth in Blender should stick to Internal, but then move to Yafaray when they get the interest in making much more life-like renders. The reality of Cycles is that it is overly technical, and requires much more time to set up and to render, even for experienced users with decent machines. This engine gets my hearty thumbs up.

Happy Blending.

Let me know how your experience with Yafaray goes.

The Venceslas Sword

Here's the final render which, at 500 samples with 3 passes, took around 20 minutes on my laptop.

Here’s the final Cycles render which, at 500 samples with 3 passes, took around 20 minutes on my laptop.

venceslas-sword

The original image that I was working from.

I decided that this next year I’m going to get serious about my 3D art. (I start my new years resolutions with Advent, as the start of the liturgical year for Catholics) So I picked Blender 3D back out of the closet on my computer, and started dusting it off. I grabbed the first image out of my workout bin that caught my eye and decided to get to work. I wanted a simple model that I could practice some really advanced materials and com positing on, and the Venceslas Sword that I downloaded a while back was an excellent candidate.

First thing I realized in modelling this blade is that it isn’t straight. It looks awfully straight, but it isn’t. I already knew that imperfections made for good art, but I didn’t realize that even tiny variations like this would produce such a magnificent result.

The modelling itself was easy fairly straight forward, I could probably retopo some spots for future use, and likely will. Probably the most interesting thing here is the projection of my logo onto the scabbard, I have my logo saved as a plane mesh that I shrink-wrapped to the scabbard, then applied the solidify and subsurf modifiers to.

The materials were some that I borrowed from El Brujo de la Tribu, which, if you are not familiar with his stuff you should get there. Not only does he have some amazing material nodes to use, but he does some great render tests and explanations for the nerdier artist using Blender. (that’d be me.)

For the blade, I used the Gold Material node he has set up with the following settings:
GoldMatSetup
and then set up the colors for some blue-ish steel.

I used a bronze node setup like this:

BronzeMatSetup

Both of these are group nodes and in the case of the gold material, the only other thing affecting it is a bump map from an image texture to give it some nicks (that will probably show up better when it isn’t full on reflecting the lamp pointed at it, but I couldn’t for the life of me figure out why the blade was turning black sometimes until the render, then I realized there was nothing for it to reflect… >facepalm<) The bronze material also has an anistropic shader mixed with this second group node, but I’m not sure the amount of effect I’m getting out of it in the final render.

The blue section has a leather look to it, that is done entirely with texture editing, a color ramp, and some creative mixing of the gloss:
LeatherMatSetup

The nodes are really a lot more complicated looking than they are complicated. Long story short, for realism you can’t beat a well structured node tree, so play around with them often.

The final trick to any render is the compositor window. If you are not judiciously running separate passes, acquiring the z pass and separating things like the glossy direct pass for your renders, you are missing out on about 3/4 of the power of Blender. Here’s my composite tree, which is *very* simple, despite what it looks like:CompositeNodes

Fully 1/3 of that is just trying to get the glossy direct nodes to pull out alphas so that I could mix them as a glow without dulling the rest of the image.

So there you have it, the Vinceslas Sword (minus the awesome cross cutout) in a pretty decent render. Let me know if you have any questions in the comments, or connect with me on Google+.