Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blender] Fix normal flipping between Blender and Warzone2100 #3665

Closed

Conversation

CupnPlateGames
Copy link
Contributor

Current behaviour: normals are inverted between Blender and the game. You have to export your meshes with all normals inside-out in Blender to look well in game, they are imported inside-out too.

How to reproduce:

  • Import a pie object in blender (4.0, but it seems to be bugged with 2.9 too)
  • Create a material for the mesh and activate backface culling
  • In Shading mode, add an image texture to link to Base Color to the Principled BSDF to check the UV mapping
  • Set the Viewport Shading to Material Preview: the normals are inverted in blender
  • Export the object to pie: it works in game

This patch changes the order in which the vertices are imported and exported for each polygon so the normals are pointing toward the same direction in Blender and in-game.

@MaNGusT-
Copy link
Contributor

MaNGusT- commented Feb 29, 2024

provide a pie file exported with this patch for test purposes pls

@CupnPlateGames
Copy link
Contributor Author

drlbod01.zip
Here are a few.

  • source is the one from the game data
  • reexported is the one imported and exported without changes in Blender
  • reexported_pie3 is the one imported, switched to pie3 in Blender and exported

File-wise, the patch does (should do) nothing.

@MaNGusT-
Copy link
Contributor

MaNGusT- commented Feb 29, 2024

ah, this patch is not about importing normals from pie file properly, it's about wrong vertex winding order. Models you have provided does not include normals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants