Jump to content

Two Problems, One Solution


AVS

2115 views

Previously, on This Blog:

 

1533423393_ScreenShot09-25-19at08_28AM.jpg.10e3a9f2948c12313570a491ec6f2304.jpg

 

This damn problem. Lacking any solution for this bizarre 'inverted lighting' on the ground models' skin meshes, I put an ask about it into the Outfit Studio thread and got some helpful information about the cause. Specifically that it was due to the normal maps somehow getting 'flipped' during the build process. Using that as a keyword I found a way to un-flip them using NifSkope, but unfortunately that by itself wasn't enough of a solution. The issue is the 'model space' normal maps that the skin mesh uses. As far as I can figure, NifSkope doesn't treat them the same as regular normal maps. That program has a 'flip normals' command under the mesh tools, but it doesn't display on the model space meshes. It does have a 'face normals' command that appeared to fix the issue in-program, but oddly had no noticeable effect in-game, so that was a bust. Digging further into the mesh settings showed that the model space meshes actually have their 'has normals' flag set to 'no', which is apparently why the flip command wasn't present. Switching that flag on restored the flip command, but also activated another familiar problem with trying to change the normal maps on the skin meshes: it seems to make the mesh act as if it did have a regular normal map, but trying to use a regular normal map on a mesh that's been built to use model space maps simply results in weirdness. The mesh takes on a translucent appearance while the lighting goes all flat and drastically changes the brightness of the mesh as it moves around. It's bizarre and completely broken, and I could not remember how the hell to fix it. 

 

I've fixed it before, when I did the bodysuits for the -BAF- set. I even mentioned that there was a trick to it in one of the blog entries I made while developing that set. But I didn't bother to mention what that trick was, and was damned if I could recall the process. I'd been trying to since early in the Doll development when I was exploring the idea of a full-brass variant and ran face-first into the issue, but I'd pretty much given up on it as a tertiary priority until I saw that same issue crop up at that point in trying to get the ground models to work. I still hadn't remembered what the trick was, though, and was about ready to shelve the whole thing and just go with the inverted ground models, but instead I just set it aside for the day and gave the whole thing a think.

 

The core of the problem was that there's something in the settings for the skin meshes that indelibly ties them to the model space maps. Simply turning off the 'model space normals' shader flag does nothing to undo those ties. What exactly would, I don't know enough about the molecular structure of the models to affect. I had been thinking in terms of 'fixing' the existing meshes, but the problem was clearly far too baked into how the mesh was built for me to be able to do anything with them. So what I needed was a mesh that didn't have all that crap baked-in. And hey, wasn't that old .nif>.obj>.nif conversion trick actually really useful for getting a clean copy of a mesh without any weird game-breaking stuff hooked onto it?

 

1692379631_ScreenShot09-25-19at08_23AM.jpg.856ab97ee625c46d2029ea08ebf2536d.jpg

 

Yes. Yes, it was. I still don't remember clearly if this is the method I used for the bodysuits, but I feel it has to be because it works so cleanly. You end up with a perfectly functional copy of the mesh that lights properly and that will take regular normal maps without complaint. Of course, the next problem was getting a regular normal map to use for a skin texture. Trying to use a model space map on a mesh built to use regular maps has pretty much the same problem as trying to do it the other way around, just in reverse, with the lighting going all weird and glow-y. I first ran into that issue during some experiments a couple years back, which caused me to abandon them as I had no idea how to make a non-model space skin normal map at the time. But since then I'd figured out how to generate workable normals from the main textures in the course of the Bikini Revival project, so that wasn't really a problem anymore. Open the skin textures up in GIMP, run the filter, play around with the settings and re-run the filter until you end up with some combination that doesn't make the skin look like it's made of glossy plastic, and boom:

 

1425162138_ScreenShot09-25-19at08_22AM.jpg.7d446a7c7515ffa946702236d42b64d0.jpg

 

One perfectly workable non-model space skin normal map. Loses some of the depth of detail from the original, but it's functional. From here, fixing the ground models was fairly straightforward. A bit involved due to the need to run the .obj conversion on all of the skin meshes, but once the working mesh is generated it's only a matter of adding on a couple of textures and changing a few settings to get a properly-lit version that can quickly be subbed back into the full model. They do tend to fall victim to that initial lighting inversion if you do the process before building the ground model in OS, but unlike the original skin meshes they respond just as well to the 'edit alpha' fix as the Dwarven meshes. The skin tones still seem to be a lost cause, sadly, but as of now I have everything I need to build ground models for all of the Doll parts.

 

1514994474_ScreenShot09-21-19at10_15AM.jpg.32e9b2201084314e5fd2ce627574637d.jpg1683143640_ScreenShot09-21-19at10.15AM001.jpg.c72424594a3bc21070f8362795d2a8de.jpg

1262064898_ScreenShot09-21-19at09_06AM.jpg.165a16e49eec7a3871bbe6033578b678.jpg2100324203_ScreenShot09-21-19at10_23AM.jpg.0d19aa44fb7177611ed8463025fd3fd4.jpg397245662_ScreenShot09-21-19at10.22AM001.jpg.471e7094d978b76cb34e4eca48a62672.jpg

 

Although as to those skin tones, it's worth noting again that the problem there seems to be that the game's engine refuses to process the 'skin tone' shader flags and data on ground-type models. It instead shows whatever the base skin texture applied to the model is. That means that it's technically feasible to cheat around it for the racial masks by making copies of the base texture with the colors properly altered, but getting those to match up correctly to the in-game results is waaaaaaaaay beyond the level of effort I'm willing to or capable of putting into this. This particular quirk won't stop the Corrupted masks from being distinguishable, though, since they're already using alternate skin textures. 

 

428252613_ScreenShot09-21-19at01.34PM001.jpg.9491081f5d56621bedcfe628295e1060.jpg

 

And on the subject of alternate textures, I've been leaving a pretty big one hanging. I mentioned above how I had earlier ran into the model space issue when I was playing around with the idea of a brass-skinned variant for the Doll. Well, obviously if I found a way to fix the problem on the ground models then I can do the same thing to make brass skins, right?

 

1263414351_ScreenShot09-21-19at08.57AM002.jpg.15c2a07aac7465bed61474c4a0dd6aa1.jpg

 

Right. Once the .obj conversion is done it's a pretty trivial matter to load the environment map settings and textures to generate a brass variant. And the .obj conversion itself goes by pretty quickly, with the most annoying part being the transfer of the weight painting onto the new mesh. So while it was easy as pie to do it to the test ground meshes I had already built, it was just about as easy to run the process on the body-use Charmer masks. 

 

2089954330_ScreenShot09-25-19at08.23AM002.jpg.34c26eda2efc841fa6b9c5c1541e811e.jpg1772984280_ScreenShot09-25-19at08.23AM003.jpg.aa58d64120e807d4ff99fd0eeae04133.jpg

 

That gave me the brass mask variants to match the SeXtreme set, suitable for use with the more fully-robotic body builds:

 

385927654_ScreenShot09-21-19at01.51PM003.jpg.3a55896c18e02a927ef0172bfff7fdd8.jpg791383569_ScreenShot09-21-19at01.46PM003.jpg.1a551d193a6a2942c7dbf7047beef065.jpg

 

But why would I ever stop with that? Of course I whipped out a full set of matching Doll body parts.

 

501634590_ScreenShot09-25-19at08.24AM002.jpg.0636bda8846f09c7fd38fd6aefd55e11.jpg1700620459_ScreenShot09-25-19at08.24AM001.jpg.3a59353c60b161f5b819012eaec35584.jpg1113196543_ScreenShot09-25-19at08.23AM001.jpg.3f1b813983231b1835a9b5b6c57fd66d.jpg2048978265_ScreenShot09-25-19at08_24AM.jpg.0edc9ae45934499ba651d46b71e5ecdd.jpg

1761849330_ScreenShot09-25-19at08.23AM004.jpg.d4e46e43bd8c5c4655ac7001ed272548.jpg

 

And when you put them all together, well now.

 

1781663889_ScreenShot09-22-19at08.28AM001.jpg.349c00e0b249c915783c263af2845dc7.jpg

176042083_ScreenShot09-22-19at08_23AM.jpg.6ebac95f225ce43801b4ba54b9a5122a.jpg1512881788_ScreenShot09-22-19at08.28AM007.jpg.524fa2dff6af7ae6af5a6f14773f78d7.jpg

384130264_ScreenShot09-22-19at08.49AM001.jpg.465cb8c55b9c6bedde90513de272afef.jpg1456174068_ScreenShot09-22-19at08.48AM009.jpg.a1675172d526fb571a2c693c022cc247.jpg

33058176_ScreenShot09-22-19at09_07AM.jpg.c4951c4f1bef0f79792916e57e074627.jpg

 

The brass tile texture gets a bit more noticeably stretched on some parts than I might like, but it matches well with the hair and faces and is just generally amusing to look at. So I'm pretty happy to have this in here. But there's the question of how much of it should be in here. The faces and the variants for the arms and feet were quick to do and don't add much bloat to the item count, but the main body parts are a bit more of a problem. Part of the issue there is that making these requires adding new copies of the skin meshes to the existing models. For fixed stuff like the faces and arms that's just a matter of a straight swap, but on the parts that are more reliant on Bodyslide/bodymorphs to build it's necessary to add the duplicate skins to the Shape Data model. The problem is that adding new parts to the Shape Data model after you've already added zaps and built variant outputs for Bodyslide is Kind Of A Pain. It was much easier to just give these their own independent Data model and project files with the original and stone skin meshes deleted, which let me quickly add in a Variable set for the torso and pelvis.

 

1118770775_ScreenShot09-22-19at09.18AM001.jpg.d991a87a173d3eef898d642387e7e7ce.jpg

1031512464_ScreenShot09-22-19at09.18AM003.jpg.bd09281ad58ba504acfd5e2444bfa564.jpg1624352052_ScreenShot09-22-19at09.18AM002.jpg.562761a9eea5f9b3a568300e426bf082.jpg

487793598_ScreenShot09-22-19at09.19AM003.jpg.f8a60c4aa1125084a6c181f2736014c3.jpg

(How can a metal body get pregnant? Magi- wait, I did this joke already)

 

I'm largely inclined to just leave this as a Variable set variant in interest of controlling the parts count bloat, but the way that the ground models are going to be built actually impacts upon the consideration of adding fixed-weight versions of this. You see, this all would have been much, much easier if I had realized that I needed those converted skin meshes for the ground models right from the start. If I had I could've included them in the combined base models I used to generate the meshes for Doll and Statue versions of the fixed-weight variants and have a ground-use copy of the variant right at hand. Instead I'm basically going to have to recreate the process I used to create the fixed-weight variants using a new base model with a set of converted skins. For the other parts it was easy enough to build the initial converted mesh and then save off copies with the texture setting changed for the respective skin types one by one, but the sheer number of fixed-weight variants makes doing that for the main body parts far more of a chore. Piling on a full set of converted skins makes it much easier to generate the ground models for all of the skin variants all at once, where I can then pull off the meshes I don't need for each type... but it also means that in the process I could pretty easily generate fixed-weight variants for the metal body as well, since I've already got its skin tossed onto the pile for the Variable version's ground models. 

 

I'm a bit inclined to split the difference and just do metal versions for a handful of the body variants. Probably at least the robot leg-equipped pelvises and some of the UNPF-styled chests, since they're not entirely doable with the standard Bodyslide settings on the Variable body. Gonna have to have a bit more of a think about the logistics there.

 

Either way, it's nice to have this in here at last. Some early considerations about doing a 'brass doll' set based on the more easily-retextured SeXtreme models were what got me started down this particular route, so I'm happy to finally have something along those lines running around the game in a workable state. 

 

1023140000_ScreenShot09-22-19at09_03AM.jpg.fef8d4a237b6322008681d6b9530501f.jpg1759316017_ScreenShot09-22-19at09.03AM004.jpg.1f370b2c6199476acc56e969052031fe.jpg

656415218_ScreenShot09-22-19at08.56AM003.jpg.f2101b54c8621f52061d00665347dafd.jpg

(Other people might not be)

 

5 Comments


Recommended Comments

Holzfrau

Posted

Cool, now I can finally make my Spaceballs tribute character in Skyrim! ?

Z8tu84N.jpg.94729868e410faedd6599dd57287af1c.jpg

goaway

Posted

Just a quick question, but what program did you use to bake the normal maps?  You mentioned GIMP, but I didn't see whether you actually used a GIMP plugin to generate them or not.  

 

Did you bake it using OpenGL or Direct3d lighting directions?  I know a GIMP plugin that has an option for inverting normal maps, but it matters what the base convention it is using is.

 

Tangent space normals have a different "up" direction depending which convention you use to bake it.  OpenGL (which I think GIMP uses by default) is Y+ for up, whereas Direct3D (which skyrim uses) has Y- for up.  If you bake it using the opposite convention and something is sitting on the ground with light coming from above, it would produce an effect that sounds like what you are describing where it looks like light is coming from behind it.  You wouldn't know until you actually loaded the game, either.

 

Maybe it's not something so simple, and you clearly aren't an amateur at working with texturing, but just in case this was the issue, it might simplify your process a lot. 

 

 

I've tried a lot of different methods of baking normals but nothing seems to work as well as good ole' Xnormal. https://xnormal.net

It even has an option for converting object space normals (like a modelspace normal) to tangent space maps and vice versa.  

 

 

Also, you might not want to use the "Face Normals" setting in NifSkope if you want to maintain smooth surfaces.  The smoothing normally comes from vertex based normals and face normals are a lot more blocky.  https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/shading-normals

 

If you change this in Nifskope and save the nif, there is no way to set it back to vertex normals within nifskope, so you have to generate the mesh again or edit it as an .obj.

 

X299_Mainboart

Posted

My english is weakly, But I can say:That is Great!

AVS

Posted

20 hours ago, Holzfrau said:

Cool, now I can finally make my Spaceballs tribute character in Skyrim! ?

 

 

Heh. I actually wanted to make a Dot Matrix joke in the post, but couldn't quite find the right place for it. Thanks for covering that for me! ?

 

10 hours ago, goaway said:

Maybe it's not something so simple, and you clearly aren't an amateur at working with texturing, but just in case this was the issue, it might simplify your process a lot. 

 

 

Please, don't misunderstand! I am absolutely an amateur when it comes to texturing! Pretty much all I know about it comes from banging things together until something kinda works. There's a whole lot of the mechanics behind it that's beyond me. 

 

The new normal maps for the skin meshes were simply made by running the diffuse textures through GIMP's regular normal mapping plug-in. The results are serviceable, but they're undeniably a lot flatter than the original skin normals. The fact that the skin textures lack a native alpha layer doesn't help that, as I had to add in a blank one to use some of the plug-in's options to get results that weren't absurdly glossy. I had actually looked at xnormal and AwesomeBump as alternatives after coming across mentions of them while I was looking into the problem with the flipped normals, but couldn't immediately get a grasp on their operation and went back to GIMP in interest of getting a quick result. If xnormal has a way to quickly convert the model space map and produce a high quality regular skin normal, though, I'll certainly take another look at it. 

 

That initial inversion of the normal maps seems to be purely from some weird bug in Outfit Studio, and as it does a lot of its texture-related stuff in a way that's basically invisible to the user I have no idea what's causing it, nor why it's easily fixable on meshes using regular normal maps but completely un-fixable on the model space meshes. But since I needed a non-model space version to get the brass skin working anyway, this all kinda worked out. 

 

goaway

Posted

The main Xnormal baking functions are a little complicated, but the simplest and most useful part of the program is the little addons under tools that let you build tangent space maps from height maps, photos, or inter-convert object to tangent space maps. 

 

If I just want to build a quick normal map to work on a diffuse map in game or in blender, it only takes me a couple minutes to generate something reasonable looking by converting a diffuse to greyscale in photoshop and adjusting the levels evenly, then building a 3x3 or 4sample tangent from the height map generator.  Obviously when I want to fine tune the finished product I can spend a lot more time perfecting it, but every other program I've found either produces garbage results, or takes significantly longer to set it up correctly.

×
×
  • Create New...