Search Unity

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

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

  1. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    SH directional lightmaps looks very cool. I can't wait for try it in action...
     
    guycalledfrank likes this.
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    And just in case you wondered... yes, all directional modes in the next version of Bakery will support baked specular. I'm including a new shader supporting all extra features.


    ftspec.png
    ftspec2.png
     
    Last edited: Oct 1, 2018
  3. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Hey @guycalledfrank

    I'm receiving an error currently, with regards to CUDA.

    I'm using a GTX 1070, updated drivers, and I have CUDA toolkit 10 installed. Win10...

    I've been able to bake other scenes but this one is particularly complicated, and it's giving me this error.

    imgur link for error: https://imgur.com/1ZEoxik
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Hi there! Do you have any area lights (aka Light Meshes) in your scene? There was an area light related bug found recently, and I can send you a fix.
     
  5. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    I was able to solve by updating my Bakery version actually, to 1.3. Thanks!
     
    guycalledfrank likes this.
  6. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Actually if you could explain the following it'd be great:

    Basically all my lightmaps are being condensed to 1 4K map. I have a min resolution of 256 and a max of 4096. And yet I only get 1 map (attached imgur link below). This doesn't seem normal does it?

    imgur: https://imgur.com/a/w3yBkUJ
     
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Seems normal to me. You have max size = 4096 and your scene happens to fit into 4096 (but not less), so it does.
     
  8. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @guycalledfrank Hi there. Just a quick question for you: is it possible to use Bakery with dynamic time-of-day? In other words would it be possible to "blend" between different sets of lightmapping to fake time-of-day progression (with proper shadows from the sun)?
     
  9. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    Did the bug only affect light meshes with self-shadowing on? I could probably use the fix. Earlier I baked a scene successfully, but noticed I needed near samples on light meshes and after that I got that same CUDA error. So I'm currently trying to rebake with no self shadowing again just to get it done.
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I'm going to add this feature, but it's not there yet. You can script it yourself, it doesn't matter if lightmaps come from Bakery or built-in lightmappers.

    Yes, exactly. For anyone encountering this problem - just replace this file:
    https://drive.google.com/open?id=1iT-lwnpGUeP68B2YPeSBKOtnzRWrXzee
     
    Mark_01 and Seith like this.
  11. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Wow! It`s look amazing!
     
    guycalledfrank likes this.
  12. MDK2k

    MDK2k

    Joined:
    Oct 27, 2014
    Posts:
    15
    A few quick questions about this asset.

    How fast is it compared to the the Unity GPU lightmapper in beta?
    I'm seeing around 10x speed increase compared to CPU with the beta GPU lightmapper when looking at gigarays per second. Is this even faster? Not in a direct comparison with the same sample count, but with the end result and optix denoising.

    When will there be RTX support and how much of a speed increase is that going give in an average case?
    My understanding is that RTX cards are roughly 6 times faster in doing pure ray tracing tasks. However rendering images or baking lightmaps also requires to do shading calculations that can't be done with RT cores. Depending on the complexity of the shaders the benefit of RTX varies. A really really simple shader will only take 1% of the render/baking time while a complex pixar production shader will take 50%. What will this ratio be with baking a scene using the standard pbr materials?

    Does this support multiple GPU:s?

    Can you bake just AO and nothing else with this?

    I'm looking for a method to have some basic lighting done on some models really quickly with just ambient lighting. Is it possible to bake AO and nothing else with this asset? My current workaround is to bake AO in Maya with redshift. Takes around 2 minutes to bake a 8k texture, but it's not a proper lightmap obviosly.

    Are there any good videos on this asset? I can't seem to find any with google?
    Would be so nice to see a video showing off the features. Would be a lot easier for people to make a purchase decision seeing how much stuff like optix denoising helps with bake quality. etc.
     
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I didn't test it yet, but seems comparable. Maybe someone in the thread did a comparison?
    If nobody did, I'll take a look in a week.

    If you have an RTX card, you should already get some boost, I think, since Bakery is based on nvidia tech (OptiX) that is known to take advantage of RTX. Maybe I'll have to update the library for that.
    I've no idea about speed increase though. I don't own an RTX card. If someone does, would be nice if they reported their render times for built-in scenes.

    It's not as simple as that. RTX boosts ray-tracing routines, that's correct, but performance may vary with different scenes quite a bit, because of memory access speed (which is not different between, say, 1080 and 2080).

    Yes, it should get faster with multiple GPUs (SLI).

    AO is a range-limited simplification of ambient lighting. Instead of baking AO, you should bake Skylight instead, which will give you proper large scale ambient occlusion.
    Pure AO is also supported, but can't be baked separately at the moment.

    I'm not aware of any good videos, but since I'm getting close to finishing the majority of features promised, I'll probably record something in near future.
     
    Last edited: Oct 2, 2018
    Mark_01 likes this.
  14. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Hi again @guycalledfrank - wondering if you can chime in on another issue we're facing. The setup is this:

    We're currently using a custom lightmap on the 2nd UV channel (UV set 1) on certain meshes. This appears to work fine according to your best practices. We are then using a Secondary Normal Map and applying this to the UV set 1. The following happens:

    1. In-editor appears to look OK.
    2. At runtime, the shadow or Second Normal information distorts significantly, stretching to look much larger on the mesh
    Can you inform me what would be the appropriate workflow to apply a Second Normal Map on a mesh in Bakery? Is it any different than using Unity's light solver?
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Good question - doesn't seem like it has anything to do with Bakery though, as lightmaps are applied by Unity in a regular fashion. Can you try checking this behaviour with built-in Unity lightmappers?
     
  16. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Hey ya it gave us the same problem actually so it's not a problem with your lightmapper :)
    I'm leaning toward thinking it's the Secondary Normal Map interfering with the UV set 1 (which AFAIK is being used for lightmaps in Unity right?)

    Curious what your take is in on this! Thanks again
     
    guycalledfrank likes this.
  17. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    457
    I had the same problem with Unity Enlighten. I solved with a custom shader, where the Normal map was moved to the UV3.
     
    guycalledfrank likes this.
  18. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Hey also in regards to this, would you be able to send me that fix? :) thank you!
     
  19. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
  20. liudian208

    liudian208

    Joined:
    Aug 30, 2018
    Posts:
    59
    Hi frank, I like to use bake to vertex color tool, but the problem is that I can't use it when bake shadowmask, I have to bake it full lighting first then bake the shadowmask as before, then delete the lightmap generated for the part that I want to be baked to the vertex color. Is there an easier way?
     
  21. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Vertex lightmaps currently don't support shadowmask. I'm going to add it to v1.4 though.
     
  22. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Do you have any plan about v1.4 release date? Sorry to bother you:) But new features it`s very impressive and i can't wait to try it`s;)
     
  23. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    guycalledfrank likes this.
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Hopefully 1-2 weeks.
     
    lightwaterjohn and YouDesign like this.
  25. JohnDraisey

    JohnDraisey

    Joined:
    Jul 28, 2013
    Posts:
    19
    Been using Bakery for a day, and I'm blown away. Here's some images from the Ultimate FPS 2.0 demo. Reduced lightmap baking times, improved the quality significantly. I've never been happier!
     

    Attached Files:

    Mark_01, guycalledfrank and magique like this.
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Thanks! Not sure I can see any baked lighting on these screenshots though - looks more like real-time shadows/specular everywhere :confused:
     
    TooManySugar and Adam-Bailey like this.
  27. JohnDraisey

    JohnDraisey

    Joined:
    Jul 28, 2013
    Posts:
    19
    Oh, I'm using Distance Shadowmaps. So just the indirect is baked.
     
    guycalledfrank likes this.
  28. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    62
    Fist amazing job... This is an amazing upgrade in speed. I have no idea why unity did not do this years ago. GPU ray tracing is not new.

    However, I am having issues with emission maps. See the below.. .very bright yet no emission?

    Any ideas?
    ScreenCap1_91668.png
     
    guycalledfrank likes this.
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Do you use multiple materials on one mesh? There was a bug discovered earlier in the thread related to this, and I posted a solution.
     
  30. MDK2k

    MDK2k

    Joined:
    Oct 27, 2014
    Posts:
    15
    Thanks for the quick answers.

    As for the AO only baking that is a specific case where I would need to get some basic shadows to an interior CAD model without any extra work. So as automated as possible.

    So basic sky lights wouldn't work due to walls and ceiling and neither would adding lights since it's extra manual work. That leaves ambient lights with baked AO. That would basically be a solution that worked every time regardless of the model and would give very clear visual feedback on the 3D-model.
     
  31. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Well I can do a simple "Render AO only" button if that's what you want. AO code is already there, so shouldn't be too hard.
     
    MDK2k and liudian208 like this.
  32. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    I have a some bug. After baking i press "Render Reflection Probes". Probes have been generated and work. But after exit from play mode or reopen project (or scene) Reflection Probes disappear. How i can repair this?
     
  33. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    62
    Yes it does I must have missed that thanks! I will go look. Again spectacular job.
     
    guycalledfrank likes this.
  34. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    That seems to happen when you don't have any LightingDataAsset assigned to the scene. As a workaround, can you try baking some light probes and then reflection probes? Currently only light probe bake initializes the asset. Going to fix it for v1.4.

    The fix is here: https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-3-released.536008/page-20#post-3732934
     
    Mark_01 and YouDesign like this.
  35. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    62
    ftUVGBufferGen.cs
    Line:213
    if (!vertexBake)
    {
    for(int j=0; j<uvOffset.Length/2; j++)
    {
    UpdateMatrix(worldMatrix, uvOffset[j*2] * texelSize, uvOffset[j*2+1] * texelSize);
    Graphics.DrawMeshNow(m, worldMatrix,i);
    }
    }
    else
    {
    UpdateMatrix(worldMatrix, 0, 0);
    Graphics.DrawMeshNow(m, worldMatrix,i);
    }

    Worked great!

    Thanks so much! I was having trouble finding it.

    Great response times!
    On a side note do you have a road-map link to what else your planning in this amazing work?
     
    guycalledfrank likes this.
  36. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Thanks, it`s work...
     
    guycalledfrank likes this.
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I don't have a link, but a huge text file with changing priorities. Some cool things I finished today:
    - Vertex lightmaps now fully support shadowmask and all directional modes (Bakery shader or modifications to your own shader are required). Additional data is stored inside UV2/UV3.
    - It's not possible to set different resolution for color/mask/direction lightmaps. E.g. it's often useful to have low-res GI (it's often low frequency anyway), but high-res shadow masks. Saves memory. UV padding adjustment is applied based on lowest resolution map.

    (pic: some new sliders and a sphere with SH lightmaps baked into vertices. There aren't too many vertices, so jaggies are expected)

    upload_2018-10-4_1-1-0.png

    Advanced mode is getting so many sliders, it now looks like some sort of an equalizer. You can imagine yourself being a graphics DJ now :confused:
     
    CoastKid and YouDesign like this.
  38. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    can you set the default values of Backface GI to 1 and Texels per unit to 100 and turnoff the Adjust UV padding option?
     
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Why do you want these defaults exactly? Adjusting padding is something I would prefer to be enabled for the majority of cases, and texels=100 is a very large value if someone decides to try it on a city-sized map.

    But I can imagine it can be too annoying for you to set the values every time you create a new scene... feels like I really should make presets for settings.
    For now you can try editing ftLightmapsStorage.cs file, the defaults are there.
     
  40. MattVLSG

    MattVLSG

    Joined:
    Apr 2, 2018
    Posts:
    43
    Hello, we seeing a few lightmaps come out rather empty... I remember (It's a long forum thread now) this being related to LOD's going into different maps?

    2018-10-04 10_45_34.png

    Is there a way to get Bakery "just pack as much as you can into as few maps" ? As you could imagine, when you get a handful of these at 8mb each then we're paying a lot of memory for lots of black pixels. :)

    Cheers!
     
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Yes, exactly, a bug in how lightmaps are assigned to LODs. I'm going to look into it soon, pretty important to fix. Definitely has to be fixed for v1.4.
     
    Mark_01 likes this.
  42. MattVLSG

    MattVLSG

    Joined:
    Apr 2, 2018
    Posts:
    43
    Ah ok, great, thanks for the quick reply! :)
    Look forward to it!
     
    guycalledfrank likes this.
  43. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Do vertex lightmaps store data in the vertex colors? Meaning you wouldn't be able to use vertex colors for anything else?
     
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Yes. But you can change the script to set the values to something else (e.g. to UVs).
     
  45. LouisVanDerMerwe

    LouisVanDerMerwe

    Joined:
    Jan 30, 2013
    Posts:
    3
    RTX is unfortunately not that much faster. Sponza day: 4:21 on 1080, 3:19 on 2080ti. (10 texels per unit, 5 bounces, 32 samples on Win 1809 Unity 2017.4.12 Nvidia 416.16)
     
    Last edited: Oct 4, 2018
    guycalledfrank likes this.
  46. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Is that a 1080ti?
     
  47. LouisVanDerMerwe

    LouisVanDerMerwe

    Joined:
    Jan 30, 2013
    Posts:
    3
    Nope standard 1080 FE
     
  48. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Yikes.
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Hmm: https://devtalk.nvidia.com/default/...s-optix-5-1-support-the-turing-architecture-/

    Applications written with the currently available OptiX 5.1 SDK will use the Turing SM and some parts of the RTCores for ray tracing and will use the Tensor cores for AI based Denoising. However the RTCores will not be fully used without a change to the API so you will not be able to hit the true potential of the RT Cores.


    Seems like OptiX is not currently fully utilizing RTX, but they are working on it.
    Also Bakery uses 5.0.1. I'm going to update it to 5.1 (latest) and we'll see if it makes any difference.
     
  50. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493