Jump to content

NifSkope 2.0 Dev


Jon

Recommended Posts

Jon, do we know what Shader Flag 2 - anisotropic lighting is/does?

 

Yeah, it adds an anisotropic highlight to the hair.  Examples   Hair is thousands of individual fibers, so when light is hitting each of them, it gets stretched in a certain direction.  Same is true for brushed metal.

 

I also noticed that females didn't have it.  I think this was intentional, to make their longer hair look "softer" or something.   But also I thought I tried giving them the anisotropic flag and it didn't do anything.   I can't really remember though.  It was a long time ago.   There also may have been differences between whether or not the character was the PC or an NPC.  Like maybe anisotropic highlights only worked on your character and not others.  But again, I can't really remember.

 

The hairline NIFs shouldn't need it.  That's just the short hair to hide under the normal hair to make it not look like a wig, yes?

 

I would suggest adding it to some female hairs,  and taking screenshots of any differences you see.  Try both NPCs and the PC. 

 

----

 

As for Assume Shadowmask, what Cat said.   If you google the term you will also find some stuff on LoversLab about it (surprisingly SFW).

Link to comment
Share on other sites

It in all likelihood won't show on NPCs unless you re-bake their heads.  Unless you tweek the shader flags on the existing baked heads...

Link to comment
Share on other sites

[snip] There also may have been differences between whether or not the character was the PC or an NPC.  Like maybe anisotropic highlights only worked on your character and not others.  But again, I can't really remember. [snip]

NPCs hairs are parts of their facegen data. So, their facegen data must be regenerated in the CK after modification in order to be properly featured ingame.

 

Edit :  :ninja: by the cat !

Link to comment
Share on other sites

Yeah, that probably didn't register with me back then, nor when I was writing the post.  But obviously that makes sense.   I even updated NifSkope to read the facegeom texture paths correctly, and added the hairtint to the shader.  Example

 

Note I don't actually support the anisotropic flag yet.   I tested it with random objects in-game and I didn't see a difference, so I think there is a hardcoded limitation that it only apply to hair meshes.  So I have to sort out how to do that in NifSkope if that's in fact the case.

Link to comment
Share on other sites

Ok, so this caught my eye (scroll halfway down the page).

 

Out of curiosity I imported a hair mesh into Blender, and the aniso is set to 0 or fully circular. This, to my untrained mind, basically makes it no different than Specular. Perhaps it's not even a used shader?

 

Also a shame it's a slider controlled option in Blender, but not in Nifskope.

 

I am gonna test this further.

 

As for the shadowmask, based on that explanation I don't see why it's used on hair at all since there's no enviro type magic going on.

Link to comment
Share on other sites

When in doubt... turn it off and see what happens. :)

 

It might have something else involved with the hair shader.

Link to comment
Share on other sites

NifSkope 2.0.dev3 (2015-11-08)
 
Summary

 

- [Fix] bhkCompressedMeshShape blocks were ignoring their Chunk Transforms (#82)
- [Fix] Only most recently opened viewport resized correctly (#88)
- [Fix] File > XML Checker works again

 

The viewport resizing issue went unnoticed for so long...  I guess not many people use more than one window at a time.  Or maybe it's that no one ever resizes.  :)

Link to comment
Share on other sites

hi all!

 

Another thought on why hair doesn't work is that Bethesda is fond of checking node names for certain effects. (ie only "Arms" show up in first person, some effects in Oblivion only worked if the TriShape was named such-and-such...) Though you'd think with the more robust shader flags in Skyrim it wouldn't be necessary. 

Link to comment
Share on other sites

Hey tk!  Good to see you around. :) :)

 

I think in Skyrim either it does check that it's a hair mesh, or the Anisotropic shader flag only works if the shader type is Hair Tint.  I guess I could attempt to make a normal non-hair object have the Hair Tint shader type, and see if it works then.  But then the engine might also prohibit Hair Tint from occurring on anything other than a hair mesh.  :X

 

The female hairs do not have the anisotropic shader by default, but the male hairs do,  so if you get a male and a female side by side next to a strong point light, it's quite easy to tell the difference.

 

Here is the male hair, you can see the bar-shaped highlight going across his hair in different directions.  Very clearly anisotropic, especially in motion.

 

YECubSF.jpg

 

I increased the contrast at the bottom to try to emphasize it.   But when I tried to edit that specific male hair to turn off the anisotropic shader, I couldn't seem to get it to work.  As if the game remembers that male hairs must have anisotropy.  :P   But I'm not absolutely sure I edited the correct hair.

 

A sure fire way to test the hair shader is to take a specific NPC's baked facegeom,  change the shader settings and then go to them in game.

 

But of course I will be busy the next several days so I won't really be able to test why that shader flag is being so stubborn.

Link to comment
Share on other sites

Ohh yeah. The shader would expect the tint value supplied by the esm/esp, I have a vague memory of this now. So yeah, it wouldn't work or default tint to black.

Link to comment
Share on other sites

Hey Jon - just to follow-up on the reddit thread - we've taken a quick look at the ba2 files and the format is just a slight modification of bsa. There are some header changes and a list of filenames at the end, but the textures and whatnot seem to be easy to deal with. So an unpacker probably wouldn't be that hard. Let us (the f4se team) know if you need anything to help move things along.

Link to comment
Share on other sites

  • 2 weeks later...

Just a teaser

 

eXdNzoO.png

 

We know enough to render most files fairly well, and enough that 99% of the files open without error.   This doesn't mean we have anything remotely decoded though (as in we know its purpose).

 

That shot is without normals because I hadn't yet implemented them, and there are other kinds of rendering issues.  It also won't have the same level of WYSIWYG support Skyrim now has, at least not for a while.   I haven't yet ported my BA2 reading code back into NifSkope so the textures have to be extracted, and currently I'm having a bit of an issue with reading the ATI2 _n/_s files that my extractor produces, because the renderer is in OpenGL and it doesn't really seem to support it.   Mostly for whatever reason I have to flip the normals on the texture if it's ATI2.  If you convert the files to DXT5 they work fine.

  • Like 2
Link to comment
Share on other sites

For something that hasn't got normals rendering yet, that looks pretty good. Impressive progress thus far.

Link to comment
Share on other sites

NifSkope 2.0.dev4 (2015-11-23)
 

Initial Fallout 4 support.

 

Known Issues
 
- Import is DISABLED. We don't know enough about the data formats to reasonably allow for this in general use cases.
- No Materials (.BGSM, .BGEM) support yet. Some NIFs rely solely on Materials and will lack textures.
- Visible position of skinned meshes is often incorrect.
- Lighting at UV seams and on UV islands is often incorrect or inverted.
- Specular will often be too bright (e.g. male and female bodies). Whether this is me using an incorrect approximation or the fact that these NIFs use Materials to modify the specularity from their default has not yet been determined.
- BSEffectShaderProperty meshes will either not render or render incorrectly.  You can see these better by disabling the shaders in Render > Disable Shading.
- Vertex colors are not yet read from the mesh and will not display.
- The vertex format on a small percentage of files is incorrectly handled due to inadequate condition checks. You will get a warning upon opening if saving this file is unsafe.
- Archive Browser is not yet updated for BA2s.  You will need to extract your meshes to view them for now.
- Settings > Resources > Archives is not yet updated for BA2s.  You will need to extract your textures to view them for now.
 
----
 
Edit:  Updated build to fix an issue when Export Info 3 is garbled text.  This was creating a false alarm when opening the NIF.
  • Like 3
Link to comment
Share on other sites

Nice work!

tho I am getting some error on start (I still can use it after clicking OK)

 

There were errors during shader compilation

 

ob_normalmap_vcol_e.prog:

 

The fragment shader uses varying D, but previous shader does not write to it.

The fragment shader uses varying A, but previous shader does not write to it.

 

ob_parallax+glowmap.prog:

 

The fragment shader uses varying HalfVector, but previous shader does not write to it.

 

ob_parallax.prog:

 

The fragment shader uses varying HalfVector, but previous shader does not write to it.

 

ob_parallax_vcol_ad.prog:

 

The fragment shader uses varying HalfVector, but previous shader does not write to it.

 

Link to comment
Share on other sites

Are you using a laptop with switchable graphics?  You need to go into your GPU control panel and set NifSkope to use the dedicated card only.

 

If not, you can remove the ob_ files.   In fact, I haven't really audited Oblivion's actual shader support yet, so they are probably useless. Those files were already there when I took over development. 

Link to comment
Share on other sites

Nice work, Jon. I'm however a bit confused : is this updated version exclusively dedicated to FO4 or can we still use it safely for Skyrim meshes, too ?

Link to comment
Share on other sites

There would ideally be no change to Skyrim meshes, but stuff happens.  We conditioned the XML to keep working with all previous games, and I did not do any kind of destructive additions to the renderer.

Link to comment
Share on other sites

NifSkope 2.0.dev4 (2015-11-24)

  • Fixed display of normals/tangents including issues at UV seams and mirrored islands.
  • Fixed display of specular. May still be too bright, but it was completely inverted before.

Namely I was having issues with ATI2/BC5 as read by OpenGL, combined with the fact that they seem to have swizzled the tangent-bitangent-normal matrix compared to Skyrim.

 

Before and After

 

----

 

Note:  I keep forgetting to mention that to use extracted textures with Fallout 4 you need to add both:

...\Fallout 4\Data
...\Fallout 4\Data\Textures

to your Paths list in Settings > Resources.  FO4 now uses a mish-mash of texture paths that contain or lack "textures\".

Edited by Jon
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...