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

[Impeller Scene] Convert vertex positions to match Impeller's clip space orientation #38174

Merged
merged 2 commits into from Dec 10, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Dec 10, 2022

GLTF geometry follows a right-handed coordinate system where +z is model "front" and +y is model "top". Impeller has a left-handed clip space. Inverting Z is the simplest and most predictable conversion with respect to a default camera orientation such that model "right" is towards the right side of the viewport (+x in Impeller clip space) and model "top" is towards the top of the viewport (+y in Impeller clip space).

Also refactors the VerticesBuilder to support more specific behaviors (we'll need more AttributeWriter procs soon, like for tangents).

Before:
Screen Shot 2022-12-09 at 6 10 39 PM

After:
Screen Shot 2022-12-09 at 6 09 37 PM

@bdero bdero self-assigned this Dec 10, 2022
std::function<void(Scalar* destination,
const void* source,
const ComponentProperties& component_props,
const AttributeProperties& attribute_props)>;
struct AttributeProperties {
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed this, but, can we zero these out by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. I forget to do this a lot, I wonder if there's a clang-format lint that can help.

@bdero bdero merged commit 6b1c0c2 into flutter:main Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 11, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 11, 2022
…116843)

* 6b1c0c23f [Impeller Scene] Convert vertex positions to match Impeller's clip space orientation (flutter/engine#38174)

* 41ec2804a Roll Fuchsia Linux SDK from rRJIjuO-dPNCpCTd9... to 8O5rMR_ehMaL3YhZ5... (flutter/engine#38177)

* 3dfd13f1d Roll Skia from 1b194c67700e to 491f5c134f76 (2 revisions) (flutter/engine#38182)

* 690f0e81c Fix sampler offsets (flutter/engine#38170)

* f24f2cc0a Roll Skia from 491f5c134f76 to 0d482f9fa8b3 (1 revision) (flutter/engine#38183)

* fbb79e704 [Impeller Scene] Refactor Nodes/Meshes for simplicity and GLTF compatibility (flutter/engine#38180)
loic-sharma pushed a commit to loic-sharma/flutter-engine that referenced this pull request Dec 16, 2022
loic-sharma pushed a commit to loic-sharma/flutter-engine that referenced this pull request Jan 3, 2023
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116843)

* 6b1c0c23f [Impeller Scene] Convert vertex positions to match Impeller's clip space orientation (flutter/engine#38174)

* 41ec2804a Roll Fuchsia Linux SDK from rRJIjuO-dPNCpCTd9... to 8O5rMR_ehMaL3YhZ5... (flutter/engine#38177)

* 3dfd13f1d Roll Skia from 1b194c67700e to 491f5c134f76 (2 revisions) (flutter/engine#38182)

* 690f0e81c Fix sampler offsets (flutter/engine#38170)

* f24f2cc0a Roll Skia from 491f5c134f76 to 0d482f9fa8b3 (1 revision) (flutter/engine#38183)

* fbb79e704 [Impeller Scene] Refactor Nodes/Meshes for simplicity and GLTF compatibility (flutter/engine#38180)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
2 participants