Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Save generated tangents on export#80

Open
wheeland wants to merge 8 commits intodevfrom
save_tangents_ape
Open

Save generated tangents on export#80
wheeland wants to merge 8 commits intodevfrom
save_tangents_ape

Conversation

@wheeland
Copy link

Task-Id: KUE-617

@wheeland wheeland force-pushed the save_tangents_ape branch from 0686b7e to c6017e4 Compare March 15, 2019 11:27
@mkrus mkrus requested a review from jcelerier March 15, 2019 14:11
viewMatrix.row(2)[3]);
}

int addToJsonArray(QJsonObject &object, const QString &name, const QJsonObject &toInsert)
Copy link
Contributor

Choose a reason for hiding this comment

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

there are already some "JSON-util" like functions here : https://github.com/KDAB/kuesa/blob/dev/src/core/gltf2exporter/gltf2utils_p.cpp

maybe they should all be put in some kind of generic json_utils.hpp ?

Copy link
Author

Choose a reason for hiding this comment

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

put it into gltf2utils_p.cpp for now

return m_context;
}

void GLTF2Parser::generateMissingTangents(const QString &basePath, QJsonObject &rootObject)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that this should be refactored to go in the exporter part - maybe by storing a flag in one of the GLTF2Context struct which indicates which mesh had its tangents computed and then by adding a pass here before the draco compression (which might compress the tangent attribute) : https://github.com/KDAB/kuesa/blob/dev/src/core/gltf2exporter/gltf2exporter_p.cpp#L199 ?

@wheeland wheeland force-pushed the save_tangents_ape branch 3 times, most recently from dbb2b6c to 13c8807 Compare March 18, 2019 16:45
@wheeland
Copy link
Author

As of now, I kept this in GLTF2Importer. Doesn't feel like the best place to put it though. Moving everything to GLTF2Exporter doesn't make sense of now, as this one is only created once during export, and we want to see the tangents in action within APE, as materials might depend on them, right?

I guess one way to make it cleaner would be to move the tangent computation itself into GLTF2Context for example, retain some information on what has changed, including a new QByteArray for the newly generated buffer(s), and then in GLTF2Exporter use all that saved info to modify the JSON tree. This would require some slightly awkward duplication of information though, which is not needed as of now.

Trying to figure out what breaks the Draco export now. Does the DracoExportPass expect all data to be stored inside a single buffer file?

@mkrus
Copy link
Member

mkrus commented Mar 27, 2019

could use some unit tests

Copy link
Member

@jalbamon jalbamon left a comment

Choose a reason for hiding this comment

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

Looks OK from a documentation perspective

Copy link
Member

@mkrus mkrus left a comment

Choose a reason for hiding this comment

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

missing unit tests

@DaveeFTW DaveeFTW force-pushed the save_tangents_ape branch from 66f9aa0 to 06049e0 Compare April 29, 2019 15:16
@DaveeFTW DaveeFTW requested a review from mkrus April 29, 2019 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants