libertyernie / brawltools

BrawlBox and BrawlLib
http://forums.kc-mm.com/index.php?topic=67847.0
142 stars 31 forks source link

Update information for non-float model assets #162

Open Ebola16 opened 6 years ago

Ebola16 commented 6 years ago

@BlackJax96

Addresses #161. Informs users how to avoid #95.

Update descriptions to prevent users from unexpectedly encountering the above issues.

BlackJaxDev commented 6 years ago

I think your explanations need just a bit more fine-tuning.

Vertices/Normals only need to be float when the object they're assigned to is rigged to multiple bones (no single bind) or animated by an SHP0 animation. Basically, only when vertices and normals will need to be animated independently of each other. Texture matrices aren't a factor at all and tristripped primitives shouldn't be, but it would have to be tested to be totally sure.

UV sets only need to be float when at least one of the objects they're assigned to uses at least one texture matrix. This is the only factor, normals are completely unrelated.

Metal materials turn on texture matrices for objects that are rigged to multiple bones, which is why the texture gets messed up when the UV set isn't float, in that particular instance. The fact that your normals aren't float shouldn't have anything to do with it. The normals look correct in your screenshot though so I'll assume that they were evaluated but written as float anyway.

An optimal scenario would be to show a popup if the user (or code, in the case of metal materials) turns on a texture matrix for an object but one of the attached uv sets doesn't use float values. The popup could ask if you want to force float UVs or not.

Ebola16 commented 6 years ago

Sorry for the late reply.

I was able to reproduce #95 by exporting the DAE from Metal Corrupt.zip, re-importing it with ForceFloatNoramls = False, and (Re)generating metal materials. It appears that ForceFloatNoramls = False does matter when generating metal materials.

Also, I tested how tristripped primitives work with ForceFloatVertices = False and I didn't notice any problems. Let me know if I'm misunderstanding something.

This PR is just for tweaking the descriptions of assets. I agree with your proposal in the final paragraph but I currently lack the programing knowledge to accomplish that on my own.