Search Unity

Bakery - GPU Lightmapper (v1.96) + RTPreview [RELEASED]

Discussion in 'Assets and Asset Store' started by guycalledfrank, Jun 14, 2018.

  1. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    That's a huge world indeed! What are these dark spots between the city and the terrain though?
     
  2. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    Yup I was pretty worried about the size at first but your asset came at the right time lol. That black stuff is some stuff being out of LOD level and it's not showing anymore. Under those objects are black shadows which will never really show in the game because no one is that far from the objects in the actual game. :)
     
    guycalledfrank likes this.
  3. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    this plugin is awesome ... seconds against of hours !!

    everything looks good ... skylight and directional light are amazing ...
    but i can't get good results by point and mesh light ... unexpected bad lighting results :[
    i hope on next release , we able to using native lights natively ;]
     
    Last edited: Sep 28, 2018
  4. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    Bakery lights are better in most ways to Unitys native lights. Do you have an example of what are your bad results? Have you tried increasing intensity, and toning it down with the post processing stack? The denoiser needs light to work with.(or try disabling the denoiser to see what it actually generates)
     
  5. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    solved :]

    but i have problem with non-static [dynamic] objects that does not affected by bakery lights!!

    here is an video that i baked [just in 20 sec!! **Awesome**] an interior smple scene from Archvizpro 1 that converted to HDRP ...

    the gray spheres are non-static ... not shadows ... not direct lightings :[

     
    Last edited: Sep 28, 2018
    ArchVizPRO and guycalledfrank like this.
  6. MattVLSG

    MattVLSG

    Joined:
    Apr 2, 2018
    Posts:
    43
    Hello again... :)

    Starting to get a few 'halffloat2hdr error: 5' errors now mostly baking light probes. I find if I completely remove all the temp folders, and the hidden !ftraceLightmaps object that is placed in scenes and start the whole process again, this error will go away.


    This error also comes up when baking probes...
    2018-09-27 13_32_42.png

    What I found was that it occurs if you try to bake probes on a scene that wasn't the last scene you baked lightmaps for.


    Otherwise, I'm finding it almost impossible to perform a successful LProbe bake now. It will almost always fail with
    '
    Failed to unload 'Assets/Bakery/_tempScene/LightingData.asset'
    '

    The typical scene we're baking on ....
    - A dozen or so scenes
    - Thousands of Gameobjects to be lit
    - Hundreds of light probes

    Sorry I can't send over the scenes, but I can try to reproduce it in a non-project scene
     
  7. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    Looks good! Good job! :)
     
  8. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    your welcome ;)
    but its just a test to showing some lighting problems !! :D
     
  9. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Impressive!

    Dynamic objects are only affected by probes and Unity lights, yes. You can use mixed lighting to integrate them into the baked scene:
    - Add Unity lights to Bakery directionals and points (the ones you want to be semi-dynamic).
    - Enable shadows on Unity lights.
    - Press "Match real-time to lightmapped" on Bakery components to copy the values into Unity lights.
    - Enable the "Shadowmask" checkbox on Bakery components on lights you want to interact with dynamic objects.
    - Enable the "Bake to indirect" checkbox on lights you want completely static (not affecting dynamics).
    - In main Bakery window, set render mode to "Shadowmask".
    - Bake.
    You should get the same baked lighting, but dynamic objects will also properly cast shadows. On top of that you get normal mapping and specular from Unity lights without paying for real-time shadows from static geometry (they are still baked).
    You can also try with "distance shadowmask" checkbox on and off. When it's off, dynamic objects will cast shadows that mix properly with baked lighting, but won't receive baked shadows. When it's on, shadowmasked lights will work as dynamic close to camera but fall back to previous mode when your scene's shadow range ends.
    This is how mixed lighting works in Unity - having Bakery components only equals to using built-in lightmapping with all lights set to "baked" mode.
    BTW take a look at the example_shadowmask scene that comes with Bakery.

    Interesting. The meaning of this error is that it failed to save a HDR file (no disk space or something else?...).
    The more interesting bit is that halffloat2hdr is never actually called during probe generation - only during lightmap rendering. Are you 100% sure it happened after clicking the Render Light Probes button?

    OK, now that seems like a more clearly reproducible bug - looking into it, thanks.

    Are you sure that's exactly the text? I don't have anything like that anywhere, meaning it's Unity's error. Apparently happens when I call EditorSceneManager.UnloadSceneAsync (?). Can you show me a few records in the console before this error?
     
  10. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    thanks for your reply ... but does a plan to fully support dynamics on next releases? or is it possible in the future?
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Shadowmask mode is the way to go - re-read my reply and try it :)
     
  12. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    well ... i think this method is working with legacy light ... not HDRP lights ...

    this is before adding HDRP Point light:
    before.JPG

    and this after enabling HDRP Point light [matched with bakery source]:
    this is disappointed :\
    after.JPG
     
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Use the shadowmask checkbox! And shadowmask render mode. Go and check the example_shadowmask scene! Read the manual, there are so many pictures! It works, but you are not even trying :D

    Also maybe read Unity docs first: https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html

    I'm pretty sure ArchVizPRO did post pictures of him using shadowmask + HDRP earlier in the thread.
     
    Last edited: Sep 28, 2018
    Mark_01 likes this.
  14. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    after shadow mask: :confused:
    Capture.JPG
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    You scene looks like it's being lit by a shadow-less real-time directional light though. Why is that? Testing the dim spot light is hard when everything is dominated by the directional.
     
  16. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    this is whole scene:
    before.JPG

    also i tried to adding an HDRP light to spot light and match it with bakery spot [without shadow] after baking:
    Capture.JPG

    and then after enabling HDRP light shadow:
    Capture.JPG
     

    Attached Files:

  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    For HDRP I think you need to enable shadowmasking explicitly, and for some reason this checkbox is off by default (also check the same checkbox in "scene view" section):

    upload_2018-9-28_12-14-20.png
     
  18. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    i tried that ... nothing changed :\

    i think needs your genius solution for Bakery on HDRP !! :]
     
  19. MattVLSG

    MattVLSG

    Joined:
    Apr 2, 2018
    Posts:
    43
    My mistake, it happens during normal baking.

    When it occurs again, I'll grab the rest of the errors. And yes actually it seems to be a Unity side thing.
     
    guycalledfrank likes this.
  20. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Well it does work... Maybe ask ArchVizPRO if he had to do something extra.
    Did you try the example_shadowmask scene? Does it look right? There are dynamic capsules in a static baked world, and all that works in HDRP.
     
  21. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    ok ... thanks for your response :)
    but Archviz interior just model and texture ... nothing special else!! ;)
     
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    He was using Bakery himself, inclduing converting one of his scenes to HDRP.
     
  23. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
  24. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @guycalledfrank

    and another bug ...
    needs to baking Reflection Probes Again when restarting unity [Bakery 1.3 + HDRP + 2018.2.10f1]
     
    Last edited: Sep 28, 2018
  25. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Hmm that shouldn't happen. Reflection probes are rendered by Unity itself (Bakery doesn't do that - button is only for convenience) and are saved to LightingDataAsset as usual. In fact pressing "render light probes" in Bakery is exactly the same as clicking it in the Lighting window. Are you sure reflection probes disappear after you reopen the scene? Maybe you are doing something else after they are rendered and before closing Unity, like rendering light probes?
     
  26. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    nope ... if press bake button of reflection probe, the unity's progressive lightmapper starting and everything of bakery goes to destroying!! :D

    yup ... reflection probes are exists but without any data.

    ????
    definitely i saved the scene before closing ...
     
  27. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Do you have any LightingDataAsset assigned in your scene?

    upload_2018-9-29_0-13-56.png

    Weird assumption, but if you create some light probes somewhere, render them AND reflection probes, does it work?
     
  28. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    where is this option?
     
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    It used to be in Lighting -> Global Maps, but since Unity is rearranging all the windows with every version, I can't find it in 2018.2. Anyway, thanks for reporting - will investigate.
     
  30. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    well, seems that this awesome plugin really needs to be refreshed ;)
     
    guycalledfrank likes this.
  31. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    In any case - try creating light probes and rendering them (just to initialize LightingDataAsset) and then rendering reflection probes - that should work. I'm suspecting the situation you are having is because the asset is not assigned to the scene.
     
  32. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    i tried that ... but in this time the data of reflection probes is an pure blue color [env. color]!!
     
  33. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    well ... i changed the reflection probe type to realtime and now its ok :cool:
     
  34. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Did you try pressing the "update skybox probe" button?

    Glad it works, although it's not the best solution performance-wise.
     
  35. liudian208

    liudian208

    Joined:
    Aug 30, 2018
    Posts:
    59
    1. Hi frank, can I turn off backface GI of some objects? -- saw thread before, not a serious problem, but yeah it would be the best to work as another compoent to add or so.
    2. And why one prefab only recognize one material as GI metapass color to bleed, I've sent you the detail picture.
     
    Last edited: Sep 29, 2018
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Currently no, but I'll try to do something about it. Not going to forget it, as I want this feature for my own project as well.

    All submesh materials should affect the GI. Saw the picture, will continue in PM.
     
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    OK, seems like there was a bug, sent you a fix. For anyone encountering this problem, just open ftUVGBufferGen.cs and replace lines like:
    Graphics.DrawMeshNow(m, worldMatrix);

    with
    Graphics.DrawMeshNow(m, worldMatrix, i);


    Highly sorry about this dumb typo :)
    Fix will be also included in 1.4.

    upload_2018-9-29_12-11-19.png
     
    Mark_01 likes this.
  38. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    More directional lightmaps tests and comparisons.

    Reference = normal map baked into lightmap (low res, but 100% correct lighting)
    Dir = standard Unity-compatible directional mode (half-lambert dominant direction)
    RNM = Half-Life 2 technique
    SH = Frostbite (Battlefront) technique

    All modes will be available in v1.4.



     
    CoastKid, RockSPb, Thee2nd and 3 others like this.
  39. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    321
    Добрый вечер с Уралом! Наблюдайте за своим проектом и ждите, пока, наконец, не появятся карты направленного света. Ориент, пожалуйста, как долго до выпуска обновления 1.4? И второй вопрос заключается в том, можно ли в следующем обновлении переключаться между несколькими картами света на одной и той же игровой сцене?
     
    YouDesign likes this.
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Did you translate to Russian via google translate or... ? :D
    In any case, I think it's more appropriate to use English here, or other users won't understand you.

    v1.4 is coming soon. Things I need to do:
    - Properly integrate seam fixing/denoising to RNM and SH pipeline (should be finished today).
    - Finally design something like a "Bakery Standard Shader" that would give same features as Standard, but also support vertex lightmaps, RNM and SH. It's a bit tricky to make it work on all Unity versions and render pipelines, so perhaps a few days.
    - Fix a bunch of bugs I received reports about (not sure about ETA yet).

    Hopefully 1-2 weeks should be enough for all.
     
    osss and YouDesign like this.
  41. Nox7atra

    Nox7atra

    Joined:
    Apr 6, 2015
    Posts:
    4
    Advice: I tried make auto-baking on my server, but I can't do it without UI, because your Editor Window (ftRenderLightmap) has 5163 lines of code. I found method for "start baking", but without window it falls with error 1. If It is possible to add static method Bake(BakeConfiguration config) it would be great.
     
  42. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Bake is a coroutine:
    IEnumerator RenderLightmapFunc()

    It interrupts itself from time to time to update the progress bar or wait for Unity to perform some action (e.g. unload a scene).

    Can you try running it like a coroutine?
     
  43. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    [Feature Request] it would be great if be available an auto algorithm [nVIDIA Based] to generating and optimizing UV lightmaps automatically :)
     
  44. Nox7atra

    Nox7atra

    Joined:
    Apr 6, 2015
    Posts:
    4
    I think your understand what I tried to do. But It works proreply only if Editor Window opened
    (my class)
    upload_2018-9-30_20-3-47.png
    (method that i created in ftRenderLightmap)
    upload_2018-9-30_20-2-25.png
    (Error with closed window)
    upload_2018-9-30_20-7-31.png
     
  45. Nox7atra

    Nox7atra

    Joined:
    Apr 6, 2015
    Posts:
    4
    If ftRenderLightning already opened It works as expected. But becacuse your code style without throwing exceptions, I can't properly handle an exception and relaunch method (I can, but It's bad practice to rewrite your plugin, because I want to update it without additional work inside your code)
     
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Sorry, I didn't understand your request exactly. Optimize UVs? Optimize lightmaps? Optimize how?

    Hmm, I see. I suspect it's because opening the window forces Bakery to load bake settings into static variables.
    What if before baking you manually call OnEnable()?
     
  47. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    i mean an function on Bakery that analyzing allof lightmap UVs and generate lightmap uv for objects that don't have it or optimizing it for best baking results ... but nVIDIA based :D
     
  48. Nox7atra

    Nox7atra

    Joined:
    Apr 6, 2015
    Posts:
    4
    Now I'll write workaround for my purpose, but It would be cool if in future you'll create a static method for launch baking with custom configuration
     
    guycalledfrank likes this.
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    I'm not aware of any nvidia-specific UV unwrapping algorithms unfortunately. Generating optimized UV layouts is not an easy thing. Take a look at this guy, he is developing a pretty cool unwrapper, and it took him many months to get there. I'm probably going to buy a license.

    Noted. Shouldn't be too hard to add.
     
  50. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    or something like as Generate Lightmap UV on Unity FBX importer , but nVIDIA Based [ CUDA probably ?? ]to making UVs much faster
     
    Last edited: Sep 30, 2018