Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-9519

Document lightmap baking

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • QDS 4.1
    • QDS 4.1
    • Documentation
    • None

    Description

      QDS 4.1 will include tech preview of baking lights, so it needs to be documented. Here's a quick guide to get you started:


      For each model in the scene that should take part in the baking, specify the following properties:

      Model {
      id: myModel
      // ...
      bakedLightmap: myLightmap // Link to BakedLightmap item below
      usedInBakedLighting: true // Indicates this model is included in baking
      lightmapBaseResolution: 256 // Resolution of the baked lightmap for this model
      BakedLightmap

      { id: myLightmap key: "cubeModel2" // File name base for generated .exr and .mesh files enabled: true loadPrefix: "lightmaps" // Path where lightmaps are generated, relative to this file }

      }

      If Models inside subcomponent need to be included in baking, they must be exposed from the subcomponent:

      property alias lm_sphere1: sphere1

      Node {
      id: myScene
      Model

      { id: sphere1 //... }

      }

      And in the main qml you need to then do this:
      MySphere {
      id: mySphere
      lm_sphere1.bakedLightmap: sphereMap1
      lm_sphere1.usedInBakedLighting: true
      lm_sphere1.lightmapBaseResolution: 128
      BakedLightmap

      { id: sphereMap1 key: "sphereMap1" enabled: true loadPrefix: "lightmaps" }

      // ...
      }

      Additionally, you can specify some global baking properties using LightMapper item and setting it to SceneEnvironment:
      SceneEnvironment {
      id: sceneEnvironment
      lightmapper: lightMapper
      Lightmapper

      { id: lightMapper bounces: 5 // ... }

      // ...
      }

      Once all the properties are set up, simply trigger the baking process from 3D view toolbar or context menu.
      Baking happens on the background, in a separate process, allowing you to continue doing other things in the editor.
      Once baking process is completed, the baking dialog will pop back up and you can close it.
      Baking results in .exr (and potentially .mesh) files in the folder specified by loadPrefix properties.
      .exr contains the baked texture for the model.
      .mesh is a modified mesh file for the model, which is used instead of the normal mesh. It contains additional UVs for the baked texture. .mesh is only generated if the mesh didn't already contain baking UVs (it's an option during 3D import).

      For more information, see: https://doc-snapshots.qt.io/qt6-dev/quick3d-lightmap.html

      Attachments

        Activity

          People

            mahonkam Mats Honkamaa
            e0348803 Miikka Heikkinen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: