Compile a list of ‘best CRPGs ever made’, and the Baldur’s Gate series will probably appear on there. Baldur’s Gate II: Shadows of Amn might look a little turn-of-the-millennium these days, but it still demonstrates everything an RPG should have – expansive locations, intriguing NPCs, and diverse character development. Yet the series has largely been on hiatus for the last two decades. Continuing such a well-loved franchise would surely require a studio with some serious development chops.
Enter Larian Studios. Larian has gradually been establishing its credentials as a maker of outstanding CRPGs, notably with the release of 2017’s Divinity: Original Sin 2 – another game that appears on many ‘best of’ lists. Larian therefore seemed an ideal choice to partner with Dungeons & Dragons IP holder Wizards of the Coast, to take on the next entry in the Baldur’s Gate franchise.
In October 2020 Larian released Baldur’s Gate 3 in Early Access. Alena Dubrovina and Koen Van Mierlo, respectively Lead Character Artist and Technical Art Director at Larian Studios, recently took the time to detail their ongoing work on Baldur’s Gate 3, and how Larian uses the Substance toolset in its pipeline.
Bringing Substance, and PBR, to Larian
Koen: We introduced the entire Substance suite to Larian with Divinity: Original Sin 2. This came with its own problems, at first. For me, the biggest hurdle initially was trying to convince artists to adopt it. We’d previously been creating textures in Photoshop, and everybody was used to working with that – artists preferred to stick with the software they already knew, and a lot of them didn’t believe that using Substance Painter would make much difference to their workflow. But in the end, they really got into it, and the art team quickly realized that it was a much easier way to texture.
I think we did a few things wrong regarding PBR during DOS2, though. The problem stemmed from not really understanding PBR’s concept of values, and how you work with those values – which are actually quite well-defined. If you don’t grasp that, you might run into the issue where you’re forced to work within a very narrow range of values. That’s something we’d been doing in the past for years, because that’s basically how game art worked back then, and this is what happened during our work on DOS2. That realization came a bit late for us, then – I have to say that we kind of fudged it on DOS2. But we’ve really nailed that on Baldur’s Gate 3, I think.
Alena: I feel like artists tend to make their textures far too dark in general, because that might help you hide certain visual issues and achieve contrast between different parts. Whenever we receive something from a freelancers or from in-house artists, it usually needs to be brightened up by around twenty percent to reach a PBR value.
Koen: I think one of the causes for this is that when you start up Substance Painter you have a sky dome that lights up your model – but you don’t see it; the only thing you see is a black background. And so you tend to darken your artwork. If you showed that same asset on a white background it would look too dark. But if you show a dark asset on a dark background, it actually looks much brighter. It’s relativity of color at work here.
Relativity of color: this line has one value (50% gray), but it looks like a gradient.
In this photograph, the blue sheet and the pink bin stand out. But if we only look at the values , the blue sheet has the same value as the wood it’s lying on. The pink bucket has a darker value than the wooden frame next to it.
When artists make beauty shots, they usually select a really dark background, with a spotlight, in order to improve the overall look of the asset. But this doesn’t always help you to clearly define the proper PBR values. And, actually, trying to convey these concepts to artists is a full-time responsibility,
I think it’s really important that people understand the concept of PBR. If they don’t understand it, they won’t be able to get their art moving forward. They’ll stick to only trusting their eyes, and that’s something you shouldn’t do, especially with PBR, because your assets can look completely different in different lighting conditions. If, for instance, you have snow, that should look like snow whether you’re observing it in the evening, or in full daylight, or in a dungeon.
The easiest way to check your values is to use a histogram, and compare them to values you already know. Sébastien Lagarde’s chart is a really good starting point:
This color chart is not meant as the de facto colors we need to use. Instead, it should be used as a frame of reference to help artists define correct values for their assets, the darkest substance being coal and the brightest being fresh white snow.
I added the DONTNOD color chart in the engine. The value shift from dark to bright is clearly visible in the grayscale version.
Substance Painter Value Range
The values for coal (50sRGB), mid-gray (186sRGB) and snow (243sRGB) translate to the following in Substance Painter:
pow(50/255,2.2) = 0.032
pow(186/255,2.2) = 0.5
pow(243/255,2.2) = 0.89
Example: Bleached Bone Material
The skull looks white on sand (166sRGB), but gray on snow (243sRGB).
It’s probably higher than middle gray (186sRGB) and rough wood (203sRGB), so I ‘guesstimated’ its value to be around 222sRGB.
In Substance Painter the value and levels look like this:
Notice the big difference between snow (243sRGB) and 222sRGB, both in the value slider and in the levels tab, even though, numerically, these values are quite close to one another.
In our editor, that skull value (with all the dirt and scratches on top) looks like this (below). I’ve included different light settings ranging from full daylight to night to illustrate that the material works under different lighting conditions.
Alena: In addition, when you have a lot people working on one project, it’s hard to keep things consistent. With cloth, for instance, you can have a wide range of PBR colors, but if one person always makes them really dark, and another one keeps them bright, when you preview them in the engine they won’t match. And this is true of clothing, armor, vegetation, environments, and so on – if all your artists are doing their own thing, and making their textures the way that they personally think they should look, then there are no rules and the final result won’t come together. We struggled with this in DOS2, and I think we can still improve on this; it’s ongoing work. So you need to establish visual rules – and PBR is an easy, existing guide; you don’t have to come up with rules about how your whites or your blacks should look, because that’s already defined by PBR rules.
With characters this is more challenging. Eyes, for example, are never going to be PBR. If you’re making a shader for eyes, with a base color map, a normal map, and a roughness map, they aren’t going to look right. With eyes we had to come up with tricks to ‘cheat’ the characters’ eyes into looking better in a PBR environment. We use a custom shader for that, and it’s technically still a PBR environment – but there’s a bit of a fantasy aspect in there, too.
Koen: Yes, eyes are indeed the best example of that. We faked the little highlights in the characters’ eyes. Because if they aren’t there, those eyes just look dead. So we needed those highlights. When you’re filming a scene you can tailor your light depending on what you want to achieve; that’s basically what we’re doing with the shaders for the eyes. We essentially follow PBR rules, but bend them – not too much; just a bit – to make the eyes look better.
Another example would be silk. Silk has a colored specular. You actually need to make it look slightly metallic; your metallic map needs to be gray for it to look like silk. If I say that to a programmer, it’s completely wrong, it’s against the rules. But it’s the only way to make this material authentically look like silk.
Sometimes it’s quite a balancing act between precisely following the rules, and deviating from the rules just enough to make things look better.
Note that further information on physically based rendering can be found in The PBR Guide, on Substance Academy.
Alena: We did a lot of research for Baldur’s Gate 3 – we didn’t just jump in and assume we’d get everything right. We carried out an analysis of other games on the market, the kind of things they were making, how they approached texturing, and so on. We even looked at what sort of information they’d include in their base map, things like that. And we also looked at what we’d done previously in DOS2, and asked ourselves how we could bring this up to another level.
The challenge here is to realize that you need to tailor your tools, whether that’s Substance Painter or another tool, to meet your needs. You shouldn’t just look for something that’s already figured out. Also, you can look at things like tutorials that will explain how to do skin textures – but this sort of information is rarely applicable for commercial projects, because you’re always going to find yourself in a unique scenario at some point. Instead, you should focus on how you want something to look for your project, and break down the steps necessary to achieve that.
It can be hard to figure out exactly where to start at the beginning of a project. If you’re working with Substance Painter, for instance, you’re never going to start by building a complex shader for future color customization when you don’t have any context. The content and the design needs of your project should always come first. Analyze your designs to build the proper customization systems that will not only maximize the content, but that will be well-integrated into gameplay systems, so that they can contribute not only to the visual look but also to the player experience.
Even though we already had well-established pipelines in DOS2 we realized that they wouldn’t be sufficient for BG3. We had to carefully plan a new roadmap of features and revamp most of our character pipelines in order to be able to keep up with the industry standards.
Overall, I believe that planning, prototyping, and innovation are the main pillars of success for any personal or commercial project.
The Larian Skin Shader
Alena: In Baldur’s Gate 3, as players can customize skin color, we decided we needed to create an elaborate system that would work well for both fair and deep skin tones.
Previously, in DOS2, we had a skin color customization system that was fairly simple. We’d make a base color map that would be free of color. We’d keep reds, yellows, and blues and then multiply this base color map in the editor with the custom skin color. This worked well; however, we noticed that depending on how this base color map was built some colors looked better than others. For example, if you add too much saturation in your base color map, and too many spots and highlights, the deeper tones would look good, but the fairer skin tones wouldn’t look right. Conversely, if you balanced it so that the fair skin tones looked great, the deep tones would look too flat.
So, while we’d previously pre-blended all the colors in one map, this time we decided to split all the colors into masks and blend in them real-time in the shader, so that we can have control over their intensity and shade. This allowed us to customize how much red, yellow, and blue each skin color would have in order to achieve the best result with any skin shade – from a deep red tiefling to the light green githyanki skin tones.
With this approach, instead of having one base color map we ended up with four maps: hemoglobin, melanin, vein, and yellowing maps.
Below are examples of the properties of the map being changed in the material, which gives us a lot of flexibility for varied textures using the same maps. An example from Substance Painter:
Additional information on the texture set settings mentioned below can be found in our Substance Painter documentation.
User4 in L8 mode in Substance Painter.
The hemoglobin mask controls the appearance of blood vessels in the skin. This map allows us to make the face appear more pale or red, depending on the look of the character we need. With this, we can make characters appear angry or pale, depending on the situation.
We used scanned data to create this; we therefore extracted the hemoglobin map from our photoscanned textures in order to have a solid base upon which to texture.
User5 in L8 mode in Substance Painter.
Melanin is the base map to control the undertone of the skin. We achieved a realistic look for our non-human races by changing the melanin color to fantasy colors like red, green, and blue shades.
User6 in L8 mode in Substance Painter.
The vein map controls the blue tones in the skin. Many of the blue areas are under the eyes and around the ‘stubble’ zone of the face (including the scalp, where there are hair pores). The lips also tend to have a bit of blue in them, this is what gives them their ‘pink’ quality. It’s important to have a balance between red and blue in the lips to get that natural, fleshy tone.
User7 in L8 mode in Substance Painter.
This map represents yellowish patches on the skin. We use it to saturate the face globally when changing skin tones.
User0 in RGB8 mode in Substance Painter.
In the CLEA map we pack a cavity map, a hair mask, a lip mask, and the AO map.
All the heads have the same UVs, so we have a bunch of maps that are shared between every character. For example, rather than having a unique roughness map we use a shared T-zone roughness map, and blend it with a cavity map that’s unique for each head.
We also use cavity maps to break up dirt and blood that can be applied on heads procedurally.
A hair mask is usually used for eyebrows, but for some unique heads, like Gale’s head on the image above, we used it for stubble too.
And lip masks give us the possibility to use different degrees of roughness, and different lip colors, for make-up.
The Larian Armor Shader
The main focus of our armor shader is also color customization. Here the setup is a bit more common than with skin. We have base color and ID maps that look like this:
Our shader consists of 12 potential colors that we use to mask out different materials; they’re distributed in the following way:
We built up the same system in Substance Painter that we have in-game; we can therefore have a good preview in Substance Painter before we import our work into our engine. Like this, we can quickly preview and test how the asset would work in different color combinations, and make quick iterations.
In the future we’re planning to continue developing the shader even further, and potentially loading a couple of color presets that we have in the editor into Substance Painter so that we can quickly preview armors and outfits with existing color palettes.
Meet Alena Dubrovina
Alena Dubrovina is Lead Character Artist at Larian Studios, working on titles including Divinity: Original Sin 2 – Definitive Edition and, more recently, Baldur’s Gate 3.
Meet Koen Van Mierlo
Koen Van Mierlo is Technical Art Director at Larian Studios. He joined Larian in 2005, and has worked on a range of games including Divinity II: Ego Draconis, and Divinity: Dragon Commander, as well as on more recent titles such as Divinity: Original Sin 2 – Definitive Edition and Baldur’s Gate 3.