Hey, this is my latest Character: The StrangerThis is a little demonstration of the Stranger in action, running around in UE4
Okay so this time I wanted to go all out: a full character that could be part of a AAA-Game, including setup in UE4 with a basic movement system, swappable equipment & armor customization like in For Honor or Warframe.
To achieve this I built a custom Layered Shader in UE4 that I'm sharing with the community.You can get the Armor Customization Shader here: https://gum.co/ZcrMO
Buuuuuut to achieve flexibility like this, your mesh needs to be set-up and planned in a certain way, so bfeore you go ahead and try to use the shader please read the following explenation of my character setup.
But first a big shoutout to Natashia Tjong who skinned this Character for me:https://www.artstation.com/latiwings
And Denys Rutkovsky, I used his Medieval Environment for the background of this character.https://www.artstation.com/rutkovskyhttps://www.artstation.com/rutkovsky/store/xr3/fantasy-village-kit-ue4
How does the Armor Customization Shader work?
Simplified my shader looks like this:
Basically it takes a base texture and blends 5 Layers of different materials ontop of the base,
to do this is uses a Mask texture that tells it where to blend each layer, additionally it also uses a 2nd & 3rd UV channel to add more flexibility to the way the different layers are blended into each other.
What does this actually look like in UE4? Like this:
Yes that looks quite intimidating but you don't need to understand what all those nodes do, you just need to feed them the right mesh & texture information.
So let me illustrate how I created my character to work with this shader setup:
1. The Base Layer
The Base Layer is quite simple, it includes:
Channel Packed AO, Roughness, Metalness
Channel Packed Masks for 2 Cloth layers & 1 Paint Layer
To be able to paint the additional Masks I added 3 Custom Channels in Substance Painter:
Lets take a look at where I painted the masks for the different layers on the Stranger Character:
As you can see the Metal and the Cloth masks don't overlap each other, but the Paint Mask is overlapping some of the cloth.
Additionally I did not use full black/white layers for the Cloth. This is because I wanted to have some AO and Dirt shining through from the Basecolor.
2. Cloth & Metal Layers
To be able to input tintable Cloth Layers I created another Mask setup:
The cloth layers use the Red
Channel as tint masks and the Blue
channel for the roughness. So it looks something like this:Red
I also created a Variable called "Leatherswitch", if it is set to 1 instead of the tintable textures it will use a Full RGB texture and take the rougness from its alpha channel.
The metal layer uses the metalness from the Base Layer as its mask. Additionally it uses another channel packed texture with this channel setup:Red
For the Trims at the edge of the clothing I used a different setup: It uses the meshes UV Channel 2 for blending and a horizontaly tiling texture.
To be able to preview the Trims on my mesh I created this handy debug texture:
If you look closely there is a little white dot at the top left corner of this texture, this is the Alpha Deadzone.
This is where all the UVs of your mesh need to be that won't have any Trims applied to them.
If you apply this texture to my mesh it looks like this:
To achieve a good result when applying the trims it is important to plan the mesh with the trim locations in mind. This is helpful during the highpoly stage and invaluable during lowpoly to avoid reworking the mesh.
This is the wireframe of the Stranger Character:
If you look closely you will notice how I adjusted the edgeflow to conform to the trim shape so that I could easily cut the UVs for them.
But not everything went smoothely, some design decision were suboptimal for future use I would like to note that any angles larger then 45 degrees will cause problems for the trim UVs, here are some problem areas of my mesh highlighted:
4. Paint Decals
The last layer is the Paint Layer, it blends ontop of all other layers.
It uses the paint mask from the Base Layer and another channel packed texture for its colors.
In this case Red
are all Tintable so if you input a regular full color texture and apply leave the tint values default the shader will just display that texture as is.
The idea for these paint textures was for them to be sharable between different characters, so they use a 3rd UV set that can be individually adjusted to make the texture fit on any character.
The master layout for these textures looks like this:
5. Other Shader Features
With all the above features applied you should be able to achieve a result like this:
But the shader has a couple more miscelanous features, for example both the Trim and Paint Layers have an opacity slider that allows them to be deactivated at any point during runtime. I used this to quickly preview different variations and debug the shader and textures.
There are tint inputs for the Basecolor and Vertex paint is used for 2 functions:Blue
controlls the color opacity of the Trims, it can be used to use the trim as normal decals, for the Stranger I used it to have normal decals on the belts.Green
is plugged into the opacity mask and can be used to hide or toggle parts of the mesh.
I created these 2 versions of the character just using those miscellaneous features. One could easily imagine them as a Basic & Prime Variant
If you like this character you can buy the whole thing including sourcefiles here:https://gum.co/MXIZY
Alright sorry for the massive amount of text, I hope the function of this shader is understandable to everyone.
Ofcourse please let me know if you have any trouble using it and I will do my best to answer any questions in this thread.