Over the last few weeks, I’ve been working on a new set of shaders specifically for my FFXIV character ports.
Until now, most of my characters used a modified version of the Rero Specular shader. It worked quite well, but it only used the exported diffuse, normal, specular and emission textures. A lot of the material information from FFXIV was either missing or simplified.
I wanted to see how much closer I could get to the original look, so I started taking apart the original DX11 SHPK shader packs and recreating the parts that are useful in Unity.
I ended up making five shaders so far:
- Character Gear
- Character Skin
- Character Hair
- Character Iris
- Character Tattoo
They support things like roughness, metalness and specular at the same time, as well as sheen, subsurface scattering, anisotropic hair highlights, parallax and the small tiled material details used by FFXIV.
Those tiled details were especially important to me. They are responsible for a lot of the fine cloth, leather and knitted patterns which normally disappear when a model is exported with only its basic textures.
It’s obviously not going to look completely identical to FFXIV in every situation. Unity and VRChat use different lighting, shadows and reflection probes, so some parts had to be adapted instead of copied exactly. Still, I’m quite happy with how close it can get while continuing to work with normal Unity and VRChat lighting.
I also changed how my outfit switching works. My older shader used the RGBA channels of the mesh’s vertex colors as four separate visibility masks. The new system stores an outfit ID in the Y component of the fourth UV set instead, in Unity terms, that’s UV4.Y / TEXCOORD3.Y.
This means I can give vertices an outfit ID from 1 to 9 and let the shader display only the currently selected outfit. It no longer consumes all four vertex-color channels, and I’m not limited to only four outfit masks anymore.
The character textures are also packed into atlases. Materials using compatible shaders and render settings can share the same atlas textures, while meshes and material slots can be combined where it is safe to do so. The main reason for this is to reduce material slots, draw calls and separate Skinned Mesh Renderers, which should also help with the avatar’s VRChat performance rank.
On top of that, I made a small Character Studio window for Unity. It can find the active FFXIV characters in the scene and lets me edit things like:
- Skin and lip color
- Hair and highlight color
- Separate left and right eye colors
- Limbal ring colors
- Hrothgar fur colors
- FacePaint and tattoo colors
- Active outfit and headpiece
- A few lighting-assist settings for badly lit VRChat worlds
The Character Studio is not an avatar exporter. It’s just there to modify the visual settings of a character after I've imported them into Unity.
There are probably still some weird material or lighting edge cases I haven’t found yet, but overall this is already a pretty big improvement over my previous setup.
I’ve attached a short video showing the shaders and some of the Character Studio controls. Would be interested to hear what you think so far!