Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Bakery - GPU Lightmapper [RELEASING SOON]

Discussion in 'Assets and Asset Store' started by Mr-F, Jun 14, 2018.

  1. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Hi everyone!
    I'm really excited to announce that I'm going to release the GPU lightmapper I was working on (for quite some time) on the asset store :)
    It's called Bakery. Because why not.
    My aim is to create a production-ready, hassle-free, flexible solution that I would like to use myself. I was rendering lightmaps all my life - in 3dsmax default scanline, in Vray, in Beast, in Enlighten and so on, and I never was fully satisfied with the results and flexibility.
    Or maybe reinventing the wheel is just my hobby.

    The focus of the project is:
    - Getting rid of all baking artifacts (seams, leaks, noise...).
    - Baking very customized lightmaps and mixing/switching them at runtime (e.g. any combination of direct/indirect/shadowmask/RNM/etc).
    - Getting physically accurate results. For that purpose I carefully compared it against Mitsuba using it as reference (fun fact: Unity's default light falloff is fake and not physically correct).
    - Getting maximum baking speed without going noticeably fake.

    The focus of the project is NOT:
    - Any kind of real-time GI. I'll leave it to others.

    Anyway, here is the list of features already implemented:
    - Global illumination.
    - Light sources: directional, sky (color and HDRI), mesh (any shape and texture), IES, spot (any cookie texture), point.
    - Materials: supports albedo, opacity and emission textures/colors.
    - Baking direct/indirect/mixed lighting.
    - Denoising, based on Nvidia's amazing AI Denoiser.
    - Automatic fixing of UV seams on smooth surfaces and various lighting leaks.
    - "Render selected" button, as well as only re-baking certain lights.
    - Baking Light Probes.
    - Automatic atlas packing + UV padding adjustment.
    - Bicubic lightmap filtering shader (can be patched to all default/custom shaders).
    - 2 lighting falloff modes: Unity-like and a realistic inverse-squared one. Also ability to patch default shaders to make Unity use inverse-square.
    - Mesh and terrain support.

    Workflow is already pretty smooth - you just add Bakery light components to lights, mark stuff Static as usual, and hit Render.
    As for baking speed, it's already quite faster than Enlighten and Progressive (at least in 5.6 and on GTX1060).

    Features to come soon:
    - LOD support.
    - Directional lightmaps support (bump, specular).
    - Shadowmask support.
    - Runtime switchable/blendable lightmaps support.

    Currently it only works on Nvidia (GeForce 6xx or newer) / Windows though, because it's based on OptiX/CUDA/D3D11 code. If there will be demand, I'll look into widening the platform support.
    Another problem is video memory usage. Current GI solution can eat too much memory, and I'm going to do something about it. Having more than 2 GB VRAM is advised (but not required, it works on 1 GB with smaller scenes).

    What I'm doing right now:
    - doing a closed beta test with some people.
    - fixing bugs.
    - looking into implementing LODs.

    It will be released this month. Before that I'm going to just post updates and pics. I'm also interested in what you guys think about this kind of project, what you were missing in built-in lightmappers, and what you'd like to see :)

    - fdlm.jpg ftareafixed.jpg ftprobes.jpg texarea.jpg image_2018-06-06_00-18-19.jpg
     
    Last edited: Jun 16, 2018
  2. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    IES lights example:

    fties.jpg
     
    Mark_01 likes this.
  3. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    219
    Wow. Can't wait to use it!
    Great work !

    There is the possibility to join the beta?
     
    Mr-F and sjm-tech like this.
  4. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    979
    "Render selected" button, as well as only re-baking certain lights."
    Yes please!

    Can´t wait for it!
     
    Last edited: Jun 14, 2018
    Mr-F likes this.
  5. eobet

    eobet

    Joined:
    May 2, 2014
    Posts:
    143
    Both my current projects use realt-time GI for now, and we do the same at work, but I'm willing to test most things at work so we'll most likely be purchasing this, because it looks great!

    My main question is, how is one person able to do what several large corporations have failed to? Are you a genius? :)
     
    Mr-F, ArchVizPRO and Cascho01 like this.
  6. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    205
    Fantastic idea, count me as a sale!!!
     
    Mr-F likes this.
  7. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Thanks everyone!

    Well, it's almost done. I'm thinking of releasing the beta for a cheaper price (think early access) and then improving it over time with final version being more expensive.

    I should mention that at the moment it doesn't render exactly only selected objects. It renders texture atlases to which selected objects belong. But other atlases are not updated.
    Also I didn't mention, but I have a special component to manually put objects into their own named lightmaps, if automatic atlases don't suit you or when you want to switch lightmaps on certain objects. When you actually use it, current Render Selected is more useful.
    I will eventually update this feature to only update parts of atlases.

    Also, other limitations of the current version (which I'm going to fix though):
    - //No Terrain support yet. [EDIT: terrain support was implemented]
    - No SpeedTree support yet.
    - No customized shader albedo/alpha/emission support yet. Color/alpha/emission are taken directly from material's colors/textures (using the same naming convention Standard shader uses).

    Too much free time.
     
    Last edited: Jun 15, 2018
    Cascho01 and Mark_01 like this.
  8. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    979
    Great!
    (Never understood why Unity didn´t so...)
     
  9. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    By the way, here is the current state of UI:
     

    Attached Files:

    Mark_01 likes this.
  10. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Terrain support was easier than I thought, finished in a day :)
     

    Attached Files:

    Mark_01, Neviah and roykoma like this.
  11. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    585
    hello,
    Can support with asset bundle?
     
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,570
    nice! can't use it yet as I'm on a mac, but watching where this goes! very well done!
     
    Mr-F likes this.
  13. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Good point, didn't test that yet. Will see if it works.
     
    Mark_01 likes this.
  14. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    295
    And its compatible with U5.6, i guess :)
     
  15. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    585
    Thanks
     
  16. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Yes. I'm working on 5.6 myself. Also testing it on latest 2018.
     
    Mark_01 likes this.
  17. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    205
    I think a fair amount might end up with the 2017.4 LTS versions too.

    For sure if you can make it work with 5.6 2017 and 2018 obviously the best :)

    I don't have the numbers but i would assume the majority are 2017.4

    Am very excited about this! I have a feeling this can make you lots of $$$!
     
    Neviah and Mr-F like this.
  18. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Here are some pics of the automatic UV seam fixer results:


    uvfix.jpg uvfix2.jpg photo_2018-06-11_14-12-56.jpg
     
  19. hugopok

    hugopok

    Joined:
    Mar 30, 2016
    Posts:
    28
    Hi, I am working on a game where a house is generated at runtime, and I was look for something like this to bake my scene and improve the performance. If you need a tester or any kind of help, please contact me. I will be very happy to contribute to your project
     
  20. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    Hi hugopok. If it's generated at runtime, high quality lightmapping won't work. It still takes from a few seconds to several minutes to bake a scene (depending on complexity), and my particular solution also requires specific Nvidia hardware. So it's not really a good idea to run it on a player's machine, it's more about using it by devs for static maps.
     
    Mark_01 likes this.
  21. hugopok

    hugopok

    Joined:
    Mar 30, 2016
    Posts:
    28
    O
    Ok i understand , thank you for your reply. I Will search There is a runtime lightmapper or maybe a Will create myself , anyway thank you for your time :)
     
  22. Mr-F

    Mr-F

    Joined:
    May 13, 2013
    Posts:
    32
    If you don't need global illumination, it's certainly possible to create a runtime lightmapper with decent speed (done that - created this a few years ago). All you need is to basically rasterize the geometry using UVs as position and calculate lighting in the pixel shader.
     
    Mark_01 likes this.
  23. mycroftx

    mycroftx

    Joined:
    Aug 11, 2012
    Posts:
    4
    Oh count me in! As soon as "early access" is ready i want to support you. Even for prototype work this will shed hours of some projects I bet.
     
    Last edited: Jun 19, 2018 at 11:29 AM
    Mr-F likes this.