Jump to content

nif mesh lighting/rendering


satojo

Recommended Posts

Hello.
I use Blender (2.79) and Outfit Studio (4.3.1), and I am making several weapon attachments. Convert nif file to obj file with Outfit Studio, edit with Blender, then convert again to nif file with Outfit Studio .

However, the lighting of the mesh I made is strange. This is a screenshot of the vanilla SMG receiver and the receiver I edited.

https://i.gyazo.com/fd9409523f67750d64a718a44fec4a6f.jpg

https://i.gyazo.com/0aa473e3cb327f5d66588486685ec182.jpg

I want to solve this. I need help!

Link to comment
Share on other sites

You've changed the shading on the receiver so it no longer matches the vanilla normal map.
6F1EVt3.png?1
The vanilla SMG receiver is full of averaged normals. You probably made edits to the shading. When doing that, the applied normal map no longer displays the same normals.
To fix this, make sure that the edited parts have the exact same hard / sharp edges as the vanilla.
You can probably try to use the Data Transfer and transfer normals from nearest topology between an unedited mesh and yours. But there's usually some manual work involved. Or just make sure everything is manifold and remove Auto Smooth / Sharp Edges and apply smooth shading to the entire mesh.
Edit: I've looked a little closer. The vanilla receiver uses three arbitrarily placed smoothing groups that doesn't do anything. The entire mesh has its normals completely averaged. However, it still imports the smoothing groups as sharp edges, and when you export from Blender, it probably split the edges along the boundaries.
Try this in Blender:
Remove custom split normals
Turn off auto smooth
Select mesh and remove all double vertices
Ctrl+E and remove all sharp edges

Re-export

Link to comment
Share on other sites

Thank you for your comment.

Unfortunately, that method failed to repair the mesh.

This problem seems to be occurring by the Outfit Studio. The same problem is occurring when saving as nif from Outfit Studio. Also, Outfit Studio does not seem to be able to import smoothing by Blender. I am facing great technological difficulties.

 

edit:

Oh, sorry. I made a big mistake. The new version of Outfit Studio seems to be able to handle smoothing. I am going to try your method again. thx.

Edited by satojo
Link to comment
Share on other sites

I was able to successfully import the SMG to Blender and back to nif using Outfit Studio without any issues.

 

There is still some shading issues in your last image, you can see how the magazine release is dark in the middle.

 

Would you like me to take a look at your nif? I could try and give you the exact steps to fix it.

Link to comment
Share on other sites

I downloaded the meshes from your mod and I found the issue. It was just as expected. Blender exported with sharp/hard edges, although there aren't any on the vanilla nif.
It's possible to fix, but it will not be 100% accurate because 1: you changed the geometry (by flipping the ejection port), so the averaged weight of normals will never be identical, and 2: in nifs are 'bitangents' stored on the mesh which are calculated during export from 3ds max. This cannot be exported to OBJ, so it uses face normals instead.
So there's two ways to fix. The quickest and easiest is to clear custom normals and weld vertices.
1. In Blender, import your OBJ and select Y as Forward. Or, if you have a blend file, you can use that.
2. Repeat this for every mesh:
Edit mode > Select everything
'W' key > Remove Doubles
Ctrl+E > Clear Sharp
3. Go to Vertex data tab
Under 'Geometry Data' click 'Clear Custom Split Normals Data'
Under 'Normals' uncheck 'Auto Smooth' (gif)
3. Export as OBJ with Y as forward.
4. Open in Outfit Studio.
Double-click each mesh and and insert material path.
Also in 'Geometry' tab, uncheck 'Skinned' and 'Sub Index' (gif)
5. Export as nif. The mesh should now be in the correct BSTriShape format, and you just have to copy and paste the meshes over to your original nif.
But because you changed the geometry, the averaged normals is not the same as original. See difference in this image. There will be dark spots near the changed geometry.
To fix this you need to use Data Transfer and transfer custom normals from the original mesh to yours.
1. Do step 1 to 3 from above
1.1 Enable 'Auto Smooth' and set the smoothing angle to 180
2. Import original mesh and place your mesh on top of it so they overlap
3. With your custom mesh selected, go to Modifiers tab and add 'Data Transfer'
3.1 Enable 'Face Corner Data'
3.2 Click 'Custom Normals'
3.3 Change dropdown to 'Projected Face Interpolated'
3.4 Add the original mesh as source
4. Cycle between your mesh and the original and verify that they are identical. If not, switch between 'Projected Face Interpolated' and 'Nearest Face Interpolated'.
5. Repeat this process for all mesh parts, but remember to flip the ejection port on one of the meshes, because Data Transfer requires similar topology. Then export to OS using the steps above. (gif)
Here's how it looks with custom normals using Data Transfer (no more black spots)

 

 

Edit: Here's .blend file with the custom normals applied.

Link to comment
Share on other sites

I appreciate a lot of advice!

 

These are procedures I have not known until now. As I read your comment, I am manipulating the buttons I have never seen before on Blender's panel. And ... ... finally, it is complete! Thank you, ehtyeci. Thank you very much!

 

I also thank drmwayne! I did not know the function. I will use your method for another simple part that is not as big as the receiver.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...