BadDogSkyrim / PyNifly

Export/Import tools between Blender and the Nif format, using Bodyslide/Outfit Studio's Nifly layer. Supports Skyrim LE, Skyrim SE, Fallout 4, Fallout New Vegas, Fallout 76, and Fallout 3.
GNU General Public License v3.0
167 stars 15 forks source link

BSEffectShaderProperty Node - Lighting Influence #190

Closed michaelsmolinski closed 9 months ago

michaelsmolinski commented 9 months ago

Round trip import/export changes BSEffectShaderPropery node's Lighting Influence value from 255 to 0.

Also adds Vertex_Alpha Shader Flag to exported file.

I don't know how/if either of these two items has real in-game impact.

Untitled

blackbriarchalet.zip

BadDogSkyrim commented 9 months ago

I'll check it out.

VERTEX_ALPHA (and VERTEX_COLOR) are weird because they are set on export depending on whether the exported mesh has vertex color and alpha defined, not based on what's in the shader. (Except indirectly, since it reads those values.) So it's possible to have them set on export when they weren't on import. But if you didn't change anything, they should be consistent.

BadDogSkyrim commented 9 months ago

Okay, so. I have a note here saying "If we have a BSEffectShaderProperty we assume the alpha channel is used whether or not VERTEX_ALPHA is set. Some FO4 meshes seem to work this way" and in fact the FO4 FemaleEyesAO.nif does seem to work that way. So does setting the VERTEX_ALPHA bit cause the exported nif to fail at all? I'm creating vertex alpha on import and then finding it on export, which is why we get this result.

It's possible that FO4 works this way and Skyrim should not.

Edit: It's also possible that if a FO4 shader specified VERTEX_COLORS, VERTEX_ALPHA is assumed.

It seems this TriShape is exported as a BSTriShape, not a BSLODTriShape, which seems like a worse bug.

And the LightingInfluence problem needs fixing too.

michaelsmolinski commented 9 months ago

Got it. Export doesn't fail and no missing BSTriShape nodes. Some errors do show in the blender console. See bottom of this comment.

Regarding BSLODTriShape - Were you referring to a different nif you were looking at? That node type isn't in blackbriar nif that I had attached.

I also noticed the cubemap texture file reference is missing for those windows too (separate node). See images below. Let me know if you want me to post as a separate tracker item.

screenshot cubemap import

screenshot cubemap export

==================== FYI - these errors show when exporting

_INFO:pynifly:Exporting L2WindowGlow WARNING:pynifly:Could not determine shader attributes WARNING:pynifly:Shader nodes are not set up for export to nif. Check and fix in generated nif file.

INFO:pynifly:Exporting BlackBriarChalet:7 WARNING:pynifly:Error setting property parallaxInnerLayerTextureScale <- [0.949999988079071, 0.949999988079071]

I can confirm the 0.95 is in the original nif but not in the exported nif. Let me know if you want me to post as a separate tracker item.

BadDogSkyrim commented 9 months ago

It's the LE version of that nif that has the BSLODTriShape nodes. They apparently aren't used in SE.

I might constrain that VERTEX_ALPHA check to FO4 only, just to be conservative.

The shader errors on export are fixed. They don't break anything.

Not sure whatup with the parallaxInnerLayerTextureScale. I didn't see the error in my testing but I'll check.

BadDogSkyrim commented 9 months ago

Fixed in latest.