Search Unity

Question How to do light baking in an ECS system?

Discussion in 'Graphics for ECS' started by Bagazi, Aug 14, 2023.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Suppose I have a scene that requires light baking. How do I handle this logic within the ECS environment? Should I separate the areas that need light baking from the subscene to keep them isolated and avoid interference, or are there other alternative methods?
     
  2. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    283
  3. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Regarding light baking, such as needing to bake within a subscene, is the process for this consistent with the standard scene's workflow?
     
  4. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    There should be no need to move anything. Lightmapping will still work and be split into the subscenes by Entities Graphics. It then converts them (if you have more than 1 lightmap) into a Texture2dArray when you close the subscene. However, there is a bug currently where you have to manually enable the read/write flag on the lightmaps after the baking completes and before closing the subscene(s). A problem with Texture2dArray requiring this, but I believe this will get fixed shortly.
     
    Bagazi likes this.