Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] Magic Light Probes - High Precision Light Probe Generator

Discussion in 'Assets and Asset Store' started by Eugene-B, Nov 18, 2019.

?

Are you interested in this asset?

Poll closed Jan 28, 2020.
  1. Yes, I plan to buy it

    3 vote(s)
    75.0%
  2. No

    1 vote(s)
    25.0%
  1. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    34
    Hi, I just bought this asset and get this error when importing: Assets/Magic Light Probes/Passes/CullByHeight.cs(49,101): error CS1644: Feature `default literal' cannot be used because it is not part of the C# 4.0 language specification

    I'm running Unity 2018.4.36. Any help is appreciated in getting rid of the error. Thanks.
     
  2. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    This is something new. Can you connect to the Discord server?
     
  3. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    I got an error when press Calculate button:
    Index was outside the bounds of the array

    File MagicLightProbes: Line 3861:

    for (int i = 0; i < volumes[0].localFinishedPositions.Count; i++)
    {
    for (int j = 0; j < combinedVolumeComponent.customProbesToRemove.Count; j++)
    {
    if (volumes[0].localFinishedPositions == combinedVolumeComponent.customProbesToRemove[j])
    {
    volumes[0].localFinishedPositions.RemoveAt(i);
    }
    }
    }
     
  4. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Hi. I'm sorry for the late reply. Try deleting the MLP Combined Volume object and then adding a new volume to the scene. The object will be recreated automatically. This should help.
     
  5. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    It works as your suggestion but then that error happen again. I figure out the volumes.length=0 although I already add many volume into the scene. After turn back to your previous version, that error is disappear. I hope you could fix that bug.
     
  6. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Can you connect to the discord server? I would like to clarify some details in real time and try to reproduce it myself.
     
  7. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    Sorry, I don't use discord.
     
  8. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Ok, then can you repeat your actions on a separate scene so that it leads to an error, and then send me this scene here or by mail?
     
  9. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    I found the cause of that error:
    I have a Component in the object: Magic Light Probes
    After remove MyComponent from that Object, it runs OK.
    My component is so simple and Didn't do anything special.
    I will assign My Component to other Object.
    Thanks
     
    Eugene-B likes this.
  10. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Ok, glad you did it. Write if you need help.
     
    Kirshor likes this.
  11. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    289
    Hi everyone, I wanted to ask how you would approach the following problem with Magic light probes as I could not find a similar situation in the examples.

    I have two areas connected by a teleporter completely separated from another in the same unity scene. So I create two MLP Volumes and let it calculate the probes. But it creates one merged light probe volume. Ideally I'd like to have the light probe volumes separated as well to prevent one area blending with a few probes from far away. Is there any way to do this? (or do I just manually add some random additional probes closer to each of my areas?).
     
  12. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    In Unity, probes are always combined for one scene, so the only option is to add probes between your areas.
     
    fleity likes this.
  13. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Version 1.95 is available in the Asset Store.

    Improvements:
    • The Quick Editing component now displays the number of probes in the current volume.
    • Added a button for selecting Floor & Ground objects in the scene hierarchy.
    • The system no longer disables dynamic objects if they do not contain a Mesh Renderer component, which eliminates the need to mark objects created in the hierarchy for grouping as static.
    Bug Fixes:
    • Fixed a bug due to which probes sometimes spawned outside the volume.
    Changes:
    • Changed parameter name from "Probes Count Limit" to "Divide Volume On Probes Count".
     
  14. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    have to say im a bit frustrated, I've tried baking volumes many times with lots of different settings and i keep getting probes INSIDE the geometry of my houses which the only reason i bought this. I also have to turn the spacing wayy down so that it doesnt create a 1000 sub volumes and the result is a lot of the shadow areas dont get any probes at all.
     
  15. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    I can help sort this out. It will be more convenient if you connect to the Discord server.
    In short, probes inside colliders are completely excluded, this is simply impossible, since several algorithms are monitoring this at once. In other words, the probes will only be installed if they are not inside the geometry.
    As for 1000 subvolumes, a more flexible approach is needed here. For example, as described in the tutorial in the "Recommendations To Use" section, you need to place a low density volume over the entire scene and add a few smaller volumes in specific parts of the scene where you need to capture more detail.
     
  16. transporter_gate_studios

    transporter_gate_studios

    Joined:
    Oct 17, 2016
    Posts:
    219
    I am actually doing that with several volumes. All my building pieces have colliders, some of them overlap, is that the issue maybe? Do all the lights need the script to work? Ill try to get on the discord.
     
  17. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello guys!

    Can I delete magic light probes after I bake the probes? Or do I need to keep everything when building the project? I ask because the unity editor that is building the project is in the server, so I have to send my project through github and then the other machine creates the build.

    Regards,
    Carlos
     
  18. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    You can completely remove the plugin after placing the probes. Only the MLP Combined Volume object should be left on the scene, as it contains the standard Unity Light Probe Group component
     
    fuzzy3d likes this.
  19. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Thank you so much Eugene-B! I appreciate your prompt response. You created a wonderful tool here!!

    Regards,
    Carlos
     
    Eugene-B likes this.
  20. HG_SB

    HG_SB

    Joined:
    Dec 9, 2015
    Posts:
    38
    Hi,

    We are getting errors from MLP which seem to be related to the background update checker.

    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: value
    3. System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    5. System.Single.Parse (System.String s, System.IFormatProvider provider) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    6. MagicLightProbes.MLPUpdater+<CheckForUpdatesEnumerator>d__12.MoveNext () (at Assets/3rdParty/Magic Light Probes/Editor/MLPUpdater.cs:92)
    7. MagicLightProbes.MLPUpdater.CheckForUpdatesLoop () (at Assets/3rdParty/Magic Light Probes/Editor/MLPUpdater.cs:39)
    8. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <7ca9a09aeae542ab86253a551b1c89a0>:0)
     
  21. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Update to version 1.95.1. This error is the result of the temporary removal of all packages from the update server, as some users were sharing direct download links.
     
  22. QBrute

    QBrute

    Joined:
    Jun 2, 2014
    Posts:
    3
    Hi,
    MLP is really fun so far, but I have a slight issue regarding the gizmos.

    For some months I worked in a scaled-up version of my scene (Everything was scaled by a factor of 33, because my player figure had scale 1 then). I realized that this gave me really big trouble with light calculation because all the distances were too large.

    I scaled everything down again, so that the scene is at scale 1 again. But now all the gizmos for MLP Light components are huge! Is there a way to scale them down? In the gizmo menu I can only turn them off by unchecking "MLPLight"


     
    Last edited: Nov 6, 2021
  23. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    There is no special parameter for this, but you can change it manually via the MLP Light editor code. The OnDrawGizmo method is called there. You can also set the size there.
     
  24. QBrute

    QBrute

    Joined:
    Jun 2, 2014
    Posts:
    3
    Thanks for the tip, that helped :)
     
    Eugene-B likes this.
  25. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Version 1.95.3 is available in the store.

    Improvements:
    • The behavior of the "Volumes List" in the MLP Manager depends on the state of the scene (editing the prefab/main scene)
    • "Volumes List" displays volumes for only one prefab instance.
    • "Calculate All Volumes" calculates volumes for only one prefab instance, the rest of the copies are updated after applying overrides.
    • The method for searching for inner volumes has been moved to the calculating volume cycle and is now called only once, which should eliminate editor slowdowns with a large number of volumes on the scene.
    Bug Fixes:
    • Fixed bugs during project build.
    • Fixed a bug due to which the calculation stopped at the stage "Culling By Max Height".
    • Fixed errors with positioning probes when working with prefabs.
     
  26. YellowBudgie

    YellowBudgie

    Joined:
    Aug 24, 2017
    Posts:
    2
  27. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    This sometimes happens for reasons unknown to me, to quickly solve this:
    1) Switch the inspector in Debug mode
    upload_2021-12-15_21-11-4.png

    2) Find this section
    upload_2021-12-15_21-11-50.png
    3) Set links manually
     
  28. YellowBudgie

    YellowBudgie

    Joined:
    Aug 24, 2017
    Posts:
    2
    Solved my problem perfectly, thank you very much!
     
    Eugene-B likes this.
  29. eoniantech

    eoniantech

    Joined:
    Jul 1, 2014
    Posts:
    7
    how to change the folder the MLP group are saved in the Project ?
    By default Magic Light probe create a folder under magic light probe folder in PROJECT with the name of the level, but that's not ideal and I didn't find any options to change it.
    thanks
     
  30. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    If you mean the folder with the .mlpdat files, then there is no way to change the location. These are temporary files to support the Quick Editing option and are editor-only files. Why would you move them somewhere?
     
  31. Maxse93

    Maxse93

    Joined:
    Feb 4, 2017
    Posts:
    3
    Light Probe Calculation always stops with the error below. No matter which settings I change. Also, the discord invite is broken. As I need the tool ASAP, I would kindly ask for fast help or refund, if fix today is not possible.


    ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds
    Parameter name: destinationArray
    System.Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Collections.Generic.List`1[T].set_Capacity (System.Int32 value) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Collections.Generic.List`1[T].EnsureCapacity (System.Int32 min) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Collections.Generic.List`1[T].AddWithResize (T item) (at <47ab72e0328040438980f9c23608e1ec>:0)
    MagicLightProbes.FindClosestPoints+<>c__DisplayClass0_0.<ExecutePass>b__0 (System.Int32 i) (at Assets/Magic Light Probes/Passes/FindClosestPoints.cs:64)
    System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) (at <47ab72e0328040438980f9c23608e1ec>:0)
    --- End of stack trace from previous location where exception was thrown ---
    System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Threading.Tasks.TaskReplicator+Replica.Execute () (at <47ab72e0328040438980f9c23608e1ec>:0)
    Rethrow as AggregateException: One or more errors occurred. (Destination array was not long enough. Check destIndex and length, and the array's lower bounds
    Parameter name: destinationArray)
    System.Threading.Tasks.TaskReplicator.Run[TState] (System.Threading.Tasks.TaskReplicator+ReplicatableUserAction`1[TState] action, System.Threading.Tasks.ParallelOptions options, System.Boolean stopOnFirstFailure) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Threading.Tasks.Parallel.ForWorker[TLocal] (System.Int32 fromInclusive, System.Int32 toExclusive, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] body, System.Action`2[T1,T2] bodyWithState, System.Func`4[T1,T2,T3,TResult] bodyWithLocal, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) (at <47ab72e0328040438980f9c23608e1ec>:0)
    --- End of stack trace from previous location where exception was thrown ---
    System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException (System.Collections.ICollection exceptions, System.Threading.CancellationToken cancelToken, System.Exception otherException) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Threading.Tasks.Parallel.ForWorker[TLocal] (System.Int32 fromInclusive, System.Int32 toExclusive, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] body, System.Action`2[T1,T2] bodyWithState, System.Func`4[T1,T2,T3,TResult] bodyWithLocal, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) (at <47ab72e0328040438980f9c23608e1ec>:0)
    System.Threading.Tasks.Parallel.For (System.Int32 fromInclusive, System.Int32 toExclusive, System.Action`1[T] body) (at <47ab72e0328040438980f9c23608e1ec>:0)
    MagicLightProbes.FindClosestPoints+<ExecutePass>d__0.MoveNext () (at Assets/Magic Light Probes/Passes/FindClosestPoints.cs:56)
    MagicLightProbes.MagicLightProbes.SubPassIteratorUpdate () (at Assets/Magic Light Probes/MagicLightProbes.cs:535)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <13c5ad68fffb46969f1ca1df233d1e4d>:0)
     
  32. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Check this link for Discord https://discord.gg/VtEmFQSM

    So far, there have been no problems with the invitation to the server. As for your error, yes, I have already met it and am working on a solution, however it is not permanent for me. Try to clear the volume ("Clear Volume" button in the UI of the Magic Light Probes component) and restart the calculation.

    Also, as quick fix try to use this code on line 56 of FindClosestPoints.cs file:
    Code (CSharp):
    1. Parallel.For(0, separated[s_list].Count, i =>
    2.                 {
    3.                     foreach (var point in separated[s_list])
    4.                     {
    5.                         if (point != separated[s_list][i])
    6.                         {
    7.                             if (Vector3.Distance(point.position, separated[s_list][i].position).EqualsApproximately(spacing, 0.01f))
    8.                             {
    9.                                 lock (separated[s_list][i].nearbyPoints)
    10.                                 {
    11.                                     separated[s_list][i].nearbyPoints.Add(point);
    12.                                 }
    13.                             }
    14.                         }
    15.                     }
    16.                 });
     
    Last edited: Jan 26, 2022
  33. tsujihaneta

    tsujihaneta

    Joined:
    Jun 8, 2017
    Posts:
    16
    Thank you for a great tool. When I do a development build of my application, I get the following error.

    This does not occur if the field Public is set to NonSerialized and built.
     
  34. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Ok thanks, I'll check it out!
     
    tsujihaneta likes this.
  35. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Hi there!
    At the moment, payments to all banks in Russia are blocked and I actually do not receive payments from Unity. I continue my work for free - anyone who wants and can provide support can do it here
    I hope it's all over soon! Peace and good luck to all!
     
  36. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    839
    So wait a min? so, Unity is taking all your money from the development???? if that is the case, I will never give them a dime.... That is not cool at all... I understand them blocking Russia, for w/e. but to take all your money?? That is not acceptable.....

    No one should work for free and Unity reap the benefits.... for something you have no control over... I believe in what is fair, and I believe this to be unfair. Let us know if you plan to sell this else where... So you can get paid for your work..... I don't know you at all, but I know your asset has been around for awhile.....

    Unity, needs to rethink how to handle this and not punish, people that have no control....( The little guy)
     
  37. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    At the moment, all my income just accumulates on the balance and cannot be sent to my bank account. I am sure that Unity continues to look for options, I also continue to look for them. The only thing I would like Unity to do in this situation is to communicate with real-time support. Well, anyway, at the moment I'm just waiting in the hope that a payment method will be found, but so far this is not the case.
     
    Recon03 likes this.
  38. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    839

    Well, they need to make sure you get paid for your work... this is for any one no matter where they live... They need find options, other wise, hold the money, until this war ends, hopefully soon. Because people like your self have no control over any of it... a bit unfair if you ask me.


    "The only thing I would like Unity to do in this situation is to communicate with real-time support."
    I agree, sadly Unity has always been horrible at that for everything in general...



    As long as Unity does not take the money, then fine, but they should stay in contact with developers, users, and so forth about what is going on.. I seen this happen with some stuff in Unreal as well, and the developer dropped support, all together. So, that is good that you are not hurting your customers, but still Unity hopefully finds a way to handle this, so that you get paid one way or another. Keep everyone updated. Please.


    PS: I been a contractor for nearly 3 decades and worked with people all over the world, I know a few of my friends, who I worked with from Russia, is going through this as well, but I know a few of them, found ways to get paid for there work, I can ask them, how they did, if you like.
     
  39. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    I would be very grateful for this, perhaps it will be useful even for Unity, since Steam and Epic have already set up payments for their customers and provided instructions.
     
    Recon03 likes this.
  40. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    A quick question before I take the plunge; I've been using Light Probes by hand for years, and I've always only put a tiny amount down. Is there any particular performance hit (or just memory?) with putting thousands of them in a scene?
     
  41. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Of course, this can have some performance impact, but MLP allows you to adjust the number of probes quite simply.
     
  42. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    I suspected you might have a better idea if (say) 50,000 probes is an absolute no-no, or if Unity copes just fine with that. I don't think I've ever hand-placed more than a couple hundred of them in a scene.
     
  43. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    It really depends on the end platform, for example, one user had problems with 2000 probes on a not very powerful Android smartphone, another had no problems with 300000 on PC, and I successfully worked with 80000 on Oculus Rift and Vive. In fact, they are quite productive.
     
  44. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    Consider that a sale then. I hope the war ends soon and S*** gets back to normal so you can be paid!
     
  45. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    You might need to do a little memory optimisation >_<

    upload_2022-5-10_17-47-52.png

    I put the probe default spacing to 10 metres - unsure if anything else will reduce the memory footprint?
     
  46. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    Is it a big scene? Actually there are several assumptions, I can check it within a week
     
  47. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    Yup, about as big as Unity will take (~24km2) - a warning from the tool going 'Estimated 300 million probes are you sure?' might be nice - I ended up with 100m probes, and Corners set to 25. So far, very impressed!



     
  48. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    In such cases, you need to divide the scene into separate volumes, while choosing quite carefully where they are definitely needed and with what density. Have you read the Recommendations To Use section in the documentation? There is a small example about this.

    Try to make the main volume with a density and CDT of 100 and install separate volumes around objects with individual density settings.
     
  49. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    234
    I've got an error when making builds :

    The referenced script on this Behaviour (Game Object 'Light Probe Group 0') is missing!
    A scripted object (probably MagicLightProbes.MLPQuickEditing?) has a different serialization layout when loading. (Read 32 bytes but expected 52 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    Unloading 6 Unused Serialized files (Serialized files now loaded: 0)

    In editor, that object has MLP Quick Editing on it.
     
  50. Eugene-B

    Eugene-B

    Joined:
    Sep 7, 2014
    Posts:
    310
    A very incomprehensible problem, please connect to Discord, there we will be able to sort it out in detail.

    https://discord.gg/p94azzE