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

tr_model_iqm: rewrite NaN in model IQM input #1469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Dec 20, 2024

Rewrite NaN in model IQM input.

The prifle_view.iqm model has some NaN in the input data:

When such model file is used, it is impossible to get anything useful when trapping for invalid operations because the first call of R_TBNtoQtangents() when loading the model will stop the execution.

There are other floats in the IQM file, we may want to not hack BuildTangents() and sanitize all the floats in the future with a generic function, but this works for now.

Here is the IQE text equivalent of the IQM format, there are many float fields like that:

pq 0 0 0 0.707107008 0.000172803004 0.707107008 -0

vp -7.02030039 -5.93917179 -10.5407791
vn -0.373933047 -0.803014815 -0.464048833
vx 0.618980289 0.156532541 -0.769649923 -1
vt 0.857393026 0.983985007
vb 9 1

Here is an example of broken input, the current code currently only cares about vx.

vp -4.99237871 -17.1318531 -6.18218517
vn -0.0307731722 8.04468016e-07 -0.999526381
vx nan nan nan 1
vt 0.548720002 0.101943001
vb 1 1

@VReaperV
Copy link
Contributor

I assume this doesn't have much of an effect on loading times?

There are other floats in the IQM file, we may want to not hack BuildTangents() and sanitize all the floats in the future ith a generic function, but this work for now.

This should be added as a comment.

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