Jump to content

Facial Recognition (updated)


AVS

1,871 views

I've cracked the code.

 

Okay, nothing actually that over-dramatic, but still. I managed to figure out something that's been bugging me for a while, and I'm a little excited about it. So while I had a pile of other stuff that I've been working on banked for a post, I'm gonna skip over it for the moment and show off something that I worked out literally yesterday.

 

Pretty much right from the first point I started at making masks from in-game faces with the COR heads, I've also been poking at the idea of making 'living' faces that could be used with the DMA system. One of the biggest flaws with making equippable parts out of the games' head meshes is that they lose all of the facial animations. That was one of the first things I stumbled across during that abandoned 'detachable head' experiment early in the DCC project, and I've yet to find any reasonable way to add them back in while maintaining the parts' swappability. It just doesn't seem to be something the game's really built to do. When I was cutting the head meshes up into masks, however, it occurred to me that doing things the other way around and making 'mask' versions of the head meshes should be technically feasible. It would lose the capability to swap around faces, as they'd be treated just like the game's regular headparts and thus would be restricted to the single character that they were built for, but having a 'cyborg mask' with working facial animations was enough of a draw to make investigating the idea worthwhile. 

 

Now, there's two ways to approach this, design-wise. The first is what you could call the 'hardware' solution- physically chopping up the mesh in the same way I did for the masks and subbing that in for the character's existing head model. I've featured my attempts at this route before in this blog, but it never quite worked. While subbing the mesh in was possible, it turned out that having it mismatched with the head's .tri files resulted in a number of the facial animations and morphs going all, to use the technical term, 'wonky'. There didn't seem to be any way to remedy that short of making whole new .tri files for the mask-cut head meshes, which was well outside of what I know how to do, and I also had concerns about how those altered meshes would or wouldn't work with existing face presets. So after a last try around the time I was making the first batch of the Vanilla faces, I pretty much gave up on the idea.

 

The second route would be the 'software' solution, and was actually the first idea I had for approaching this because it seemed much easier... but then I could never get it to work. Theoretically, all you really need to do to achieve the effect I was looking for was to alter the head's skin texture by erasing everything except the face. Without a texture, the rest of the mesh should be invisible and thus function about the same way visually as the physically cut mask meshes. Problem was that it didn't. I could alter the texture all I wanted, but when I tried applying it to the mesh, the mesh would inexplicably continue to display the unaltered texture on the areas that should've been rendered transparent. I had no idea what was going on there and that last point was particularly weird, so I shied away from it and explored the hardware solution instead. But the other night, and I'm not even sure what exactly prompted this, I started thinking about it again. I'd had to figure out how to make headpart entries in the Creation Kit as part of getting the null heads for the DMA followers I've been messing around with to work, and it occurred to me that I should look at how the use of texture sets and skin swaps on headparts might affect things, especially in light of how I had to use them extensively to get the right skins on the Doll bodies. I also wanted to see how a non-Vanilla skin set like on the COR races worked, so I loaded up an early COR follower mod in the CK and started poking around at it. 

 

Turns out none of that actually mattered, though. No matter how I tried re-pointing the textures, it kept doing the same thing. So as a last-ditch effort I opened up the character's head model in Nifskope to take a look at things... And remembered all the 'NiAlphaProperty' tags that I had to pull from hair meshes to disable the transparency effects for the stone and brass versions. Surely, I thought, it can't be that easy.

 

1328226962_ScreenShot05-21-20at09.31AM002.jpg.bb8826c5d885f316e5cd9d8d8807f8ee.jpg

 

It's that easy. ?‍♂️

 

685632770_ScreenShot05-21-20at09.36AM004.jpg.8f5a9ce660c3fa03f7cdb7abcd769f22.jpg262246207_ScreenShot05-21-20at09.41AM002.jpg.f787180d17a7c35024429353bd71cf95.jpg

 

Look, I still don't know how a lot of this stuff works, okay? I'm just high-level faking it. 

 

Lilitha had a bit of an issue as a test subject, though, as her hair's built in a way that makes it basically permanent. But there didn't seem to be any reason the same method wouldn't work on Vanilla faces. So I made dupes of a couple of my old NPC projects, good 'ol 12-16 and an appearance modification of the 'Swimmer' from the north Reach that I made ages ago, and applied it to their head meshes.

 

982212405_ScreenShot05-21-20at11_12AM.jpg.47899a3d7abc616b50669ce942490fbb.jpg

 

Now first off, this initial test clearly shows one of the problems with this method, which is figuring out exactly which parts of the texture need to be erased. This isn't helped much by the fact that the texture isn't mapped on all that evenly, so doing a quick and dirty oval cut-out of the face left me with jaggy edges and way more scalp than I expected, thusly:

 

1289534390_ScreenShot05-21-20at11.11AM003.jpg.8ec11cff01f95100e2e1178848d455cb.jpg

 

But this was more than good enough to test out the concept with, and the details can be fixed later. The next problem is providing a robotic frame for this, as the ones already included in the DMA are set to a slot that would displace this face. But I already had some Crystal Frame heads set to alternate slots from the hardware solution's experiments, so that was a non-issue for now.

 

527810386_ScreenShot05-21-20at11_21AM.jpg.6793359785a419caed0e3409a1f2e278.jpg

1870964458_ScreenShot05-21-20at11.29AM004.jpg.1e356c81ea0ccd7ac5a3415f16efead9.jpg1416754664_ScreenShot05-21-20at11.29AM009.jpg.a6e53acc8ba1377b20939bf4d68485ad.jpg1245255954_ScreenShot05-21-20at11_31AM.jpg.fe7c7b145588aa514c75a730834a0a4d.jpg

 

The exact logistics of those head frames are going to require more thought, though. Which slot they'll use is one concern; they need to be on one not really used by anything else to avoid them getting displaced at random. I've currently got one on slot 35 and one on 50, but I need to look around and see exactly how much competition those have. Another issue is the design of the frames, especially around the eyes and jaw. These were originally designed for the very non-Vanilla Sextreme faces, and while they happened to fit into the COR faces just fine I found out early on in the Vanilla face project that they were a bit too over-built for them and tended to clip through a lot of the thinner faces or ones with deep-set eyes. I made some changes to the frames which alleviated those issues, but they didn't completely resolve them and I'm leery of making further changes to those models because it'll start to affect how they look without a face attached. Here, however, the face itself is 'permanent' and the frames meant to go with it are not intended to ever have their front sides on display, so I should be able to make more drastic changes without them becoming all that noticeable. Maybe not enough to avoid all potential clipping, but altering the faces themselves is less of an option here, so it'll have to do. I'll also pretty much have to give up on the frame structures inside of the face, for much the same reason. But these are all worthwhile trade-offs to get the animations back.

 

788597614_ScreenShot05-21-20at11.34AM016.jpg.ad58573b40add0f31ab2f911bb5e70b2.jpg32667764_ScreenShot05-21-20at11.34AM028.jpg.50cf3ef329758b0746607a378b9054e8.jpg

1539157663_ScreenShot05-21-20at11_34AM.jpg.ce0e29e839533a77abd7748d013e0cfb.jpg

 

The eyes are another concern. The lovely orb eyes I made for the Vanilla masks don't really transfer back over, sadly, and due to how the eye meshes incorporate the eyelashes it's not an easy proposition to just sub in the swirl texture I used on those, either. (It would be on the COR eyes where the eyeball and eyelashes are separate parts, but...) I've got plenty of options for Vanilla-type eyes to use, though, especially from the Portal Eyes and Holzfrau's Dwemer set, and even some of the nicer human eye textures. And these have their eye tracking back, the loss of which on the masks was the biggest reason why I ditched them in favor of the omnidirectional orbs in the first place. 

 

929414442_ScreenShot05-21-20at11.25AM010.jpg.7b7f246a49885308cd84c7cff606c7a5.jpg1002804365_ScreenShot05-21-20at11.26AM002.jpg.d57e0e4e7fe5f2f73af4d6e915830e1b.jpg

187438170_ScreenShot05-21-20at11.26AM006.jpg.e28bab03565ab118dc96de4af9ee81b3.jpg

 

The eyes are a factor in how much of a pain in the ass these are going to be to implement, though. You see, until yesterday my plan for the DMA followers was to give them all the null heads and set their respective Vanilla mask as part of their outfit to build the character. I briefly considered including a copy of the full head model that I'd built the masks from as their default headmeshes, but it seemed like too much new work to learn considering that I've never built a follower for distribution before. But now I've got to basically do just that, which means I'm going to have to figure all that crap out. I probably won't do it for every single follower (and I wasn't planning on making NPCs for every Vanilla mask I've put into the pack anyway), but it's still quite a bit of extra work. I'll also have to figure out how exactly I'm going to handle their hair. The wigs, as-is, don't color match on the non-player characters (and it can be kinda spotty on the player, at that), so I was thinking about doing some character-specific alternate colors like the blonde Shero wig for 12-16 above. But as I'm already planning on leaving them with a 'real' head, I could conceivably include regular hair-part versions of the styles I wanted to use and let the game color them like normal. It's more work, but it would polish things off a bit. Not that the wigs don't work fine in their current state, provided you like brunettes...

 

277721919_ScreenShot05-21-20at12_00PM.jpg.5c17c81c66b03d6829cb8f11fae45dff.jpg61003478_ScreenShot05-21-20at11.59AM006.jpg.79878d2537dad305f1b2ee3f00bc3ad7.jpg

1199166056_ScreenShot05-21-20at12.01PM005.jpg.2d180974b2dc8c53ed5b37f7c41636dd.jpg

 

But speaking of polishing things off, let's go back to that... Cut line? Erase line? ...Where the edges at. Like I said, for this first test I just plopped an oval down and called it a day, but that clearly isn't something I'd want in a proper release. The ideal would be to get it pretty much in-line with where the edges of the physically cut mask model are, for consistency with those since I don't intend to take them out at this point. (Maybe I'll stick each character's mask into their non-outfit inventory. That'd be fun.) The question was how to see where the edges from that mesh lined up on the texture. As it happens, NifSkope does have some texture mapping editing tools that are mostly way outside of what I want to mess with, but as a part of that display a visual overlay of the vertices on the texture, thus:

 

1631491773_ScreenShot05-21-20at12_57PM.jpg.5bbdf34ba89b9559ca89acbb42e807c8.jpg

 

With that, it's just a matter of taking an isolated screenshot of the UV mapping window scaled to an even number of pixels, blowing that up to the texture's ratio, copying it in as a new layer over the skin texture, reducing its opacity and adjusting its position to get things to line up as well as possible, using the free select tool to trace the vertices around the outside of the mesh overlay, inverting that selection and erasing all the skin outside of it, making sure the image has a proper alpha layer, and then exporting it to a file that Skyrim can read. Simple, right?

 

Ha.

 

But in the end, you do get something that pretty much works.

 

1716728432_ScreenShot05-22-20at09_07AM.jpg.4564267f03902502eacd628da2c70a3d.jpg

 

It didn't come out quite even, both because tracing those vertices was kind of a pain and because it looks like they're on there a bit lopsided to begin with. Comparing it to the meshlines in NifSkope it's clearly not perfectly matched to them.

 

1569791522_ScreenShot05-22-20at09.01AM002.jpg.0988603fb0c12b502b2dab579af33db5.jpg

717848355_ScreenShot05-22-20at09.01AM001.jpg.459fd1425648389ea2ec1cedd684eafb.jpg1949526995_ScreenShot05-22-20at09_01AM.jpg.2760eaba3af82feb36b83f8c303975c5.jpg

290929176_ScreenShot05-22-20at09_02AM.jpg.585708be9e8b71b17efc1f8061508edf.jpg

 

But this is definitely a case of the perfect being the enemy of the good the damned enough, and it looks fine as it is. There's some slight jags at certain points, but you have to look close to really see them in-game. 

 

597152934_ScreenShot05-22-20at09_00AM.jpg.7f2708821a336f00a9a8a7cd9f28e57f.jpg

1697034605_ScreenShot05-22-20at08.00AM001.jpg.f83bef46951e874b36b8f2f83bcfadaf.jpg

 

I should also mention the question of the ear-caps. Keeping the rest of the robotic mask structures wouldn't really work that well, but I would like to retain those given that they're the element that mounts the face to the head frame. The problem is the variance in head widths between individuals and especially between the races. I've been manually adjusting them for each mask, but here I'd need more of a one-size-fits-most solution, along with a different way to implement them. My current thinking is to make slightly thicker caps incorporated into the alternate frame's model, with race-specific versions for humans, elves, and orcs. That should hopefully cover most of the potentials, but I haven't actually tried building that yet to see how it'd work out. This is all still very preliminary and there's plenty of possible stumbling blocks, but it's an infinitely more promising approach than the previous attempts.

 

I mean, hot damn.

 

1788676047_ScreenShot05-22-20at08.03AM002.jpg.45a3890c5acde02ad54fb3e9aa4173a4.jpg306650409_ScreenShot05-22-20at08.03AM007.jpg.3f42b17ba36122e7512a7727a4257b73.jpg

166250470_ScreenShot05-22-20at08.03AM011.jpg.326393d9c92557c28d66c31ac873bdad.jpg392877282_ScreenShot05-22-20at08.03AM016.jpg.eecbbafe57a4727aa049c878e45f2f67.jpg

565188713_ScreenShot05-22-20at08.04AM002.jpg.544a0b14d044801316420c6e0642d242.jpg1613810529_ScreenShot05-22-20at08.04AM007.jpg.d2a9cd4089478852afe154c8eed606a2.jpg

 

But the most potentially interesting thing about this method isn't actually how I'll be using it for my own characters. It's how it works on any character with an exported FaceGen. Making masks out of personal followers was mentioned in comments before, but using the hardware solution it's a pretty laborious process. With this, once you have the altered texture it's basically three steps in NifSkope.

 

One, repath the skin texture to the mask-cut texture.

 

48896453_ScreenShot05-22-20at08_07AM.jpg.d6d69412629bb966922295c523487ae1.jpg

 

Two, right-click on the head mesh. Go to Node > Attach Property > NiAlphaProperty.

 

1043026236_ScreenShot05-22-20at08_08AM.jpg.43f1313b46794b16121ca4b63395b074.jpg1849251726_ScreenShot05-22-20at08.08AM001.jpg.3624dd7c08bc8a2b118be0fd6c57c7db.jpg

 

Three, go to the Lighting Shader line under the head mesh in the Block List. Go down to Shader Flags 2 in the Details pane and click 'Double Sided' to prevent the face from being see-through from camera angles behind the head. Do the same with the mouth mesh, if needed.

 

887956783_ScreenShot05-22-20at01_33PM.jpg.701394ab41859ca370850a81b3f90348.jpg

 

That's it. That's literally all the modifications you need to make to an NPC, and again this should work on any one with a head model that you can access. (I'm not sure where/how the player's head is stored, though, so I can't make any promises about using it outside of NPCs yet.) Once that file's saved the character will appear with a floating, disembodied face in-game, ready to be equipped with a proper head frame and DMA body. The hair probably shouldn't be messed with, as the game's expecting to see it and might do weird things if it's not there, but considering that a lot of the Vanilla hairs really aren't built with the idea of seeing them from the inside in mind...

 

357475356_ScreenShot05-22-20at08_11AM.jpg.8ffe85030d789d6eb8be5df1c530776c.jpg

 

...having some way to remove or swap them out in-game would be recommended. Like with the included wig sets! When I stop finding more things to do and get around to actually releasing any of this, that is. 

 

Speaking of those other things I found to do, I'll get back to those next post. Stay tuned.

 

161149824_ScreenShot05-21-20at11_35AM.jpg.a0fe765222111ee6bdc6fa3c5ac5f942.jpg

(Huarache Lights intensifies)

 

 

Update: Gonna tack this onto here instead of making a whole new entry for it, since it's just a straight continuation of what I was talking about above. I mentioned needing to make modified versions of the head frames for this owing to some morphs of the Vanilla head models not really fitting over the existing ones. This was something I was aware of from when I first started working on making my own Vanilla-based masks, but it wasn't until I started looking at making masks from existing NPC's faces that I realized just how bad it could get.

 

1268380945_ScreenShot05-23-20at12_04PM.jpg.a0d3203b842a1388c395777962248281.jpg

 

Obviously, that needed to be addressed before I could really do anything with this whole 'live faces' idea, so that was my project for today. And like I stated above, since most of that structure was built to make the frames look good without a face equipped, for this application where the faces would be 'permanent' and the front of the frames will never be seen most of that could get shrunk down or removed. These are just going to reuse the Doll heads' ground models, so the sins that the edits introduce won't be seen.

 

716453911_ScreenShot05-23-20at12.04PM001.jpg.a4a422f631b92596f7bb9ffeff3892ea.jpg558417513_ScreenShot05-23-20at12_05PM.jpg.d2d1f38659955426fd4ca8763de78ce9.jpg

 

The only real exception to that is on the Crystal Frame, whose open structure loses the brain casing that obstructs the view of the inside of the face from the back. In that case the Live version doesn't do anywhere near as good of a job of hiding the back of the eyes as the original version did, but it's still something that you generally have to be really looking for from weird camera angles to even notice. Considering that I have yet to run into a face that the modified structures clip through, I'll consider it an acceptable trade-off.

 

950152652_ScreenShot05-23-20at11.34AM002.jpg.e430f073d35846e81433252b30fd13d4.jpg

 

I also implemented the idea I mentioned above regarding the ear-plates, with race-specific versions added onto the models. These are slightly thicker than the ones used on the masks, and hopefully will work with most morphs, but I can't really guarantee it. For instance I could see there being problems on those more 'anime' styled follower faces that some folks like, where the effect is sometimes achieved by making the head wider than normal. But for the Vanilla ranges it ought to be fine. Probably. It's also far enough back that jaw movement doesn't seem to affect the clearance much.

 

108729702_ScreenShot05-23-20at11.17AM002.jpg.793e8b6795524236f170c5bd6a5cac56.jpg1189157439_ScreenShot05-23-20at11.18AM004.jpg.88cf1f2b8d1c3b014a0d68622144b5c9.jpg

1727438977_ScreenShot05-23-20at11.19AM002.jpg.f6c8ca181acda3a28c61e7672188d621.jpg

 

While I was putting these together it did occur to me that there might be an issue with how tetchy Skyrim can get about handling layered transparencies, given how these faces work by making part of the head transparent and the Brain Capsule using a semi-transparent texture, but I'm happy to report that the two seem to be able to co-exist just fine.

 

2031476760_ScreenShot05-23-20at11.20AM008.jpg.7c672d0ae31dfb7ace4cba10ba259981.jpg

1186179659_ScreenShot05-23-20at11.21AM005.jpg.2e7d282d9ac94e8595368e47e663cf64.jpg2114649227_ScreenShot05-23-20at11.21AM017.jpg.39b0103d453f437b418a1ff75271b0e6.jpg

1565000601_ScreenShot05-23-20at11.22AM014.jpg.0b45e1522db0af5d2ba76b2a875cd61a.jpg1484785782_ScreenShot05-23-20at11.22AM021.jpg.1e790c349ba36edc261ac5138e14b685.jpg

219413109_ScreenShot05-23-20at11.21AM021.jpg.4ceae4a145768faf8f6c7af45ae72a08.jpg

 

This is a definite relief, as having the visible brain effect compromised would've been a major disappointment.

 

...It does occur to me that I still need to check out how the faces work when viewed through water, though.

 

But speaking of co-existing, I also took a minute to check out one of the other things that made the idea of Live faces so appealing: Gag compatibility!

 

1407886668_ScreenShot05-23-20at11.26AM008.jpg.13b31399408d53655e397e1fb5097c18.jpg193084121_ScreenShot05-23-20at11.24AM007.jpg.cf8aa3bca315bf9c59b572287c3363ec.jpg1923069890_ScreenShot05-23-20at11.27AM007.jpg.61688fe29822207d8a5a0bccecd607e7.jpg

 

Since the Live face is fundamentally just a standard head mesh with only some texture modifications, it'll work perfectly normally with anything that affects the head like this. It should also work just fine with any face-based tattoo overlays or the like. I'm slightly less certain about what will happen in decapitations; the face itself should go flying as if it were a normal head, but what will happen to the underlying mechanical frame is rather in question. Particularly since it's currently using one of the decapitation slots, number 50. 

 

651255473_ScreenShot05-23-20at11.27AM002.jpg.a151e913edf988e2c8b65c8c9f8b1d14.jpg

 

I picked that one because it has fairly minimal conflicts, with the DD vaginal piercings being the only other thing I know of that uses it, and because some of the other viable slots put it right up against the gags and blindfolds, which I actually cared about. Everything else either has similar conflicts or is just full up. One slot that is fairly free is number 60, but I do have one thing that makes use of it and that item keeps getting mysteriously de-equipped so I'm not exactly trustful of it. That said I might include an alternate set of the frames on 60 for those who have some reason to want 50 free. Changing the slot assignments on all the pieces is a pain, but it's doable. One thing I'm definite on, though, is that I'm only going to make these with the Doll necks. They're mainly intended to be used with the Doll body parts, and that neck's base works fine with robotic torsos, so there doesn't really seem to be any reason to bother with the old large neck pieces.

 

Given that these faces do require actively modifying the character's FaceGen, though, I was especially curious to see how Paradise Halls' NPC cloning process would handle them. Using PAHE and HSH slaves to make Automatons can be a bit difficult due to some factor in their unique outfit system that makes them highly prone to having their original heads pop back in. That problem wouldn't come into play through this method, but I was unsure if the cloning process would copy over modifications made to the original's head model. So I made a copy of a Bandit and applied the mask effect to their head model, then spawned them into the room I've been doing this testing in, where the various followers made quick work of them:

 

811815354_ScreenShot05-23-20at11.38AM002.jpg.d327f9a7cc1db35c99375fa1c87393a3.jpg

 

And then after using the raise-then-paralyze trick to get them into PAHE, it turns out that the modifications to the head model get copied over without any issue. 

 

1903387994_ScreenShot05-23-20at11_40AM.jpg.db8cd9c4ac8c723714c52ec0889407a0.jpg

 

'Course, the obvious problem here is that without any DMA parts you're just left with a face creepily floating over an empty neckhole. You'll have to fill that in with one of the Live head frames and the Doll collar...

 

1464530437_ScreenShot05-23-20at11.42AM002.jpg.ae9ee7f201f0a37993df8cc97db3de68.jpg575994280_ScreenShot05-23-20at11.44AM002.jpg.36ce06778a38c7f7902456680c1d649b.jpg

 

...Or you could just go ahead and replace everything else, while you're at it.

 

1960841564_ScreenShot05-23-20at11_54AM.jpg.153b7bb9549e2c20c7fbdc35d377810a.jpg1540460550_ScreenShot05-23-20at11.55AM001.jpg.632d781462317409d8b7c913fa752f24.jpg808208641_ScreenShot05-23-20at11.55AM005.jpg.022da81a3bfab01bb920e48a5d51a21c.jpg1073661209_ScreenShot05-23-20at11.55AM011.jpg.0a74b1f1d8607626069999987040d504.jpg

 

The only real problem I've run into with all this so far is that I can't think of any way to do all of this dynamically inside of the game, since it requires certain changes to be made to the .nif file for the character's head. So it can only really work on purpose-built NPCs like this, and not just any rando you run into in the wild, sadly. And those NPCs will have that weird floating face thing going unless their outfits are modified to have the DMA parts pre-equipped, which cuts down a bit on the ~~immersion~~, but considering that it took me the better part of a year to figure out how to do this at all I'll take what I can get. Just having some way to put an NPC's living face on an Automaton keeps me happy.

 

And speaking of, I chose that particular bandit model, one of the Bosmer Bandit Plunderers, for a very specific reason. Her face was on my shortlist for use in making the Vanilla NPC masks, and was actually once of the first ones I checked... and the first one that I found the clipping problems around the eyes on. So I particularly wanted to make sure that the new head frame structures were being cleared properly on her, and was quite pleased to see that everything fits just fine.

 

1481966255_ScreenShot05-23-20at11_56AM.jpg.7bcd94341247e2acf82b665a075946a5.jpg

 

And, of course, with accessories:

 

357532662_ScreenShot05-23-20at11.56AM008.jpg.1f71a7744654a82d7e45f0db5825b9c0.jpg2044367264_ScreenShot05-23-20at11.58AM013.jpg.4ac4cea5b46a0802307916f8f80a34b7.jpg

 

Quite pleased.

 

980764155_ScreenShot05-23-20at11.36AM003.jpg.e87b6979b9c8aeb890749b87c81e8719.jpg

 

 

 

 

5 Comments


Recommended Comments

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use