Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bake objects in Play Mode

Discussion in 'Scripting' started by USMANHEART, Mar 1, 2020.

  1. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    My question is simple. I have tried a lot but I didn't got any answer or solution.
    My problem is that I want to Bake objects in play-mode (run-time). I don't have to switch light maps. Because there is no game model available in the project in advance. The models are downloaded by players and loaded into scene in play mode. I have to bake them so that those models looks realistic.
    Kindly give me an easy solution. It is very important and urgent. I am using Unity2017.4.03
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,710
    Unity's baked lighting happens in the editor, not your built program. The editor is installed on your computer and does not go out to the players of your game.

    You could look into other screenspace lighting techniques in the Unity Post-Processing Stack, such as screen-space ambient occlusion (SSAO).

    Or you can integrate your own lighting solution, either written yourself or integrated from an open source package.
     
  3. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    can you recommend me some opensource packages?
    And BTW I am already using Post-processing stack but still it is not enough for that kind of realistic look as a baked model have. Any other possible way? My main target is to make the models (Room interiors) looks realistic. At least same as models looks like after baking
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,710
    If you're making the models, just use whatever program that is to bake lighting the way you want it, then import both the model and the textures, all with pre-baked lighting.
     
  5. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    if it was possible then I could have done already. I already mentioned that switching light maps is not solution of my project.
    There are more than 12000 room interior models in the server. Users draw room models by his hands and then upload this into our server. The model doesn't exist in our project. It is made by users at run-time. Then he or other users will choose model of his desire (download and load into scene). Then we have to make those models looks realistic (as I noticed baked models looks more realistic). Any possible solution will be better
     
  6. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    don't have any expert here who knows the solution?
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    If the models are dynamically created at run time, and aren't even something you create in the first place, I think you're stuck with real time lighting. You can't bake lighting in a build (with what Unity provides at least), and even if you could do you really want your users to sit through a light baking process?
     
  8. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    Waiting is no matter. We can compromise with time. We need only output. The users are also workers in my company. They will add items (dynamically created) in the room and can wait 2~4 hours no matter. Just need solution.
     
  9. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Hello,

    Did you found a solution ?
     
  10. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Oh, but the aim is after users placing objects and stuff then there will be the baking/render
     
  11. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Looks very good !
    Maybe someday someone will think about making a plugin in unity for this !
     
  12. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    I am making my own plugin for this, unity can use it too
     
  13. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Can you share please ? also what kind of projects you are making btw ?
     
  14. USMANHEART

    USMANHEART

    Joined:
    Jul 23, 2016
    Posts:
    56
    It's not completed yet. Will share the API. The basic structure is simple
    1) Create/Load models during runtime
    2) Send your Scene to my API
    3) You will get new lightmaps, replace it
     
  15. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Yeah!