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,669
  2. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    It is worth having the option. I am using it a lot !
     
  3. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OK imported the new version in the city scene with the bridge.

    I whanted to bake selected on roadmarks to test the issue with shadow cast off.

    I did first accidentally delete baked light data thinking it was temp data, nevermind select and press bake.

    "Exporting scene-shaded surface colors..."

    NullReferenceException: Object reference not set to an instance of an object
    ftUVGBufferGen.RenderUVGBuffer (UnityEngine.Mesh mesh, UnityEngine.Material[] materials, Vector4 scaleOffset, Matrix4x4 worldMatrix, Boolean vertexBake, UnityEngine.Vector2[] uvOverride) (at Assets/Editor/x64/Bakery/scripts/ftUVGBufferGen.cs:170)
    ftBuildGraphics+<ExportScene>c__Iterator0.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:2747)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1658)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1568)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)


    I had to alt + f4 to close unity
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Try doing the full bake first.
     
  5. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    same err with full scnee bake ( ok obviously, but had to try) plus I get a terrain err when it was marked to lightmap (I can go without lightmap on terrain)
    upload_2018-8-16_20-9-45.png
     
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    It's probably caused by some particular objects. Can you try disabling, like, 50% of the scene and see if it works? Then another 50%, and so on, until you find the object causing it.
     
  7. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Also notice that clear baked data will unlink the lightmap data form teh models but I'm seeing the lightmaps files still exist in the BakeryLighmaps folder.
     
  8. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Ok, but I had this scene already baked. will try to isolate the issue but I was coming for a quick test as I was doing scripting thing haha.
     
  9. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Also, the scene presets have been wiped, this may have been the cause too the texel per unit is super hight etc..
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Oh wait, I think it's caused by object NOT having a material.
     
  11. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,912
    An option for it only appearing in indirectly lit areas would be good too.
     
    guycalledfrank likes this.
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669

    Attached Files:

  13. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    There is a mesh that is pink due to lack of material, yes, may be that one is the causing thing, I did not bother casue this is a test scene, will report in few minutes
     
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Or actually better try this one. I realized it could crash when you have materials.Length < subMeshCount.
     

    Attached Files:

    Mark_01 likes this.
  15. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    FIXED!
    you got that one super quick!
    I confirm terrains unchecked to lightmap seem to trow no more errs, will test later on again the terrain as seems to be problematic, I've several in other scenes too so it may be something specific to this one. I leave while it renders for dinner as pc is totally freezed due to sucking all resources
     
    Mark_01 and guycalledfrank like this.
  16. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I didnt run with second one but first one, but ok I will overwrite later.
     
  17. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    nice. all whent fine, roadmarks now don´t drop shadows.

    I noticed that tree creator leaves still project shadows as planes cany tips for nature shaders drop shadows with alpha?
    I've tested some shaders las mobile difuse or a custom double sided and indeed LM are rtained. I'll tomorrow test the latest version of that script just in case something happens.

    Clear bake data unlinks the lightmaps to the scene yet does not delete lightmaps, this may be the desired effect but if not ....
     
    guycalledfrank likes this.
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Sorry, didn't fully understand your sentence. Can you check the texture name your tree shader uses for opacity?

    Yeah, the clear button is to clean up your scene, but not the temp folder. Will add another for temp.
     
  19. therewillbebrad

    therewillbebrad

    Joined:
    Mar 2, 2018
    Posts:
    151
    Did the price go up on this?
     
  20. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Sorry for my crappy comunication skills XD.

    1) I've a tree, is not placed in terrain, this tree has Optimized Leaf Material and this tree I've with scale set to 0 so it does not self lit but does drop shadows. It does dorp shadows but the tree is formed by planes
    upload_2018-8-16_22-14-43.png
    It is a unity tree editor tree.
    The shadows this casts are shadows of planes without leaf transparency.
    May be I should create new material and don´t use the "optimized" materials but nature-->Tree creator leaves?


    2) I didnt meant the temp file folder wip (even this will be usefull). The current clear bake data does not delete "BakeryLightmaps" folder lightmaps but only deletes the connection of the scene objects with the lightmaps in teh folder
     
  21. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    May be 5 bucks. Still a bargain.
     
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    YouDesign and Mark_01 like this.
  23. therewillbebrad

    therewillbebrad

    Joined:
    Mar 2, 2018
    Posts:
    151
    guycalledfrank likes this.
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Found the reason for this. Somehow TreeCreator leaves have its own RenderType = "TreeLeaf" :) I was only accounting for Transparent and TransparentCutout.
    Fixed it, will include in the next update. You can quickly fix it yourself by going to ftBuildGraphics.cs and replacing
    if (matTag == "TransparentCutout" || matTag == "Transparent") {

    with
    if (matTag == "TransparentCutout" || matTag == "Transparent" || matTag == "TreeLeaf") {
     
    Mark_01 and TooManySugar like this.
  25. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Hi, this product seems to be getting very positive reviews, congratulations. I have a question.

    This is a baking asset, so can I bake Indirect Lighting only for Realtime GI with it as a substitute for Unity Lightmappers? But I realised directional mapping is not present. Also the price is steadily increasing. I want to buy it asap but please let me know.
     
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Hi. Yes, you can bake indirect lighting, but it will be static (won't react if you change lights at runtime). That should be similar to how Progressive works.
    Directional (the one with bump and specular) is not supported yet - but I'm working on this :)
     
    Mark_01 likes this.
  27. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    @guycalledfrank, do you also work on objects emit correct GI that have lightmap size = zero (like Unity does)?
     
  28. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    I mean for Precomputed GI which is Realtime GI and not for baking Baked GI.
     
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Yeah, will do that

    No realtime GI. Same limitations as with progressive.
     
    Cascho01 likes this.
  30. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    By the way, thanks for your relieable and quick responses! :)
     
    guycalledfrank likes this.
  31. Danoli

    Danoli

    Joined:
    Feb 20, 2017
    Posts:
    7
    As soon as this has ShadowMask support I will buy it :D!
     
    guycalledfrank likes this.
  32. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    You can use precomputed realtime GI with Bakery or PLM if you save baked lightmaps in editor and load it in runtime on start.

    For load lightmaps in runtime you can use something like this - https://pastebin.com/GayDUvQU

    How its work in production you can see here:

     
    Mark_01, Amin-, chelnok and 2 others like this.
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Wait, did you bake separate lightmap for every type of surface color?
    great music choice btw
     
    Mark_01 and TooManySugar like this.
  34. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    At least looks like he did for each floor I was pretty impressed too. I guess he has automated the baking process too somehow .
     
    YouDesign likes this.
  35. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    No, one baking lightmap on all scene in white color material. Indirect lights effects from surface colors - it`s precomputed realtime GI with updating in runtime.
     
    Mark_01 and Akshara like this.
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    But you can only bake precomputed realtime GI with Enlighten. What does it have to do with PLM/Bakery?
     
    TooManySugar likes this.
  37. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Lightmaps - it`s only textures. You can load it in runtime even when Backed Global Illumination disabled and Realtime Global Illumination enabled.
     
    guycalledfrank likes this.
  38. Ravl

    Ravl

    Joined:
    May 14, 2013
    Posts:
    35
    hi man, just wanted to ask you about normal maps. I am using PBR materials in my whole game so I am kinda need it. any idea when you will have support for these?
     
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Can't give absolutely accurate estimates, but I think it should be done in a month.
     
    Mark_01 likes this.
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    I'm researching shadowmask at the moment, and it seems like occlusionMaskChannel was only added to API since 2017.3 :( . I need it to set which light uses which shadowmask channel. Is there any alternative on older Unity versions?
     
  41. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I just think that you have to come out with your own logic here !
    Plus, i think there is only 4 lights that could masked per texel in some precious version of Unity and more than 4 in newer versions ( I am absolutely not sure on that, but be sure to check it )
     
  42. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    TBH I'm surprised there is even a publickly exposed way to achieve. That said was reading some competitors reviews and seem to have managed to add marking, and since they support 5.6+ there may be a way to do so
    https://assetstore.unity.com/packages/tools/level-design/raytrace-lightmaps-72162
    I was looking for post of ppl importing VRay ligthmaps and whanting to do hsadowmasking, no luck so far.
     
  43. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    Why do I always get stuck in the export scene?
     
  44. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Do you have
    1= terrains (they may work but to me have been problematic
    2= not UV2 mapped objs
    3=objects wtihout material!!! This was causing me err, dev posted fixing script few posts ago.
     
  45. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Ok, so
    "occlusionMaskChannel In case of a LightmapBakeType.Mixed light, contains the index of the occlusion mask channel to use if any, otherwise -1. "

    According to the link I poste the other dya:
    "
    In this mode, both the indirect lighting and the shadow attenuation for mixed lights are stored in lightmaps. The shadows are stored in a separate map, known as a shadowmask. When using only the main directional light, everything that's illuminated will show up red in the shadowmask. It's red because the shadow information is stored in the texture's R channel. Actually, shadows for up to four lights can be stored in the map, as it has four channels.

    "

    So, the
    occlusionMaskChannel
    seems to be dafaulted to R one, so even if not exposed in older versions isn´t gonna work by default unless you use other channels to store the data?

    Unless you've already with no luck, I think its a link worth checking because otherwise there is no much info out there
    https://catlikecoding.com/unity/tutorials/rendering/part-17/
     
  46. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    I have Material for each object. All mesh have uv2. My scene have no terrain. I don't know way always show export scene. Bad mood......
     
  47. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Export scene as package and send it to the dev sure he catches the issue in a blink.
     
  48. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Also, enabling overwrite warnings in my case showed up additional warnings. So enable warnings may be you get an informative message.
     
  49. JohanL

    JohanL

    Joined:
    Apr 15, 2013
    Posts:
    20
    Hey! I purchased Bakery today and I've been trying it out and I must say I'm very impressed.

    However I've encountered some issues when I'm baking. It seems like alot of my meshes with negative scale turn black when baking is done, it doesnt happen to all objects with a negative scale, but for what I can tell all the objects that have turned black has had a negative scale.

    We are using 2018.2.2.f1 so maybe thats the issue?

    I tried searching in the forum but I couldnt really find an answer to my question, so I apologize if this has been answered before!
     
    ArchVizPRO and guycalledfrank like this.
  50. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi, @guycalledfrank , you mentioned that you fixed the negative scale issue when the parent object is with negative scale ! Does it apply if the object itself is with negative scale only and it's not parented ( i was wondering but can not try now ! ) ?