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

LDrawLoader: Start removing stored derivative data during initial parse #23139

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

gkjohnson
Copy link
Collaborator

Related issue: --

Description

This PR starts to remove storage of some derivative data of LDraw files during the parsing process in an effort to work towards making the parsed representation more cache-able. Specifically this PR focuses on removing "faceNormals" produced during the initial file parsing and moves the generation to when they're needed since the face normals will change depending on the final transformation of the faces for use in a part.

In another PR I'd also like to move "main" material interpretation from the parent scope out of object parse as well as any matrix operations. Once that's done it should be easier to cache an initial parsed representation of a file and clone it rather than reparse it as needed and eventually reuse any normal smoothing operations per part, as well. Once all that's done it should provide a big improvement in parse time.

@yomboprime how does removing the separateParts code path and always behaving as though it were "true" sound? It should make this process easier and can be added back later if needed. Also since we now group primitives by part rather than creating a new mesh for every LDraw file the draw call issue that that field was originally meant to alleviate isn't quite as much of an issue. Pieces can also be merged into a single geometry afterward if needed.

@gkjohnson gkjohnson requested a review from yomboprime January 4, 2022 06:27
@yomboprime
Copy link
Collaborator

removing the separateParts code path

Sounds good. It seems all pros and no cons.

@mrdoob mrdoob added this to the r137 milestone Jan 4, 2022
@mrdoob mrdoob merged commit 5655fbe into mrdoob:dev Jan 4, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jan 4, 2022

Thanks!

@gkjohnson gkjohnson deleted the ldraw-cleanup branch January 4, 2022 16:50
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.

3 participants