Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtquick3d-optimizing-3d.qdoc
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5
6\title Optimizing 3D Assets
7\page quick3d-asset-conditioning-3d-assets
8
9In Qt Quick 3D, you can import 3D models and scenes that are created using 3D modeling tools. To
10see the supported file formats, see the \l {Balsam Asset Import Tool}{Balsam tool} documentation.
11
12\section1 3D Content Overview
13
14In this section, you will find an overview of creating and exporting 3D assets to use in
15Qt Quick 3D. For more detailed information, see the section for the
16\l {Exporting from Different Tools}{specific 3D modeling tool} that you are using.
17
18\section2 Geometry
19
20\list
21\li
22 \b {Use Triangles}
23 Qt Quick 3D only supports geometry exported as triangles. Many 3D modeling tools provide an
24 option to triangulate meshes during export, while you must do it manually before the export
25 with some tools. If models are not triangulated on export, they will be triangulated on import
26 which may lead to less than optimal results. If models are exported using primitives that can
27 not be triangulated, then those primitives will be ignored on import.
28\li
29 \b {Handling Pivot Points}
30 Each DCC (Digital Content Creation) tool handles pivot points differently. In Qt Quick 3D, there
31 is only one pivot per object and it is used as the origin for position, scale, and rotation
32 operations. In your DCC tool, feel free to adjust the position of a 3D model's pivot as needed.
33 However, extreme edits to pivots in 3D modeling tools can cause problems upon import, especially
34 if animated. This difference is often manifested as a difference in the position or orientation
35 of an object. As an artist, you can prevent these kinds of problems by only making simple edits
36 to your pivot points. Keep your pivot points to the default (world) alignment, don't scale them,
37 and make sure that if you have multiple pivots (Maya) that they are all at the same location in
38 space.
39\li
40 \b {Transformation}
41 As you would expect you can import full 3D transform information including position, rotation,
42 scale, and pivot. Qt Quick 3D can handle right-handed coordinate systems, Y-up
43 and quaternion based rotation. The principal limitation in this area is pivot points.
44 As discussed above, only simple edits to pivot points are supported.
45
46 Most DCC tools allow artists to freeze transformations, and we highly recommend performing this
47 operation before importing mesh data into Qt Quick 3D. This operation ensures that the imported
48 mesh has clean transformation data and no arbitrary transformation values, which can be
49 confusing or an impediment to your work.
50
51 \note After freezing transforms, you may have to reposition the pivot point in some DCC tools.
52\endlist
53
54\section2 Animations
55
56Animations are supported on imported attribute. Position, rotation, scale, and pivot can all be
57animated. An example of our advanced support for animations would be a hierarchy of items, rotated
58simultaneously on an arbitrary axis.
59
60\list
61\li
62 \b {Time-based Animations}
63 By default, in many 3D modeling tools, when you are creating keyframes you are associating them
64 with certain frame numbers. This is great in the film industry where frame rates are constant,
65 but this technique necessarily has problems in applications where the frame rate may not
66 be rock solid. Our solution to this problem is to express the locations of keyframes in time
67 values instead of frame numbers. That way, if you say \e {"this logo animation plays for 3
68 seconds\"}, we can guarantee that it plays for 3 seconds. If you express it in frames,
69 \e {\"this logo animation plays for 180 frames\"}, it may play for 3 seconds if you're
70 getting 60 fps, but if you drop to 30 fps the animation is going to go much slower.
71
72 Luckily, accounting for this is relatively simple. Many 3D modeling tools default to a setting
73 of 24 frames per second, so your keyframes are translated at that ratio. If you want a keyframe
74 at one second, put it on frame 24. Two seconds? Frame 48, and so on. Usually, configurable
75 frame rates are offered, and the frame rate setting should be respected upon import.
76 It's also worthwhile to note that for example Maya, starts at frame one by default. If you have
77 a keyframe at frame one, the time for that keyframe is 1/24 or 0.041 seconds. It may be a
78 good idea to go into your Maya animation settings and start your animations at frame 0, or
79 0/24 = 0 seconds.
80\li
81 \b{Different Animation Systems}
82 3D modeling tools offer highly complex and specialized animation systems. We recommend using
83 Qt Quick 3D's animation capabilities whenever practical. This helps in keeping the mesh
84 information clean on import.
85\li
86 \b {Baking Animations}
87 You must bake all animations before exporting.
88\endlist
89
90\section2 Materials
91
92For materials, material slot IDs and UV layouts are imported.
93
94\list
95\li
96 \b {Textures}
97 Images applied to different material IDs are imported. We recommend using \c .png or compressed
98 image formats.
99\li
100 \b {Using Powers of Two Texture Map Pixel Dimensions}
101 As is the case with most real-time graphics, texture maps run optimally when their pixel
102 dimensions are set to powers of two.
103\endlist
104
105\section2 Lights and Cameras
106
107Lights and cameras can be imported.
108
109\list
110\li
111 \b {Lights}
112 For light, directional, point, and spot lights with position, rotation, light color, and
113 the attenuation factors properties will be imported.
114\li
115 \b {Cameras}
116 Perspective and orthographic cameras can be imported. Position, and rotation properties
117 are imported, as well as start and end clipping. For perspective cameras, field of view is
118 also imported.
119\endlist
120
121\section2 Other
122
123\list
124\li
125 \b {Axis Conversion}
126 Qt Quick 3D uses a Y-up coordinate system, ensure that \c {Up Axis} is set to \c {Y}.
127\li
128 \b {Hierarchy}
129 Qt Quick 3D supports importing hierarchical information. Hierarchies of arbitrary depth are
130 supported, including grouped nodes. Hierarchical transforms are applied as expected.
131\endlist
132
133\section1 Exporting from Different Tools
134
135\table
136\header
137 \li
138 \b Tool
139\row
140 \li
141 \b {\l{Exporting from Maya}{Maya}}
142\row
143 \li
144 \b {\l{Exporting from Blender}{Blender}}
145\row
146 \li
147 \b {\l{Exporting from 3D Studio Max}{3D Studio Max}}
148\row
149 \li
150 \b {\l{Exporting from Modo}{Modo}}
151\endtable
152
153*/