forked from qt-creator/qt-creator
Doc: Add documentation about baking lightmaps
Task-number: QDS-9519 Change-Id: Ibe91546a14f074eb7ff489e21c36676f23b74cbb Reviewed-by: Esa Törmänen <esa.tormanen@qt.io> Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
This commit is contained in:
BIN
doc/qtdesignstudio/images/baked-lightmaps-add-property.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-add-property.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
BIN
doc/qtdesignstudio/images/baked-lightmaps-edit-component.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-edit-component.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
doc/qtdesignstudio/images/baked-lightmaps-exit-component.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-exit-component.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
doc/qtdesignstudio/images/baked-lightmaps-navigator-blm.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-navigator-blm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
doc/qtdesignstudio/images/baked-lightmaps-navigator.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-navigator.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
doc/qtdesignstudio/images/baked-lightmaps-property-value.png
Normal file
BIN
doc/qtdesignstudio/images/baked-lightmaps-property-value.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
@@ -208,4 +208,97 @@
|
|||||||
To specify the maximum distance for the shadow map, set the
|
To specify the maximum distance for the shadow map, set the
|
||||||
\uicontrol {Shadow map far} property value. Using smaller values
|
\uicontrol {Shadow map far} property value. Using smaller values
|
||||||
may improve the precision and effects of the map.
|
may improve the precision and effects of the map.
|
||||||
|
|
||||||
|
\section1 Baking Lightmaps
|
||||||
|
|
||||||
|
\note Lightmaps baking is released as technical preview in \QDS 4.1.
|
||||||
|
|
||||||
|
\section2 Baking Lightmaps for a 3D Model
|
||||||
|
Baked lightmap components are not visible in the \uicontrol Navigator view by default. To make
|
||||||
|
them visible, select \inlineimage icons/visibilityon.png
|
||||||
|
in the \uicontrol Navigator view.
|
||||||
|
|
||||||
|
To bake lightmaps for a 3D model:
|
||||||
|
\list 1
|
||||||
|
\li From \uicontrol Components, drag a \uicontrol {Baked Lightmap} component to
|
||||||
|
the 3D model in the \uicontrol Navigator view.
|
||||||
|
\image baked-lightmaps-navigator.png
|
||||||
|
\li In the \uicontrol Navigator view, select \e bakedLightmap and in the \uicontrol Properties
|
||||||
|
view:
|
||||||
|
\list
|
||||||
|
\li Select \uicontrol Enabled.
|
||||||
|
\li In \uicontrol Key, set the filename base for the generated light maps. This must be
|
||||||
|
a unique name.
|
||||||
|
\li In \uicontrol {Load Prefix}, set the relative path to the folder where the generated
|
||||||
|
light map files are saved.
|
||||||
|
\endlist
|
||||||
|
\li In the \uicontrol Navigator view, select the 3D model and in the \uicontrol Properties
|
||||||
|
view, select \uicontrol {Used in Baked Lighting}.
|
||||||
|
\li Optional. Adjust \uicontrol Resolution to set the light map resoution. This effects how
|
||||||
|
accurate and time-consuming the lightmap baking is.
|
||||||
|
\li In the \uicontrol Navigator view, select the light component that you want to bake
|
||||||
|
lightmaps for, and in the \uicontrol Properties view, set \uicontrol {Bake Mode} to BakeModeAll.
|
||||||
|
\li Right-click anywhere in the \uicontrol 3D view and select \uicontrol {Bake Lights}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section2 Baking Lightmaps for a 3D Model Inside a Sub Component
|
||||||
|
|
||||||
|
To bake lightmaps for a 3D model inside a sub component, first add a local custom property to
|
||||||
|
expose the model:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
\li In the \uicontrol Navigator view, right-click the sub component and select
|
||||||
|
\uicontrol {Edit Component}.
|
||||||
|
\image baked-lightmaps-edit-component.png
|
||||||
|
\li In the \uicontrol Navigator view, select the root component.
|
||||||
|
\li In the \uicontrol Properties view, select \inlineimage icons/plus.png
|
||||||
|
in the \uicontrol {Local Custom Properties} section.
|
||||||
|
\li Add a new property, set \uicontrol Type to alias.
|
||||||
|
\image baked-lightmaps-add-property.png
|
||||||
|
\li For the property, set the value to the ID of the 3D model that you want
|
||||||
|
to bake lightmaps for.
|
||||||
|
\image baked-lightmaps-property-value.png
|
||||||
|
\li In the \uicontrol Navigator view, select the 3D model and in the \uicontrol Properties
|
||||||
|
view:
|
||||||
|
\list
|
||||||
|
\li Select \uicontrol {Used in Baked Lighting}.
|
||||||
|
\li Set \uicontrol Resolution to, for example, 128.
|
||||||
|
\endlist
|
||||||
|
\li Save your changes (\key {Ctrl+S}) and return to the main project file. To do this, select
|
||||||
|
the bread crumb in the top toolbar.
|
||||||
|
\image baked-lightmaps-exit-component.png
|
||||||
|
\li From the \uicontrol Components view, drag a \uicontrol {Baked Lightmap} component to the
|
||||||
|
sub component in the \uicontrol Navigator view.
|
||||||
|
\image baked-lightmaps-navigator-blm.png
|
||||||
|
\li In the \uicontrol Navigator view, select the sub component and go to the
|
||||||
|
\uicontrol Code view.
|
||||||
|
\li In the \uicontrol Code view, you need to set the properties for the model inside the sub
|
||||||
|
component by using the exposed property.
|
||||||
|
|
||||||
|
Add the following code inside the sub component.
|
||||||
|
\code
|
||||||
|
lmSphere.bakedLightmap: bakedLightmap
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
It should look something like this:
|
||||||
|
\code
|
||||||
|
MyGroup {
|
||||||
|
id: group
|
||||||
|
lmSphere.bakedLightmap: bakedLightmap
|
||||||
|
BakedLightmap {
|
||||||
|
id: bakedLightmap
|
||||||
|
loadPrefix: "lightmaps"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
\li In the \uicontrol Navigator view, select \e bakedLightMap, and in the \uicontrol
|
||||||
|
Properties view:
|
||||||
|
\list
|
||||||
|
\li Select \uicontrol Enabled.
|
||||||
|
\li In \uicontrol Key, set the filename base for the generated light maps. This must be
|
||||||
|
a unique name.
|
||||||
|
\endlist
|
||||||
|
\li Right-click anywhere in the \uicontrol 3D view and select \uicontrol {Bake Lights}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user