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

Improve generation of normals for vanilla models #4313

Merged
merged 3 commits into from Sep 6, 2017

Conversation

bs2609
Copy link
Contributor

@bs2609 bs2609 commented Aug 17, 2017

Should fix #4178.

Because of how the conversion was handled here, any float values even slightly less than 1 would have produced an output value of 126 instead of 127. This is why the rotated models were the ones affected, due to being subject to potentially lossy floating point operations.

Rounding the values to the closest whole number instead of simply truncating them should solve the issue.

@bs2609
Copy link
Contributor Author

bs2609 commented Aug 17, 2017

Before/after screenshots, using a superflat dirt world and the resource pack from #4178 (comment):

  • Before:
    2017-08-17_14 48 50

  • After:
    2017-08-17_14 50 08

@bs2609 bs2609 changed the title Apply rounding when generating normals for vanilla models Improve generation of normals for vanilla models Aug 17, 2017
@bs2609
Copy link
Contributor Author

bs2609 commented Aug 17, 2017

On a another note, the main cause of lossy floating point operations here is that the values aren't being unpacked to floats correctly. Updated the PR to fix this as well.

@mezz mezz added 1.12 Bug This request reports or fixes a new or existing bug. Rendering This request deals with rendering. These must be treated with care, and tend to progress slowly. labels Aug 18, 2017
@LexManos LexManos merged commit 0dd386b into MinecraftForge:1.12.x Sep 6, 2017
@bs2609 bs2609 deleted the normal-generation-fix branch September 7, 2017 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.12 Bug This request reports or fixes a new or existing bug. Rendering This request deals with rendering. These must be treated with care, and tend to progress slowly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants