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

[Fix] Fix to texture based morph targets to occasionally morph incorrect vertex #3547

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

mvaligursky
Copy link
Contributor

  • fix involves adding a small fraction to the number to garantee it does not get converted to number one smaller. Typical workaround for these situations.

@mvaligursky mvaligursky self-assigned this Oct 6, 2021
@mvaligursky mvaligursky added area: graphics Graphics related issue bug labels Oct 6, 2021
@@ -9,6 +9,9 @@ import { getApplication } from '../framework/globals.js';

import { BUFFER_STATIC, TYPE_FLOAT32, SEMANTIC_ATTR15, ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGB32F } from '../graphics/constants.js';

// value added to floats which are used as ints on the shader side to avoid values being rounded to one less occasionally
const _floatRounding = 0.2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, but why 0.2 specifically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example for number 10, it's 10.2, which is roughly in the middle between 10 and 10.5, so any rounding / precision loss should bring it to 10.

@mvaligursky mvaligursky merged commit 863356e into master Oct 6, 2021
@mvaligursky mvaligursky deleted the mvaligursky-morph-precision-fix branch October 6, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants