Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    it got past that first step after like 30 minutes it said like 500 something lightmaps ( at that window where you have to press continue or cancel ). is that normal ?
    the next step where it says like "exporting scene - finishing objects" I left on for like an hour and then the microsoft c++ runtime crashed along with unity.

    maybe i should try running a mesh combiner on my scene first to reduce the number of meshes or something?
     
    Last edited: Jan 2, 2021
  2. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    looks like at least the realtime preview worked super fast after i ran a mesh combiner on my scene, i guess thats what I needed to do.
     
  3. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Seems like you should reduce texels per unit. Generating 500 lightmaps is kinda extreme. Mesh count is not the problem here.
     
  4. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    Could you add an option to disable this confirmation dialog so that it would render without asking this.

    upload_2021-1-3_12-25-50.png
     
  5. NemesisWarlock

    NemesisWarlock

    Joined:
    Jan 21, 2017
    Posts:
    140
    So, I just got Bakery, but it seems to be having trouble rendering terrains in RTX mode?

    Running on a 2070 Super, so I've got RTX capability here.

    With Terrain optimization enabled, bakery just errors out and says "Terrinas not supported in RTX mode".
    with it Disabled, it renders, but takes an *awfully* long time, and while other static meshes in the scene are lightmapped (and beautifully, I might add!), the Terrain ends up with super blobby black shadow blotches.

    Any tips for fixing some of these issues?

    EDIT: Ah, it was the terrain tree export... it's doing the tree GI, but the resolution is awfully low on them. Guess I should bump the texel size a touch.
     
    Last edited: Jan 3, 2021
    heartingNinja likes this.
  6. artician

    artician

    Joined:
    Nov 27, 2009
    Posts:
    345
    Hello.
    I'm encountering this
    DllNotFoundException: simpleProgressBar
    error. I've seen the other posts in the thread. Info:
    Running Win7x64
    nVidia Geforce 980
    Unity 2019.4.17 (64 bit)
    And simpleProgressBar.dll is present in the project folders.

    I was able to bake before. This *may* have started with an update from 2019.4.15 to 2019.4.17, but I'm uncertain. Is x.4.17 supported?
    Is there anything else I may be missing? I don't know what version of Bakery I was on, but when I encountered this error this morning I immediately updated it to the latest version, but the same error still persists.

    Thank you for your support, and for the great tool.
     
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Most of the time it's not a good idea to attempt rendering this many lightmaps...
    I'd rather leave it, but if you're brave, you can remove this check in ftBuildGraphics.cs (look for "if (groupList.Count > 100").

    Hmmm how did you enable both RTX mode and Terrain Optimization at the same time? Clicking one option in the UI will disable the other. Or did you use "always RTX" option after the benchmark? Hmm...
    So yeah, the thing is, Terrain Optimization must be disabled in RTX mode. RTX only accelerates ray-triangle intersections, and as it's done fully in hardware, it can't be mixed with other algorithms. Terrain Optimization worked via custom intersection code, when triangles and heightmaps could be traced together. Terrains will work in RTX mode, but without that optimization, i.e. traced directly as triangles.

    Terrain trees themselves are never lightmapped, Unity can't even apply lightmaps to them. This option will make them cast shadows and bounce GI around though, but they need light probes or volumes to light themselves.

    2019.4 is tested and not a problem. DllNotFoundException happens either on an unsupported platform (not your case) or if the file is actually not found (... also not your case?). I'm not sure what else could trigger that. Maybe it's in some weird folder? Worth trying with a fresh project, maybe you'll notice some differences.
     
  8. Jochen_Winkler_at_Flavia

    Jochen_Winkler_at_Flavia

    Joined:
    Sep 13, 2019
    Posts:
    4
    I am having the same problem this person did have years ago: When I want to render the lightmap, I get

    DllNotFoundException: simpleProgressBar
    ftRenderLightmap.ProgressBarEnd (System.Boolean freeAreas) (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1159)

    The answer suggests that the dll was not imported.
    The dll is there, though. In Assets/Editor/x64/Bakery/simpleProgressBar.dll

    This is a fresh project, with Bakery freshly imported. Unity 2019.3.0f6 on Ubuntu.
    I did try to reimport Bakery. I also did try starting with a fresh project.
     
  9. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Bakery only supports Windows though (can't load a native Windows DLL in Ubuntu):

    upload_2021-1-4_18-9-42.png

    I can give you a refund if you want :confused:
     
  10. Jochen_Winkler_at_Flavia

    Jochen_Winkler_at_Flavia

    Joined:
    Sep 13, 2019
    Posts:
    4
    Aahh.... Thank you for the offer. I might try on a different machine, then.
     
    guycalledfrank likes this.
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    BTW, can you try installing VC Redist 2015? It's the only dependency simpleProgressBar.dll has, but if it's not present in the system, it can fail. These redistributables are installed along with lots of programs, so it's rare not to have them, but...
    https://www.microsoft.com/en-us/download/details.aspx?id=48145
     
  12. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    For clarification, do you mean that it's best to use multiple scenes for rendering so that the lightmap count does not exceed 100 per scene or is it best to not have that many lightmaps (over 100) in a game?
     
  13. artician

    artician

    Joined:
    Nov 27, 2009
    Posts:
    345
    Hi, thank you for your replies.
    I have VCRedist 2015-2019 installed.
    Does Bakery require any runtime assets in the project itself?
    This project is being developed on Windows, but some engineers are on Mac. The build platform is set to Windows x64. The issues I'm reporting are limited to my work in Windows, but the engineers are wondering if it's not possible to use the lightmaps after they're baked. Maybe there's something residual that's causing the issues?
     
  14. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    first off let me say so far your plug in is pretty damn solid. :) so far simple, but good solid feature set. However I think with this particular project I am a part of I think perhaps my lack of understanding of this plug in has caused issues with the results I got after lightmapping. Take a look at my scene images I put up and let me know what the issue could be. As you will see in the images that the LOD2 (made by amplify impostors) is a off color than the closer LOD0 and LOD1 . How do i counter that? where the colors are all the same? is there a setting I am missing? thank you for any assistance you can provide.
     

    Attached Files:

    Last edited: Jan 5, 2021
    guycalledfrank likes this.
  15. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    210
    I have a RTX 1060 and a RX 6800. I connect my display in the Radeon, as it's the fastest one. My question is: will I be able to use the NVidia card with Bakery? Or does it need the NVidia to be the main/display card (which unity is running)?
     
  16. vlery

    vlery

    Joined:
    Jan 23, 2017
    Posts:
    16
    Another issue is about the hdr range of lightmap. I assume it might be [0,2] (in gamma space) based on my tests. If it designed to work with the Unity's Lightmap texture type, encode and decode algorithm, I think it could support [0,5] range. Is there anyway I could config the max hdr value, because I may want to use custom encoding and decoding.
     
    Last edited: Jan 5, 2021
  17. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    118
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    For the runtime part, the only necessary bits are these scripts: https://geom.io/bakery/wiki/index.p..._who_doesn.E2.80.99t_have_Bakery_installed.3F
    They are platform-independent. Project should be usable on a Mac.

    Hmm not sure I can see any difference on your screenshots. Where should I look? Could it be related to the impostor system, does it happen with non-impostor LODs?

    Pretty sure it should work. And if doesn't, PM me, I'll fix it up. Never had to deal with such setup in practice, but can't see any reason for it not to work.

    Default range is 0-1024 (I found higher values to mess up BC6H compression). 0-2 (DoubleLDR) is what Unity compresses your lightmaps into if you're on Android/iOS platform and not using "High quality lightmaps" option in player settings and/or not using ASTC:

    https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good

    When tweaked correctly, you should be able to force Unity to use RGBM encoding (0-34.5) on mobile:
    https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html

    Random guess: it needs directional light's shadowmap and you baked your sun in "full lighting", thus getting rid of the shadowmap? Does it work with Indirect mode (so shadows are still realtime)?
     
  19. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    i want to have both the dynamic and static shadows in my scene,for this i use the "shadowmask" render mode,my static objects are still casting the dynamic shadows they don't have any static shadow.All shadows are dynamic.What i am doing wrong here what will be the proper approach to have both the static shadows for static objects and dynamic shadows for dynamic object like player
     
  20. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
  21. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    guycalledfrank likes this.
  22. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    Hmm not sure I can see any difference on your screenshots. Where should I look? Could it be related to the impostor system, does it happen with non-impostor LODs?







    if you look at one of the screen shots you will notice that a set of rocks that are darker than the surrounding rocks, this is the LOD2 which is the impostor object. Seems limited to just the impostor. the other LOD0 and LOD1 seems normal.

    also i noticed that my lightmapping is not showing up on my terrain i just see the real time shadows but as i pull away it doesn't show on objects.

    ** NM I solved the lightmapping issue finally lol
     
    Last edited: Jan 5, 2021
    guycalledfrank likes this.
  23. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
  24. Krt1

    Krt1

    Joined:
    Nov 25, 2017
    Posts:
    4
    Hi Frank, I tried the BakeryURPSHGraph_Subtractive.shadergraph shader that you shared with me a month ago and thank you :) , that solved my shadow problem.
    Since then, I have a new issue and it may be due to a Bakery Volume limitation. Does Bakery Volume include a system such as occlusion probes so that dynamic elements located in a shadow area are not illuminated by direct light? Is there a workaround?

    For now, Bakery Volume solves a big lighting problem for me because I want to store light information in a prefab, all I need is the occlusion ;)

    For information, I use:
    - URP
    - Bakery in subtractive mode
    - Shader Graphs / BakeryURPSHGraph_Subtractive (for static elements)
    - Shader Graphs / BakeryURPSHVolumeGraph (for non-static elements)

    ... and happy New Year ! ;)
     
    guycalledfrank likes this.
  25. MorpheusXI

    MorpheusXI

    Joined:
    Jan 18, 2018
    Posts:
    71
    Hi

    While since I last used Bakery. I have Nvidia 750 TI, Win10, Unity 2019.4 13f1, GPU Driver Game Ready 460.89. Bakery does check for RTX & None RTX and fails at both, I know it's not RTX so should it not run in none RTX mode. Also I'm not using URP or HDRP so assume I'm on Builtin Pipeline. Project settings Builtin Shader settings are all set as Built in shader. I was testing on some Asset store Archviz projects and created new project with just bakery and tested against rendering the example directional.

    Is this a bug or something I could be doing that's causing this?

    Actually this is a relatively new PC build and I've not installed Visual Studio so is their some runtime that Bakery relies on that may get installed by VS?

    Regards

    Morpheus
     
  26. SJones88

    SJones88

    Joined:
    May 22, 2017
    Posts:
    5
    Hoping someone can help out here, got bakery a few days ago in the winter sale and coming to use it for the first time now so sorry if this already covered but I cant see anything at the moment regarding this issue (might not be bakery but..)

    I first noticed an issue with emmisive textures and my scene compared to the bakery RT preview window, I noticed that some emissive textures are not being shown in the preview and then on some that do the UV seems to be messed up? only a couple of emissive textures in the scene looks like it works as expected at this point.

    When I have gone to investiage the issues - when selecting the emmisive texture in the editor I do get an error with that texture
    Code (CSharp):
    1. InvalidCastException: Specified cast is not valid.
    2. UnityEditor.TextureImporterInspector.get_textureInspector () (at <0819ea64cba74211b5eefff12d8a617a>:0)
    3. UnityEditor.TextureImporterInspector.DrawPreview (UnityEngine.Rect previewArea) (at <0819ea64cba74211b5eefff12d8a617a>:0)
    4. UnityEditor.PropertyEditor.DrawPreviewAndLabels () (at <0819ea64cba74211b5eefff12d8a617a>:0)
    5. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    while this in itself doesnt seem to reference bakery at all, I did find just 1 google result with a similar - a bug report to unity with regards to applying texture settings in editor. https://issuetracker.unity3d.com/is...changed-if-changes-are-applied-through-popups

    My question does anyone know what might be going on here and is bakery trying to apply texture settings causing a similar issue in unity

    The project has recently been updated to unity2021.1 beta as I was having issues in an older version - I understand that bakery might not support this version fully so any info/help would be great

    Please see attached picture, left is bakery preview, middle is unity editor that bakery is from, right is an old version before bakery (no other scene changes have been made)
    bakery.jpg
     
  27. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Man my preview is still not working... 5 months later...


    https://gyazo.com/bc65e56fddc6b2360e86b717042f55cd



    https://gyazo.com/1d73bfdd6546af1594aff91cc8931db2


    https://gyazo.com/2c85819d4e25aa2191bd396441c04f66



    https://gyazo.com/0c30df97a933e633f9d529473f252316



    https://gyazo.com/1f3bcd26e0385cb08de976a9eb46071f



    https://gyazo.com/f0cabd9e71cfea0061a887ab87ac04de



    https://gyazo.com/7a79a8792f3d0c960c40171283473719




    https://gyazo.com/784bc6e24388154f355f470643111d0d


    I get errors if i try to bake multiple scenes aswel, or just opening the checker on 2 scenes at once

    https://gyazo.com/c0ca1c5e7a62a58f45c740056614d28b


    I just updated to 1.8


    edit: i found a workaround to this tho, if i open scenes one at a time, show checker, hide checker, then open them together and show checker it will not get errors and also preview will work. Not sure if that's how it shoul;d work but im good for now, thanks
     
    Last edited: Jan 13, 2021
    URPian and guycalledfrank like this.
  28. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    I got this error about channels. How do I find the spotlight which is causing this error?

    Light Spotlight can't generate shadow mask (out of channels).
    UnityEngine.Debug:LogWarning (object)
    ftRenderLightmap:SetupLightShadowmaskUsingBitmask (UnityEngine.Light,int,int,int[]) (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4273)
    ftRenderLightmap/<RenderLightmapFunc>d__263:MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5302)
    ftRenderLightmap:RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4247)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()


    In Unity documentation https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html

    "If some lights overlap then Unity uses more channels. And, if a light does overlap while all four channels are already in use, that light falls back to fully baked."

    Shouldn't that spotlight get fully baked if there's not enought channels?
     
    Last edited: Jan 13, 2021
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Hmm what helped you in the end?

    Phew!

    BTW, I didn't add support for area light shadowmaks (since Unity didn't support them before). I guess now it makes sense to have them, as HDRP has pretty decent diffuse/specular arealight implementation.

    Yes, if you're in shadowmask mode, an additional shadowmask volume is baked, you can see it working in example_volumes_simple_shadowmask. However... shadowmask is not supported in URP, and I'm not sure how is it supposed to work in subtractive mode. There is only one "main" directional light in subtractive mode. I guess I can just make it bake a single-channel shadowmask volume and use it in the graph, if that's OK.

    You too! :)

    I think there is some problem with the benchmark itself. I heard some reports of it failing if you move Bakery folders around but didn't get any specific steps to reproduce it yet. Did you try baking in non-RTX mode, ignoring the benchmark? Does it bake?

    Emissives are reprojected to lightmap UVs, meaning that any UV1 problems will manifest as incorrectly placed emissives. Either the UVs are not suitable for lightmapping (overlapping; use "generate lightmap UVs" checkbox on assets if your didn't author custom UV1), or lightmap resolution is just too low comparing to the size of emissive parts in the texture.
    RTPreview "sees" the scene as the lightmapper, so it's a useful way to debug your UVs before baking.

    Hmmm... here it looks more or less correct, just larger than it should be; I guess the lightmap resolution is just kinda low, making the lamps rasterize into a bigger area while reprojecting.
    Given the lamps are also not very huge, rays will miss them often, resulting in noisy lightmaps. For objects like that (small, bright) I highly recommend using Light Meshes instead. If you can detach the emissive part into its own object (can be all lamps in the corridor as one object, or each lamp as a separate object, it doesn't matter) and use the Light Mesh component on it, it will generate precise area lighting. Emissives are mostly good for many tiny things with very low range (e.g. small LEDs) or huge things like lava pools. Light Meshes are good for primary lights with accurate shadows: https://geom.io/bakery/wiki/index.p...ces_between_Light_Mesh_and_emissive_materials

    Thank you for a very detailed error information, found the issue. Happened in a multi-scene setup that was not previously baked or where each scene wasn't opened separately before. Storage object was not initialized in these scenes. Fixed: https://github.com/guycalledfrank/bakery-csharp/commit/fc17cbf275928985d6d580a2185a7214370515bd
    (You can grab the fix from github: https://geom.io/bakery/wiki/index.php?title=Github_access)

    Kinda hard if they have identical names. "Spotlight" is the name of the gameobject in this case.

    Bakery explicitly warns you instead. I think it's important to make sure you're baking what you expect instead of silently removing masks from some lights. If you can give different names to lights, the log will be useful. If you can't, I think it is possible to automatically select them. You can try this:
    - Open ftRenderLightmap.cs
    - Find "can't generate shadow mask" (there are two instances)
    - After the logging line, add:
            var arr = new GameObject[1];
    arr[0] = light.gameObject; // one instance is "light", another is "ulht"
    Selection.objects = arr;


    This way the exact logged light (last one) will be selected. Will add it to my script if it's useful...
     
    swantonb likes this.
  30. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    Thanks. There aren’t too many spotlights yet, so I decided to rename them and found the culprit, but I think the script would help, so I like the idea of adding it to Bakery.
     
    guycalledfrank likes this.
  31. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    well kind of stuck right now



    i replaced whole bakery with the last git bakery..ill revert it to the unity asset store for now

    edit: nvm i reverted easily to the old files from collab, take your time :D

    edit2: i also have a question, how can the texels can be controlled per object? can they? i get lots of texels in planes and in objects that actually need more texels they are very big. Is there something that im not aware of?

    edit3: hmmm i see that it works if i added those lines in the ftbuildgraphics.cs, im confused a bit, downloading the whole bakery again and overriding it didnt work but why? wasnt the fix present there?
     
    Last edited: Jan 15, 2021
  32. Jaxxtrend

    Jaxxtrend

    Joined:
    Aug 13, 2017
    Posts:
    5
    Hi. I have trouble with dominant directional mode. Bleeding in directional normals map is not correct. Without noise removal artefact see like a repeated gradient bands.
     

    Attached Files:

  33. Jaxxtrend

    Jaxxtrend

    Joined:
    Aug 13, 2017
    Posts:
    5
    In Unity 2020.2.1f after baking in sh mode and project reload, volume texture detach from Bakery volume component. I assign them in debugmode and problem solved, but is it not correct.
    Can be important. Bakery volume component placed in prefab.
     
  34. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Updated from bakery-csharp, but didn't update from bakery-rtpreview-csharp?
    https://geom.io/bakery/wiki/index.php?title=Github_access
    RTPreview used to access debugTex for debug purposes, now it's deleted.

    Are you sure it is without the denoiser? Looks very denoiser-ish to me. Without it there is only edge dilation.

    Hmm, probably related. Prefab updates its values to the original? Works OK without the prefab?
     
  35. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    yeah edited the post, i got it to work by copying the lines separately, can you answer to this please?


     
  36. Jaxxtrend

    Jaxxtrend

    Joined:
    Aug 13, 2017
    Posts:
    5
    screenshot with denoising
     
  37. Jaxxtrend

    Jaxxtrend

    Joined:
    Aug 13, 2017
    Posts:
    5
    No tested
     
  38. cursedtoast

    cursedtoast

    Joined:
    Apr 27, 2018
    Posts:
    62
    Hi,
    This looks awesome. I'm about to buy but I was reading the documentation about the note about non-overlapping UV's.

    Currently, the asset pack I'm using seems to have a problem with this. I've been going through and adjusting them based on what it's telling me. Does Baker tell you when there's an overlap and refuses to run or should I just go through all of my assets and generate UVs on them to play it safe?

    It seems to be about 47 objects in total are reporting the problem using just about everything in the pack in a scene.

    Thanks!
     
    Last edited: Jan 15, 2021
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    You can use "scale in lightmap" per-renderer: https://geom.io/bakery/wiki/index.php?title=Manual#Texels_per_unit

    Did you try other denoisers, e.g. OpenImageDenoise?

    Lightmapped models usually have 2 sets of UVs, 0 (possibly overlapping) for material textures and 1 (non-overlapping) for lightmaps. Unity automatically generates non-overlapping UVs if you use "generate lightmap UVs" checkbox on the asset (but you can also pre-make more efficient non-overlapping UVs yourself). If UV1 is not present in the model and the checkbox is off, UV0 will be used, and it should be OK, if it's also non-overlapping.
    For incorrect UVs Bakery prints warnings to console, but doesn't stop by default; you can enable stopping with "UV validation" checkbox: https://geom.io/bakery/wiki/index.php?title=Manual#Warnings
     
    swantonb and cursedtoast like this.
  40. Jaxxtrend

    Jaxxtrend

    Joined:
    Aug 13, 2017
    Posts:
    5
    That problem not in denoising. I think problem in bleeding alghoritm for dir normal map
     
    Last edited: Jan 16, 2021
  41. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Another question, sorry, i dont seem to have the lightmaps in build, is this a common thing?

    edit: if anyone has this problem this is the fix


    https://gyazo.com/da736644f930578427cdbd3d46e71583

    In project settings>graphics make lightmap modes from auto to custom


    edit2: can you give me some tips for shadowmask mode? i have a bank scene if you remember and a lot of interior lights, i must have their range pretty big in order for them to touch the floor, but also it's on multiple levels so the point light that is on the floor 1 for example is going to overlap not only with the ones that are near it but also with the floor 2 ones, what should i do in order for it to bake correctly? is there any way i could increase the overlap or any other workflow in a scene with multiple lights which are near one another? I would build substractive but i need the shadows on my player from every light ( i mean shadows on the static objects from my player)
     
    Last edited: Jan 17, 2021
  42. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Would be nice.
    Here you can find also the official test scene

    2505_Area_Light_ShadowMask_Baking

    https://github.com/Unity-Technologies/Graphics/pull/3052

    https://github.com/Unity-Technologi..._Tests/Assets/GraphicTests/Scenes/2x_Lighting
     
    guycalledfrank likes this.
  43. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Getting this error when imported to a project:

     
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Found the problem. Can you try replacing this file?
    https://drive.google.com/file/d/10gYSi9c4hYbHvFGRq55AkeUf97jfjgmL/view?usp=sharing

    Yeah, I think it's mentioned in the docs, in case you use prefabs or stream scenes asynchronously:
    https://geom.io/bakery/wiki/index.p...iated_at_runtime_in_a_build_have_no_lightmaps

    Yeah, if you can divide your shadowmasked lights into some layers that are guaranteed to not overlap (even if their spheres overlap), you can use "shadowmask group ID" option:

    upload_2021-1-18_22-24-35.png

    Set different IDs for different lights on each floor, but reuse them on the other floor.

    Yeah, there was an issue with the v1.8 shader when switching to mobile platforms. I updated the github version with the fix a few weeks ago.
    Anyway, here's the file you need: https://drive.google.com/file/d/1lHvZCgDtSDwMz-o6NWeW48fnsRZAWTXP/view?usp=sharing
     
    Last edited: Jan 19, 2021
    swantonb likes this.
  45. MorpheusXI

    MorpheusXI

    Joined:
    Jan 18, 2018
    Posts:
    71
    Hi

    In relation to my Nvidia 750 TI and *Bakery running in RTX mode via the checking (when it shouldn't). Today I tested again in the Bakery only project. I got it to work, ensured RTX was unticked (although sure I tried this prior). It worked Ok this time although Avast kept popping up with alerts to several .exe's deleting files, I allowed all accesses - these prompts last time did not appear. I'm wondering if this could of been the problem. I also started the test on the original project I had the problem on and this also appeared to work - again acking any Avast prompts - I did NOT complete the bake due to time.....will advise back if I have a problem when getting back to this.

    Possible solution to *:
    1. Import Bakery > Close project / reopen.
    2. Ack any AV prompts which may only appear after 1.

    :)
     
    guycalledfrank likes this.
  46. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    35
    Hello,

    1. About the new 'L1' light probe mode - since this is using less coefficients than the Legacy mode, does this mean the probe lighting will lose even more high-frequency detail? I'm already finding that L2 spherical harmonics are only just good enough at capturing our lighting for dynamic objects.

    2. I have a GTX 980, which as far as I know doesn't support RTX, yet the 'detect optimal settings' says:
    RTX ray-tracing: yes
    Non-RTX ray-tracing: yes
    Is this correct? I'm experiencing crashes on baking and I'm wondering if it's trying to do RTX bakes when it shouldn't be.

    3. Could I request an additional callback for when RenderReflectionProbesButton() completes? There's a OnFinishedFullRender event for RenderButton(), an OnFinishedProbes for RenderLightProbesButton() but nothing to detect completion of RenderReflectionProbesButton().

    Thanks.
     
    Last edited: Jan 19, 2021
  47. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Hi man, i've tried it as you suggested before asking you and was able to find a good result and i hoped that i will fix this one too but i cant seem to understand why this is happening, i dont get any overlap warning message, but most of the lights just have their radius shown on the walls like this:


    https://gyazo.com/b1d6702af2456668186c8baa51f6eb4a


    https://gyazo.com/e08c8eb159bfdbc533d087ad9588d6a2


    https://gyazo.com/cec94b15d43cfa7031121aac0c037ff6


    https://gyazo.com/528f9ce6630346112c7de966b7bb5ae1



    https://gyazo.com/1312fc2f8eb14a59f35f36315f2a38a3


    https://gyazo.com/009ac3c53270a602e385e1fc5a6fe418


    https://gyazo.com/b6bfd28d6cc80ebe5e8997a46a8c5d2c

    Is this what it should look like?

    The result is pretty good except for the radiuses of the lights being like this, if they blended somehow it would've been perfect.

    Oh also in the preview it looks as it should, blended


    https://gyazo.com/5dc5d3be1f0c4b17a72bc4a12462dd79

    https://gyazo.com/ab29c393c743f1405a48253cc8877769

    https://gyazo.com/9ad155bf10367c3cb8e07b327d604472

    https://gyazo.com/8cc7376edfa394fadfe0724b56892312

    Also how many masks can be used? 4 right? 0,1,2,3?

    edit2:
    https://gyazo.com/5142986797431e31dfee9993c1cd6ea9

    here too
    https://gyazo.com/cfc79cc77a16fb06e043c2fc40b907a1

    i got this happening here too, no overlapping warning, why does this happen?


    One more thing i'd like to ask... i stuggled to getting volumes to work all day until i realised your example had bakery standard shader on it XD, i also use a standard double sided shader, can you help me convert it to work with volumes? i pay

    edit: WHAT IT IS DOUBLE SIDED ALREADY, YOU'RE A LEGEND XD

    edit2: i still dont get it to work in my scene...



    this is the volume

    https://gyazo.com/283167fd6f2c0dfc29ed02455e9d78ed

    this is the cube with the same material that works fine in your example scene. I have checked volumes on it, it works in your scene but not in mine, what am i doing wrong again :(

    edit 15: found the issue...the volume must be global.

    edit 16: however in a complete dark area the material isnt black..


    https://gyazo.com/8f6fbb9841e7f0b83b7f6bb993ffb47d

    is this normal?

    i also put the bakery standard material on the weapon too, the weapon doesnt go dark at all, it is a noticeable change at materials that i set metalliness to 0, such as the soldier, you can see a noticeable change but it doesnt go full dark, as you can see here:

    https://gyazo.com/bae4174915a0f5d0a8ec98d1ec9c6581

    it definitely isnt supposed to behave like this right?

    edit 22: it seems that removing the reflection probe i had outside made it more acceptable but still could be better

    edit 23: im happy with the result now, idk, i have one more problem, the specular shader shouldnt have options? is this how it is done? i cant enable volume on it nor apply any map


    https://gyazo.com/1ba028cc72ce3c9a1c3da21c8559b21e


    happens only to specular one
    edit 31: i found the fixed specular in your discord, nice work


    aaand edit 30: how do you use one volume for multple scene setups? the volumes need to be present while baking right? in this case how do i assign multiple volumes to all the bakery materials? can i save the volumes as prefabs and assign them to the materials manually? Or is there an easier way?

    edit 31: all solved on discord, thanks man you are cool <3
     
    Last edited: Jan 25, 2021
  48. poke50uk

    poke50uk

    Joined:
    Jul 29, 2013
    Posts:
    11
    I've been getting the "rtcRes == RTC_SUCCESS" error dialog from ftrace on a GeForce RTX 3090 even with rtx ON in advanced settings and manually rendering light probes.

    I think this is a bug - the actual rtx on/off setting isn't being used when ProcessCoroutine is being called (line 3838 and line 3965 in ftRenderLightmap.cs), instead it's just using a hardcoded "ftrace" string which always runs a non-RTX version (which crashes on a 3090).

    If I change it to use
    Code (CSharp):
    1. ProcessCoroutine(rtxMode ? "ftraceRTX" : "ftrace", startInfo.arguments)
    Then I no longer get the crash when rendering light probes.
     
    dadenCKEP and guycalledfrank like this.
  49. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    Hey, when baking bigger scene I sometimes get this error:

    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3. System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <9577ac7a62ef43179789031239ba8798>:0)
    4. System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <9577ac7a62ef43179789031239ba8798>:0)
    5. System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <9577ac7a62ef43179789031239ba8798>:0)
    6. ftRenderLightmap+<RenderLMFinalize>d__291.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:9302)
    7. ftRenderLightmap+<RenderLightmapFunc>d__263.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5758)
    8. ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4263)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
    13. System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <9577ac7a62ef43179789031239ba8798>:0)
    14. System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <9577ac7a62ef43179789031239ba8798>:0)
    15. System.Delegate.DynamicInvoke (System.Object[] args) (at <9577ac7a62ef43179789031239ba8798>:0)
    16. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    It seems to be somehow connected with objects in one of my folders (there are 86 objects though). But things gets more confused because -
    It works when I bake:
    * only this folder
    * everything except this folder

    It does not work when I bake:
    * this folder and few (2-3) other folders with approx 30 objects each. (when I bake the others alone, it works)

    Any idea what it coul cause? I've managed to bake it several times, even tried to update to most recent version of Bakery. It always happens during "Progress 55% - Rendering Lightmaps - preparing.." stage
    upload_2021-1-21_17-45-50.png

    upload_2021-1-21_17-46-47.png
     
  50. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    I wonder if Avast has any specific complaint? Does it dislike some particular behaviour of these exes or the pattern of their execution? If you check them on virustotal.com, they're all clean, so it must be some "active" detection of something it thinks is "suspicious" (creating global memory-mapped files or mutexes?... running them all in a row, the way benchmark does it?...)

    Yes. Legacy is better for high-contrast direct lighting. L1 is good enough for indirect, especially when used with "non-linear probe SH" option.

    Yes, but it also says:

     Recommended: ON if you are using a GPU with RT acceleration (e.g. 2xxx or 3xxx GeForce series), OFF otherwise


    9xx and 10xx drivers support RTX emulation, so it's "yes" from the driver perspective. However, if you click "Set recommended as default", it will ask:

    Does your GPU have RT cores (set RTX mode as default)?


    In this case, knowing you don't have the actual RT cores (being on 980), you should click "No". RTX mode will be set to OFF by default.

    The button itself is immediate. Why OnFinishedProbes is not suitable?

    Yep, testing your project from Discord right now....

    It was, sorry, legacy light probes weren't using the RTX mode. I fixed it last month, please use the latest github patch: https://geom.io/bakery/wiki/index.php?title=Github_access

    Can you please check if it happens with the latest github version too? If it does, an updated line number will be useful.
     
    swantonb likes this.