Pixiv Fanbox
A Ramble On Lighting
Published 08/10/2023, 05:13:26 AM · Added 08/09/2023, 08:00:00 PM
Preview: scraped · Full content: yes
Image failed to load
Preview is unavailable for this post.
No, this is not a ramble about my hatred of Lightning. This is about lighting in Blender, and also a bit on camera stuff. Mostly just to hopefully elaborate one why I pick certain aspect ratios, perspectives, and the like for my animations. Regardless, let's talk about lighting.
I would consider lighting to be either the most or second most important aspect of 3D graphics. Good lighting can really sell a scene, even more than textures, model fidelity, and all that. However, material may be more important in some cases, but in my case I'd say it's mostly lighting. These characters are video game characters, after all. As it stand, you can't get true realistic looking graphics in real-time. Just isn't possible. The best you can do is add filters and what not to the image to give it the illusion of something like a view finder in a camera or something. But I digress. Let's talk about Blender.
There are two rendering engines in Blender. Cycles, which is a powerful engine that has a ton of bells and whistles to it, but in this instance the most notable thing is ray-traced lighting. It's kind of a meme at this point with the whole "RTX ON" thing, but ray-traced lighting is, essentially, calculating a ray of light from a light source, and then calculating the reflections off a surface based on the vector direction of the ray in order to calculate the illumination on surfaces around it based upon the direction the camera is looking. This is the most simple way I can explain it, since it's honestly a bit over my own head, but essentially it's a lot of physics. Like, a whole fuck-ton of physics. So much that it takes a computer a long ass time to actually process these vectors. That's why REAL-TIME ray-tracing is such a big deal. Because it's able to process these vectors in REAL-TIME, instead of having to spend seconds, minutes, HOURS on all these vector calculations in order to display the scene accurately. That's why, if you look into Cycles, you'll see a lot of noise in the scene as the CPU/GPU starts calculating things. And why, the moment you move the camera a tiny bit, the noise returns and the process starts anew. Here is an example of Cycles lighting.
The other engine is EEVEE. This is the engine I use, and it's a relatively new engine in Blender(being first in beta in 2018, and still in beta when I started using it in 2019 and it showed. Lots of glitches that thankfully no longer exist). It uses standard rastarization of lighting, which is just what video games have been using for decades. It basically just approximates light, which results in a flatter looking lighting, but the result is much, MUCH faster rendering times. EEVEE is considered a 'real-time' engine, because you can view what a final render looks like in the viewport instantly. There's no waiting around for the image to render, it's just there. Obviously, depending on the computer used, the render will still take some time when you're playing it back or moving the camera around, but unless you've got a potato, it's finished in a second as opposed to the minutes Cycles can take. Here is how the above looks in EEVEE.
As you can see, the shadows are very dark, and this is because there is no reflections being calculated. It's just a single point. There's no bouncing of light to create what is known as 'global illuminiation'. It's honestly one of the biggest things to give things a realistic look. There are ways to sort of get that with Irradiance Volume and Baking the Lighting, but it can be imperfect and glitchy, and also takes time to bake which can also be annoying. But sometimes it does give decent results. This is EEVEE with baked lights using an IrradianceVolume object to determine the light baking.
You can also turn off the bounces for a light in Cycles, which makes the light act like EEVEE, but the render times don't get lowered to EEVEE levels, so keep that in mind. It can still help with reducing render times if you don't need the 1k bounces it has by default.
Now, onto actually lighting a scene.
HDRs
One of the best ways of getting a basis for your lighting is to use an HDR of sorts. This is done in this tab:
You hit the little yellow dot by Color, click "Environment Texture" and load up your HDR, which you can find for free with a quick google search. Just do a search for "free HDRI" and you'll find some good resources. Once you've got an image in there, it'll look like this.
From there, you can click the blue button next to Vector and select "Mapping" under the vector header, and from there you'll have this:
Click the blue button next to the Vector that has the three 0.000s, and select "Generated" under the "Texture Coordinate" header. This will allow you to adjust the location, rotation, and scale of the HDRI, which gives you control over the way the lights work.
Note, the way these work in Cycles and EEVEE are quite different. In Cycles, they actually create genuine lights that cast shadows and everything with the appropriate colors. If you're doing an interior shot that has no windows, the HDRI won't do a thing for you. In EEVEE, they just illuminate and color the scene. Here are the differences.
Cycles, with proper shadows and all.
EEVEE, with its flat lighting. Obviously, with the baking process you can simulate this of course. But, I didn't adjust mine properly and so I had some glitches, as you can see here.
Weird shadow on the ball and what not, but none of the shadows really look right. So this will only get you so far. My main method is to use the HDRI as a sort of 'global illumination' where I adjust it depending on the scene, and use actual lights to cast the shadows. And now, before we start talking about setting up lighting in a scene, let's talk about the lights, and a couple of important settings for EEVEE. First off, there are four types of lights. Area, Point, Spot, and Sun. Area is essentially a light that casts light in a 180 degree area, with the most being in the center. This light can be scaled up and down to increase the size of the light and the area it covers, and doing so softens the light. Shadows will fade and be less sharp the larger it is. This is basically difussing the light. If you want that effect, scale it up. Otherwise, keep it small. You can also adjust the shape of the area in the lighting properties tab.
Point is a point light. Think of just a lightbulb or something. It casts light all around, in a full 360. In the lighting properties, you can adjust the "Radius", which does the same thing as scaling an Area light. Spot is pretty self-explanatory. It's a spotlight. Similar in a way to area, but it's a cone rather than a blanket. Can increase the radius of the cone, make it faded at the edges more or less with the Blend option in the lighting properties. And Sun is, well, the sun. It's a light that exists outside the boundaries of the scene that casts light on the entire scene regardless of where it is, making it act like the sun. It won't go through any object, so it's useful for outdoor scenes and having light flood in from a window and what have you. I basically just leave everything at default.
Now, for EEVEE, a few things. In Render Properties, you'll want to change the shadow settings from default. It's a simple thing, but you want to make sure soft shadows are on, high bit depth is on, and to adjust the shadow size. Higher number = higher resolution shadows. This isn't always ideal, but I'll leave you to that.
Also, turn on Ambient Occlusion, Bloom, and Screen Space Reflections. Those will just make things look better for you. Additionally, you'll want to adjust the light itself: go under the light properties of the light you want to edit, and open up the drop-down menu of "Shadow" and adjust the bias. In my experience, going down tends to be better. This gives better shadow accuracy in most cases. You'll want to tweak it based on your scene and what not, but you can see what it does for you on your own, since it's not a one-size fits all sort of thing. There But anyway, let's move onto lighting a scene.
Lighting a Scene
I spent a lot of time debating who to use for a scene. Had some ideas, but I'll just keep it simple and pick everyone's favorite: 2B.
This is what it'd look like by default in Blender. I'll go ahead and add the same HDRI I was using before and a single Sun with a 3.0 Strength to give it some highlights and shadows. This is my typical setup for poll posing and what have you.
It's a decent, neutral lighting that works for the sort of 'studio lighting' effect I'm aiming for to just display the characters that are going to be featured. I'll go ahead and throw her in the 'fancy' room I used in the Anniversary, since it fits the outfit. I won't go into how to bring in scenes and stuff in, just to not bog things down.
As is, it's not terrible. The light comes in through the window, and the HDRI gives things an illuminated look that's not too bright and what not. It works when you want to be lazy, and I've used it plenty. It was very common among the Anniversary stuff, just with switched up HDRIs here or there. But let's go for a more... moody vibe. Now, you can light up the room as you would a real life room. Add in lights near light fixtures and just let the natural lighting of these fixtures light up a room as they do in real life. The issue with that is... it doesn't always look good. This is just a single point light, a reduced sun(with a bluish tint for a night time look), and baking the lighting in the room.
Like, that's kind of what you'd expect from an overhead light in a room. But it's flat. There isn't much interesting to it. So you gotta do what they do in movies, and customize the lighting. We can use a 'three point lighting' as a basis. What is three-point lighting? I don't really remember and I'm too lazy to look it up, but if I'm remembering right it's something like a key light, a fill light, and a back light. Key light being the light that is the one that creates definition, a fill light to soften the shadows, and a back light to give highlights. I typically have a back-light that's not too bright, but enough that it'll give the backlit highlights. Usually use an Area Light, with a relatively small scale and low bias to give defined shadows. Could even turn on contact shadows for extra shadows, but it's not required.
Then for a key light I usually use a point. It'll typically be on the same side as the backlight, and it'll have a fairly small radius with the same level of bias that the back light has.
Then, lastly, the fill light. I just CTRL + D the key light, move it to the opposite side, lower the power, bump up the radius, and either up the bias on the shadow, or remove the shadow entirely.
And then, when combined together, it looks like so.
Nothing fancy, but it looks better than the blown out, full light in the room. And this also works fairly well in Cycles.
And then if you bake the lighting, it looks pretty similar to how it does in Cycles.
Now this is just the basics of three-point lighting, and it's a relatively simple setup and nothing fancy. I typically spend a good twenty minutes just slightly tweaking power, shadow bias, color, scale/radius, and positions of lights when I've got my camera and pose set up. I also typically use an HDRI to add a little more illumination, depending on the mood I'm going for. Dark moods I don't use them or use them sparingly, but for brighter stuff they are very useful. Anyway, let's set up a little something so I can give you some examples of a dynamic pose, which also ties into a camera thing.
Here's a quick pose I threw together. Turned off all the lighting, as it wouldn't look good as is. For something like this, I typically go for a POV shot, and since it's fairly narrow, a vertical one at that. Let's get that set up. I'll remove the environment so I can set it up in the way I like it without having to deal with that as of right now. You can add a camera to the scene and hit Numpad 0 to go into its perspective. From there, you can hit Shift + ` in order to move it around with WASD and a mouse like you would a typical FPS game. Hitting alt while doing so will slow your movement down, while shift will speed it up. This is typically how I set up all camera scenes, as it just makes things easier. Somtimes I will select the camera and do small rotations with R or small movements with G, but that's really fine tuning stuff. Anyway, after setting it up, this is what I went with.
You can set the camera resolution in the Scene tab, and for vertical shots I go for 1080x1920, the opposite of the standard 1920x1080.
Additionally, you can select the camera and go to the camera tab to adjust the focal length of the camera. Typically, I operate in 30mm to 50mm range. Those tend to be the most natural looking, but sometimes I do have to go into the twenties for certain shots, and sometimes higher than 50 will look better. Just experiment with it until you get something you like. For this one, I went with 40mm. I re-enabled the environment, and one of the pillows in the scene was kind of in the way. I just adjusted the "Clip Start" of the camera a bit until it was gone.
And this is what it renders like with just a little bit of HDR lighting. Now, I have something in mind for what this will look like. Let's get a Moon outside, and some clouds. I just get a Moon texture from a search, put it on a plane with an emission node to give it light, and that's that. The clouds are a flat plane with a material that has some noise and emissions to give it the illusion of a glow and it works fairly well.
HDRI off, sun turned back on acting as a back-light. And if you want to see my node setup for the 'clouds', here you go.
I'll go ahead and add a sphere with a ever so slightly deep blue emission(and remembering to turn shadows off for the spehre, so that the sun can cast through it), allowing me to add the HDRI back without seeing it in the background. Like so.
Next thing I'll do is adjust the bloom settings of the scene. I like to give it a bit more bloom for shots like these, just so things have a glow to it. I also add a small spotlight to 2B's face that has a super low power red light, just to give it a red glow for the eyes.
It's the small things, you see. They are minute, but they add a lot. Anyway, next, even though I already have a backlight with the sun, I will still use an area light to give a little extra 'side-back-light' sort of deal.
Then from here, it's kind of trial and error. I tried multiple different types of key lighting, from an orange/reddish sort of lamp look, to just soft blues and ultimately what I found best was a key light on the opposite side of the backlight, with a low power(but relatively close) light that just sort of acts as illumination. No baking of lights here, just because it typically makes things look worse in this sort of lighting. I also did some adjustments to the pose and facial expressions and what not, because once something is properly lit, that's when you want to make those adjustments since actually being able to see how the scene looks helps with making the corrections you need to get the pose just right.
Just for reference, this is what it looks like with baked lighting in EEVEE.
It does add some reflections to the lights to give it a bit of that global illumination, but it's pretty minor. But anyway, that's more or less my whole lighting schtick. It's really just one of those trial and error things that you gotta tweak and mess around with enough to get an understanding for it. I'm no expert by any means, but it's one of those things that a lot of beginners tend to neglect. The three-point lighting system, and thinking of things in that way, tend to help a lot. You don't always have to follow it exactly - for the above I don't actually really have a proper three-point lighting setup. I guess in a way it is. I've got the sun as a back-light, the 'side-back-light' is more a key light, and then the thing I called a key light is a fill light... but it's not exactly correct either. And it really depends on what you want to do. For example, let's look at this picture.
I could easily light this the exact same way, but I wanted to go for a look that matches Venus Vacation's night scenes. It's fairly bright at night in the game, as shown by this picture.
And while my shot is less bright, it has a similarity while giving it more of a mood unique to the scene. But as this picture shows, I use the same base principles as before.
There's a sun, which represents the moon and backlight. There's a key light, this time on the opposite side of the backlight, and the fill light goes on the same side as the backlight. The last little point is actually the light reflections in Shandy's eyes. The fill light also casts a reflection in the eye, but one singular reflection looks a little odd since the game tends to have two at least. So I add in a second. This light has no diffuse lighting, and the specular lighting is turned way down.
There are all sorts of little tricks and things you can do like this. A lot of times Cycles doesn't need these tricks, but EEVEE is a less powerful engine and requires trickery like this to really shine. It is more in line with a game engine after all, and games use all manner of graphical trickery to accomplish their stuff. Don't feel bad if you don't know how to solve something right away. I'm always learning something new, and I feel like I probably know maybe 1% of what Blender is capable of. This sort of software is extremely powerful and extensive, and knowing everything is literally impossible. If your intention is just to do this stuff as a hobby, just take things one step at a time. Compare my 2019/2020 Blender stuff to my more recent stuff and you'll see I've improved a lot in terms of lighting and what have you. And even now I'm still far from perfect, and sometimes my lighting isn't the best anyways so it's always a learning process.
Anyway, that's my long winded ramble on lighting and stuff. Hopefully it'll have helped someone at least minutely. I just kind of 'stream-of-consciousness' wrote it and set up lighting as I was going through this thing. No clue if it's helpful or makes sense, but I tried my best. There's no real 'one-solution' for lighting, and I didn't want to make it even longer and cover every little detail, but this is kind of a basic rundown of it. It really is a lot of trial and error, and messing around with it on your own will teach a lot more than someone like me could. But hopefully for those struggling with it, this will be that sort of "oh, so that's what that means" sort of deal.
As for the 2B picture... it may become an animation if I feel like it. It's very similar to the crazy 2B I did a couple years ago, which I only realized after writing all this, but it is what it is. It was mostly just to give an example and what have you. Lastly, I'm gonna go ahead and roll the poll preview into this post, and I'm gonna announce that I will be releasing the next poll and poll animations this weekend, instead of on the 15th. Just because it makes more sense to release them on the weekend instead of in the middle of the week. I recorded the whole process of my custom bodies and rigging for one of these upcoming poll characters, and that'll probably come sometime this month. Gotta edit it and what not, and that may take a while since lazy. Anyway, the upcoming poll characters.
Josie from Tekken 7, Yennefer from Witcher 3, and Lianshi from Dynasty Warriors 9. The last one returning to the polls after having been featured on the very first poll and narrowly losing to Rinoa and Nagisa. This time she actually has a rig prepared! That very first poll was very much a test run of things, so none of the characters were actually rigged at the time. Anyway, an interesting line-up of characters. Curious to see how this one goes. And it's Lianshi who will be the one in the video of me rigging a character.
Also, if you have any questions in regards to lighting and what have you, feel free to ask in the comments. I'll do my best to answer any questions you have, or give pointers when possible.
