Search Unity

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

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

  1. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    737
    Hi,
    What could be a cause of getting pink shadows like that?
    All the materials in the scene are based on standard built-in shader.
    The pink color disappears only in ambient occlusion only mode.
    Zrzut ekranu 2021-09-24 094214.jpg
     
  2. Luvrael

    Luvrael

    Joined:
    Sep 9, 2017
    Posts:
    20
    Hi,
    Your documentation doesn't describe in detail how the shader tweak> bicubic interpolation for lightmaps works. Does enable this option change the lightmaps themselves or Unity interprets the lightmaps in another way? Enable this option causes one of the shaders to issue an error and is purple, without this option it works normally.
    upload_2021-9-24_19-37-43.png

    Bake scene with render mode set to shadowmask is the most optimal solution, true?
    Is it possible for characters (not static objects) to get shadows and cast shadows after baking with the shadowmask option? (the distance shadwomask option is not the optimal solution). Setup "Light probe mode" on L1 option does not help me. With the Unity lightmapper, you can achieve this effect with light probes. I'd like to get a similar one with your asset. How can I do that?
     
  3. andreyefimov2010

    andreyefimov2010

    Joined:
    Oct 29, 2017
    Posts:
    41
    Not sure if it's been reported but when using Physically-based Sky in HDRP 12.0.0 (2021.2.0b8) the sky is black after baking:
    upload_2021-9-25_15-19-28.png
     
    guycalledfrank likes this.
  4. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    68
    Hi there, I'm really confused on how to get the HDRP shaders working. I have read the documentation but it doesn't explain/specify what shaders to use on the HDRP, it only says to use the ones found in the HDRPpackage. However, after trying them on the sample scenes, none of them are showing the lightmaps. Why is this happening? here are some screenshots of the weird behavior
    upload_2021-9-28_2-55-30.png
     
  5. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    68
    Here's how it should look. Sorry for the double comment
    upload_2021-9-28_2-56-44.png
     
  6. orzech123

    orzech123

    Joined:
    Mar 12, 2018
    Posts:
    9
    I am wondering if there is template scene available like all example scenes with sponza, shadowmask etc. with properly setup URP >=11, Unity 2021.x and realtime shadows from point lights and spotlights, mixed properly with Bakery lightmaps?
     
  7. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,273
    Try to set the sunlight mode to mixed.
    I experienced some issues with HDRP, too.
    Pretty sure this great asset needs some more investigation in HDRP.
     
  8. JamesSpenderIII

    JamesSpenderIII

    Joined:
    Sep 28, 2021
    Posts:
    3
    Hello,

    I'm trying to use Bakery's volume system for the first time, but I'm getting weird 3D noise when moving an object through space :



    This is using Bakery's latest Github version, with HDRP and Unity 2020.3.

    I wonder whether it's some setting that is not set right on my end or just a bug... I'm not compressing or denoising the volumes.

    Have a nice day,

    J.S.

    Edit : On an unrelated note, I can't use optix 7 denoising, as I get this error : "denoiser72 error : Unknown error (1)" (RTX 2060 with latets drivers), so I have to use Open Image Denoise which results in colored dots
     
    Last edited: Sep 28, 2021
  9. JamesSpenderIII

    JamesSpenderIII

    Joined:
    Sep 28, 2021
    Posts:
    3
    You have an exposure problem here, probably because HDRP does not use the same light scale as the other pipelines, you are only seeing the reflection, and no diffuse lighting, which is probably why you can't see any lightmap. Make sure you have a proper sky volume, a strong enough directional light, and a post process volume with an exposure effect on it (try to tweak the settings).
     
    Last edited: Sep 28, 2021
    guycalledfrank likes this.
  10. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    16
    Hi. Is it expected for Dominant Direction to work like this? upload_2021-9-28_20-39-46.png
    Cubes have the same materials, the same distances.

    In complex casesthis is so annoying. The materials take on very strange colors.

    Dominant Direction:
    upload_2021-9-28_20-42-59.png

    Baked Normal Maps:
    upload_2021-9-28_20-45-36.png

    Is there any workaround? We are really need the baked specular, it looks really awesome. Cannot use SH due to performance reasons (mobile hardware, SRP Batcher issue).
     
  11. eguccccchi

    eguccccchi

    Joined:
    Aug 28, 2021
    Posts:
    2
    Hello.
    I rendered it in Bakery, but the lightmap gave unusual results.
    Just like the image, the lightmap looks like a striped pattern. issue.jpg

    I've tried a few, but it always happens when I enable Denoise.
    Is there a way to solve this?
     
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,479
    It can affect GI precision captured by volumes. So it makes sense to set lightmap resolution to be similar or higher than volume resolution.

    Shouldn't be a problem? Can you send me a project with this example scene (everything else can be stripped)? I'll check settings/versions, etc.

    Didn't test the beta. A few times in HDRP history they flipped the Meta Pass vertically, resulting in a similar problem. Can you check if
    - Opening ftUVGBufferGen.cs
    - Finding "bool isHDRP = "
    - Changing it to

    bool isHDRP = false;


    - Baking again

    helps?

    Yes. Apparently your world is just that big.
    Consider not lightmapping every object, e.g. using probes or real-time lighting for trees and possibly everything except for interiors. Real-time lighting usually does an OK job with exteriors but fails to provide decent interior GI.

    Hi, thanks :) What shader is that? Did you include BakeryMetaPass.cginc. It's weird if it caused this, as it doesn't declare unity_LightmapST on its own. Technically there is nothing preventing shaders with Bakery Meta Pass to be compatible with SRP batching.

    Should work. "Contribute GI" + "Cast shadows" is enough for Bakery to consider it a shadowcaster. "Receive GI" option is unused (scale in lightmap = 0 is used instead https://geom.io/bakery/wiki/index.p....2FGI_without_having_a_lightmap_on_its_own.3F )
    Maybe there is weird opacity map that makes it transparent? :confused:
     
    DonCornholio likes this.
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,479
    Based or using the exact standard shader?
    If your Skylight is not pink, it looks like your shaders look pink (shader error) when rendering Meta Pass. Are there any shader errors in console or when selecting shader assets? If you have RTPreview, it'll be super helpful to see how the scene looks there. You can also send me any small test scene as unitypackage or a project, and I'll debug it here.

    Yes. It patches some built-in CGIncludes from the editor folder (it backs up original files so they can be always reverted).

    Interesting. In post-2017 Unity versions this issue can be avoided with slightly different code, but I didn't do it for the sake of backwards compatibility. Try replacing UnityEditorFolder/Data/CGIncludes/ftrace.cginc with the attached version, and your shader will likely compile OK.
    Basically the problem is using samplerunity_Lightmap, as if compiler decides your shader doesn't actually use the lightmap, it will remove the lightmap-related code; and then Unity will also unset the sampler and break the shader. Newer Unity versions allow defining custom SamplerStates within the shader, and this issue can be avoided by using a custom lightmap-independent sampler.

    Enable Occlusion Probes: https://geom.io/bakery/wiki/index.php?title=Manual#Occlusion_probes

    Alternatively, if you can use Volumes instead of light probes, and if you're on the Standard (or custom) pipeline, you can get even more detailed shadowing on dynamic objects using shaders supporting Volume shadowmask:

    upload_2021-9-29_0-11-36.png

    OK, for now I'll just hope it's gonna be fixed when it comes out of beta...

    It looks like you're using default (very bright) HDRI sky intensity?
    https://geom.io/bakery/wiki/index.php?title=Manual#Notes_on_HDRP.2FURP

    I don't have it at the moment.

    It'll be easier to understand what's going on by visualizing the volume on a large plane instead of the small sphere. This way you can see if the volume matches the scene.

    Weird. Can you check what .denoiserlog.txt says after it happens?

    No.
    Can't repro this with default materials:

    upload_2021-9-29_0-24-36.png

    Looks OK on URP too:

    upload_2021-9-29_0-29-34.png

    What is your pipeline/shaders? Possibly it expects different sRGB flags on the direction map? Possibly you have some asset postprocessor script that changes the flag? You can try toggling it on the baked directional map assets and see if it helps.

    Caused by this:





    You can:
    a) Update via the patcher (there is a workaround): https://geom.io/bakery/wiki/index.php?title=Github_access
    b) Use an older driver without the bug (at least 460.79 was definitely OK)
    c) Wait for the fixed driver
    (Option A is currently the best one IMHO)

    This bug only affects OptiX 6 and 7 when denoising lightmaps with 4096x4096 or larger size, using particular drivers. My workaround just currently splits them into 2048x2048 chunks.
     

    Attached Files:

  14. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    68
    upload_2021-9-28_23-33-20.png

    Hi! sorry no, Actually I disabled the HDRI almost completely and no luck. What I noticed is that the point lights aren't working at all. There should be a point light there but the light maps are not picking it. Any idea of why this could be happening (it's HDRP)
     
  15. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    16
    I found the clue: it can be reproduced only on android platform. On PC platform everything is ok.
     
  16. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,273
    Looks cool! ;)
    I had the same, switched denoiser to "Open image denoise" and it was gone
     
  17. eguccccchi

    eguccccchi

    Joined:
    Aug 28, 2021
    Posts:
    2
    thank you!
    I was able to resolve this issue by downgrading the NVIDIA GameReady Driver from 472.12 to 461.72.

    Thanks to guycalledfrank and Cascho01 for other solutions!
     
    guycalledfrank likes this.
  18. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    93
    Okay, I set a bunch of exterior objects with light probes instead of lightmaps, and the lightmaps were reduced to 220. Something is something.

    Now if I combine enlighten (real-time lighting) with bakery it will take maybe 12 hours to bake
     
  19. DudoTheStampede

    DudoTheStampede

    Joined:
    Mar 16, 2015
    Posts:
    58
    Hi,

    I have a problem when baking different scene with shared prefabs.

    I'll try to explain: I have 3 scenes with a shared (nested) prefab. I load one scene at a time at runtime.
    When I Render a scene, everything goes fine. Then I unload that scene (in Editor), load the second one and Render the second one. When I switch back to the first one, all the dynamic meshes (the one without "Contribute GI") have the same colors they have in the second scene. How can I fix that? :/

    Another thing: I have the project on GIT and I work from different computers. When I Render from a computer and I push all of that, the lighting is broken in the second computer! How can I manage to preserve all the lighting between computers?

    One thing I noticed, when looking in the "Lighting" tab in Unity, is that when I switch from different scene I see in the previews of the maps a mixed from the different scenes.

    Thanks in advance, I hope someone can help me! ^_^
     
  20. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    68
    Hi, further elaborating on my question, here's a screenshot of my settings and proof that the previewer is seeing the light. However, after baking, the light is not visible at all (I'll drop the baked version in a second comment). What I'm I doing wrong? This is the latest tested unity according to the documentation of bakery
    upload_2021-9-29_6-0-55.png
     
  21. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    68
    Here as you can see, after bake everything becomes super dark and I can't see anything. I've already tried reducing the exposure and the HDRI but no luck
    upload_2021-9-29_6-12-40.png
     
  22. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    16
    Looks like it was affected by Lightmap Encoding property or some cache(?), after tweaking it to different values and return it back i cannot reproduce the issue. But i found a new one: on PC platform Dominant Direction with URPDirSpec shader graph looks oversaturated. On Android it looks normal. I created a fresh URP project (unity version 2020.3.16f) to reproduce the issue.

    SH:
    upload_2021-9-29_18-53-40.png

    Dominant Direction:
    upload_2021-9-29_18-54-45.png

    Baked Normal Maps:
    upload_2021-9-29_18-55-43.png
     
  23. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    16
    Scene on Android:
    upload_2021-9-29_19-12-40.png

    Same scene on PC (switch platform & re-bake with same settings):
    upload_2021-9-29_19-14-21.png

    Material example:
    upload_2021-9-29_19-15-22.png

    Unity 2020.3.16f, Bakery 1.9 (latest from store)
     

    Attached Files:

  24. JamesSpenderIII

    JamesSpenderIII

    Joined:
    Sep 28, 2021
    Posts:
    3
    Thank you for the answer !
    Here is what the volume looks like on a big plane.


    As you can see, super noisy. I tried deactivating denoising, and it seems the issue is not with the volumes, but with the entire bake, although denoising hides most of it :



    I'm using a pretty reasonable 14 texels per unit, 64 samples, 5 bounces... Baking indirect only, with a simple skylight

    On the other issue, I can't seem to find the denoiserlog file, where is it located ?

    Thank you

    EDIT : I just tried tweaking the sample count and bounce amount, and it changes absolutely nothing on the result, so I feel like some of the settings on the bakery window are somehow ignored, it's very strange...
     
    Last edited: Sep 29, 2021
  25. TheLLspectre

    TheLLspectre

    Joined:
    Nov 12, 2016
    Posts:
    1
    Hi everyone !

    May be is such a classic error, but I'm stuck with this one ! I just want to start a bake to test for the first time Bakery...

    This terrible error appear and I don't understand why ?
    I update the driver of my graphical card. I'm on Windows 10, I've a 1060 Geforce GTX from Nvidia so....
    I patch Bakery too...

    upload_2021-9-30_17-29-6.png

    When I launched the utility to detect optimal setting. This one appear.

    upload_2021-9-30_17-30-13.png

    Did you have this ? One time by the past.
    I also tried to check the setting panel from the nvidia card.
     
  26. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    93
    Bug? If I set Receive Global Illumination to Light Probes, it will still bake a lightmap for the object.
     
  27. Forstech

    Forstech

    Joined:
    Jul 5, 2016
    Posts:
    1
    First of all thanks for this great lightmapper, works very well on my Windows PC.

    I have one question:
    Would it be possible in the near future to use Bakery on my Macbook client and bake over network with my Windows PC?
     
    guycalledfrank likes this.
  28. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    377
    upload_2021-10-1_15-23-53.png

    So for some reason, having a area light as part of a prefab breaks the area light and makes it a black rectangle ?

    I get a lot of really bizarre results.

    upload_2021-10-1_15-27-36.png

    Here I duplicated the area light in the window, applied it to the prefab causing the black rectangle.

    Then I decided to move that area light and check rtpreview again.

    Now i have the black rectangle, and an area light... This is very bizarre. I don't know if it's affecting my rendering.

    As an additional note.

    upload_2021-10-1_15-29-31.png

    The issue of -1 x-axis scale is also still a problem. I remember this being fixed?

    This should be the latest version, i used the patcher.
     
    Last edited: Oct 1, 2021
  29. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    anybody have an issue with reflection probes baking out completely black exrs? not sure whats going on, I have the clipping distance set, layers masks set, objects set to static. Nothing, always black.
     
  30. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    93
    Is it safe to erase the ftracelog.txt? I have some source control issues with that file
     
  31. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,477
    Afaik it just logs what went on during baking and can be useful when troubleshooting errors.
    You could exclude it via .gitignore.
    .
     
    matiasges likes this.
  32. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    62
    @guycalledfrank
    Hey there ! Regarding setting lightmap scale to 0 for receiving lightprobes, that basically works thx! But it seems to produce bugs when using that with bakery meta pass. Things get stripy, artifacty:
    upload_2021-10-5_4-53-46.png
    This is how it looks with lightmap scale set to > 0.0
    upload_2021-10-5_4-54-9.png
    Is that just a limitation of Bakery Meta Pass ?
    Regarding my other Question:
    I use additional stuff in my bakery meta pass, like a texture for noise and float for adjustments (i disabled those for testing in my first question). I declared those as properties but don't add them to my input.hlsl CBUFFER, because i dont need them for runtime. Also as far as i understand it the Bakery Meta Pass still uses cglab which seems incompatible with hlsl from SRP. And then unity tells me for example Material Property is found in another cbuffer than UnityPerMaterial (_BakeryMetaNoiseScale) and SRP Batcher = not compatible. Is there a way around that? I can just disable the Bakery Meta Pass in the shader for release build, but it's a minor inconvenience.
     

    Attached Files:

  33. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    14
    Hello everyone, Mr. F is sick Is sick and in a hospital, currently unable to reply to forum and Discord posts. He will answer your questions as soon as he gets back to normal.
     
    guycalledfrank likes this.
  34. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    62
    Oh that's really sad to hear ! I hope he gets well soon ! Best Wishes <3
     
    guycalledfrank likes this.
  35. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    820
    Get well soon. Gute Besserung.
     
    guycalledfrank likes this.
  36. doodlinbee

    doodlinbee

    Joined:
    Feb 15, 2020
    Posts:
    9
    I press bake then when the progress is at 100% it says "finished rendering" and just freeze, what to do ?
     
  37. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,477
    What does the fo log say? (
    Editor > x64 > Bakery > .ftracelog.txt
    )
    Does it show any error message?

    .
     
  38. doodlinbee

    doodlinbee

    Joined:
    Feb 15, 2020
    Posts:
    9
    I assume by
    Editor > x64 > Bakery > .ftracelog.txt
    you mean
    AppData\Local\Unity\Editor

    but I don't have a x64 folder in there
     
  39. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,477
  40. doodlinbee

    doodlinbee

    Joined:
    Feb 15, 2020
    Posts:
    9
    there doesnt seem to be any errors, I seem to run out of memory though but its just a guess
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,160
    Get well soon, Mr. F
     
    guycalledfrank likes this.
  42. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,477
    ^ From me, too. Get well soon :(
     
    guycalledfrank likes this.
  43. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    18
    Heyo, Frank!. I am getting this weird baking error on these pillars and fireplaces. Any ideas? Increasing the Tile Size doesn't seem to do anything.
    upload_2021-10-11_14-33-50.png

    upload_2021-10-11_14-33-30.png

    upload_2021-10-11_14-32-32.png
     
  44. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    im getting these horrible artifacts/ colored patches..ive attached screenshots of the renders and my settings...tried different things still doesnt seem to get rid of them...whats wierd is the preview app actually shows it clean...using rtx mode...all meshes have unity uv lightmapping ON...any thoughts appreciate!!
     

    Attached Files:

    Last edited: Oct 13, 2021
  45. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,477
    Look like compression artifacts. What if you set
    Compression
    to
    None
    on your lightmaps? Do these colored patches go away?
    .
     
    guycalledfrank likes this.
  46. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    167
    Get well soon!
     
    guycalledfrank likes this.
  47. feiyang1

    feiyang1

    Joined:
    Nov 10, 2018
    Posts:
    2
    Hello, I have met the same problem. Have you solved it?
     
  48. feiyang1

    feiyang1

    Joined:
    Nov 10, 2018
    Posts:
    2
    Get well soon
     
    guycalledfrank likes this.
  49. karstinpk

    karstinpk

    Joined:
    Apr 1, 2018
    Posts:
    1
    Using Post-packing option causes errors with LOD grouped objects in a scene where baking Shadowmask with just a Direct Light that has the "Indirect and Shadowmask" Baked Contribution option. I am using a GTX 1080 with no RTX. Here is the sequence of errors.
     

    Attached Files:

    Last edited: Oct 15, 2021
  50. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    where would you access the compression features for the lightmap if your not using unity light baking compression..that is unchecked but that shouldn't matter right...i dont see any compression settings..could it be the denoise?
     
unityunity