I was watching one of my son's cartoons today and I noticed they models were using serious amounts of simulated rim lighting. Even though it wasn't a dark scene where you'd usually see such an effect, the result was actually quite effective.
The white edge highlighting and ambient occluded creases give a kind of high contrast that is similar to, but different from traditional comic book ink work.
I'll be honest, I don't know if there's a specific term for this effect in 3d design, since my major at university was in traditional art. I learned it as part of photography.
You can find plenty of tutorials on "what is rim lighting" for photography. It basically means putting your main sources of light behind your subject so that they are lit around the edges. It can produce very arresting photographs, either with an obvious effect when used on a dark subject...
..,or as part of a fully lit scene to add some subtle highlights. See how alive the subject looks? It really separates them from the dark background and makes them in to an iconic image.
Now here's where it can be useful in your games. Because modern games can be very busy, with lots of environmental details, sometimes it can be hard to bring your models out of the background and make them stand out. There's a whole generation of games which were very muddy and brown, where the often great models are lost in the fog.
Darkness is also a problem, with "too dark" being a common complaint that indie games run in to during early development.
There are ways around this, use of light and shadow is very important, and there are always quick cheats like colored selection outlines to help the player find important interactive objects on the map.
But it's not always possible to have perfect control over the lighting in your scenes, and we don't want the UI to intrude too much in to the game world. If you want your game to have a dark atmosphere, you don't want to always rely on a player carrying a torch or flashlight. If you're an indie game developer you may also be working with limited resources and dedicating lighting for non essential effects might not be possible. So how else can we make our models stand out?
It's actually very simple to add a fake rim light to your characters as a texture layer in your materials. This 64x64 image can add a lot of pop to a character without adding any extra lights. Just set it as an additive mix over your diffuse color, it needs to be mapped to "normal" co-ordinates or whatever they are called in your engine of choice. It's basically the same kind of mapping used by matcap textures.
Here's what it looks like with just the texture:
It's quite a subtle effect, you might want to increase the edge size by making the inner, black part of the circle smaller. If your game is very dark, you can give it a little bit of influence on how the material is lit. You can also change the hue of the light to match the incidental lighting of your environment. In a volcano level for example it should be red.
Here's an example of a simple low poly character with (left) and without (right) the rim lighting. It's a very subtle effect and it's easy to miss, but it can add a little bit of an extra outline to your characters, especially if they are standing in front of a dark background.
Another example shows how it can look better when the key light is behind or to one side of the subject.
You can see how this would look best in a dark environment, maybe with a scattering of green screen consoles around the level.
Using a little bit of code it's easy to switch out textures for different environments too, so that the rim lighting matches the incidental color or the level your character is on.
As you can tell from my examples, I'm not an AAA artist, so I expect real artists would be able to get better results from this technique. But even on my simple low poly models I think it really adds something for very little extra resource usage.
I think that with a bit of tweaking this technique can also be used to bring fur shaders to life, or add something extra to cartoon images, just like the one that inspired me.
Note: Photography credits can be found on the pages I've linked above. The source of the game images should be obvious. :)
The white edge highlighting and ambient occluded creases give a kind of high contrast that is similar to, but different from traditional comic book ink work.
I'll be honest, I don't know if there's a specific term for this effect in 3d design, since my major at university was in traditional art. I learned it as part of photography.
You can find plenty of tutorials on "what is rim lighting" for photography. It basically means putting your main sources of light behind your subject so that they are lit around the edges. It can produce very arresting photographs, either with an obvious effect when used on a dark subject...
..,or as part of a fully lit scene to add some subtle highlights. See how alive the subject looks? It really separates them from the dark background and makes them in to an iconic image.
Now here's where it can be useful in your games. Because modern games can be very busy, with lots of environmental details, sometimes it can be hard to bring your models out of the background and make them stand out. There's a whole generation of games which were very muddy and brown, where the often great models are lost in the fog.
Darkness is also a problem, with "too dark" being a common complaint that indie games run in to during early development.
There are ways around this, use of light and shadow is very important, and there are always quick cheats like colored selection outlines to help the player find important interactive objects on the map.
But it's not always possible to have perfect control over the lighting in your scenes, and we don't want the UI to intrude too much in to the game world. If you want your game to have a dark atmosphere, you don't want to always rely on a player carrying a torch or flashlight. If you're an indie game developer you may also be working with limited resources and dedicating lighting for non essential effects might not be possible. So how else can we make our models stand out?
It's actually very simple to add a fake rim light to your characters as a texture layer in your materials. This 64x64 image can add a lot of pop to a character without adding any extra lights. Just set it as an additive mix over your diffuse color, it needs to be mapped to "normal" co-ordinates or whatever they are called in your engine of choice. It's basically the same kind of mapping used by matcap textures.
Here's what it looks like with just the texture:
It's quite a subtle effect, you might want to increase the edge size by making the inner, black part of the circle smaller. If your game is very dark, you can give it a little bit of influence on how the material is lit. You can also change the hue of the light to match the incidental lighting of your environment. In a volcano level for example it should be red.
Here's an example of a simple low poly character with (left) and without (right) the rim lighting. It's a very subtle effect and it's easy to miss, but it can add a little bit of an extra outline to your characters, especially if they are standing in front of a dark background.
Another example shows how it can look better when the key light is behind or to one side of the subject.
You can see how this would look best in a dark environment, maybe with a scattering of green screen consoles around the level.
Using a little bit of code it's easy to switch out textures for different environments too, so that the rim lighting matches the incidental color or the level your character is on.
As you can tell from my examples, I'm not an AAA artist, so I expect real artists would be able to get better results from this technique. But even on my simple low poly models I think it really adds something for very little extra resource usage.
I think that with a bit of tweaking this technique can also be used to bring fur shaders to life, or add something extra to cartoon images, just like the one that inspired me.
Note: Photography credits can be found on the pages I've linked above. The source of the game images should be obvious. :)
Comments
Post a Comment