Open Ebola16 opened 6 years ago
This isn't a fault of Brawlbox; for some reason texture matrices are just not compatible at all with non-float UVs. Like, the game's code literally can't handle it. Unfortunately I don't think Brawlbox has any kind of warning about this, it really should.
This is mainly why the option to force float on import was added as a feature, and why original Brawl models tend to just always use float. Brawlbox displaying them properly when this edge case happens is technically incorrect.
Also, you can't add more shaders than there are materials, so be sure to check that. For example, if you have 3 materials, you can only have up to 3 shaders. There's no real reason to have more shaders than materials, the unused ones wouldn't be saved anyway as they have to be linked to one or more materials.
If your model has too many nodes, you might want to optimize the skinning weights for each vertex. For example, if you can use exactly a weight of 0.5 to one bone and 0.5 to another bone for a lot of vertices, those weights can all be merged into one "node". Using the weight blend button tends to be the culprit of creating an ungodly number of nodes because it uses very specific bone weight values like 0.27563, which is probably not going to be remappable with any other influences like the example above.
Thank you for the detailed explanation. I'm fine with Wont Fix for Brawlbox's incorrect display of non-float UV's as long as warnings are added somewhere in Brawlbox, or the removal of non-float options if they don't have any practical use. Perhaps warnings should be added to descriptions of ForceFloat*
options in "Import Settings" and the "(Re)generate Metal Materials" popup message? I can try adding the warnings myself if requested.
Background: The model attached below has too many nodes and can crash at the result screen when being used. I reduced the nodes by altering the WeightPrecision but this caused the model's face to look bad. Setting "ForceFloatUVs" to False prevented the face from becoming deformed with the lower node count. After replacing the materials and shaders with the ones from the original model, the materials became corrupt.
Steps to reproduce:
Also, right-clicking the MDL0 reveals that "Add New Shader" is grayed-out. I've never seen that before but it seems like a problem.
This is possibly related to #95 but this scenario is independent of metal material generation.
Correct model except for the deformed face due to decreased nodes: http://forums.kc-mm.com/Gallery/BrawlView.php?Number=211417 Texture corruptions after following steps to reproduce:![captureg](https://user-images.githubusercontent.com/17330088/32601918-3d8a07ac-c512-11e7-92b7-cdbfd7e1c42f.PNG)
Perhaps warnings should be added to:
ForceFloat*
options in "Import Settings"