Search Unity

[Released] Beyond Magic: GPU Nodes for MapMagic

Discussion in 'Assets and Asset Store' started by CodersFromBeyond, Jun 29, 2019.

  1. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    It should work together with Spline Tools. Obviously Spline Tools' nodes won't be gpu boosted, though.
     
  2. DropNodes

    DropNodes

    Joined:
    Jun 11, 2019
    Posts:
    39
    It doesn't work with splines, I can't get the GPU to work at all (and when closing the multithreading the generation becomes very slow) on parallel it seems to work on some nodes and not to other along with Spline Tools, for example scatter generator (weirdly enough)
     
    Last edited: Sep 26, 2019
  3. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Bought it and it doesn't work, only parallel mode works on some generators, but then again all items around the world are scattered beyond the terrain, something is messing with the splines. Hope you get it working with it because most MM users are going for the splines add-on. BTW, GPU is not working at all, and it's too slow with multithreading on, is this how it supposed to work?
     
  4. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    GPU doesn't support multithreading, since it's only accessible in the graphics thread. You will have to choose between parallel nodes only or no multithreading enabled.

    If you have specific problems besides that, drop us a specific description at support@codersfrombeyond.com and we'll have a look at it. We've got Spline tools installed so if you have a specific scene or test case we can give it a go.
     
  5. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    So it is normal to freeze the scene completely when generating non-multithreaded, GPU terrain? Or is it because not all of the graph is not GPU since splines not have beyond generators, I guess that must be a problem.

    Well is an easy to reproduce issue, try having some splines with your scene (use the splines demos for example) and try to use scatters to spawn stuff, it ll drop errors on spline generators. If that info is not enough let me know and I'll create an e-mail, but I guess that should do it.

    BTW have you tested the benefit of parallel vs the mapmagic nodes?
     
  6. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    Yep, GPU nodes are lot more useful when sculpting terrain. They aren't the best choice for trying to boost live processing. It has to do with being stuck on the graphics thread again. If you need to generate on the go maybe use parallel nodes which should still be faster than vanilla MapMagic and allow using multithread on the other nodes as well.
    Mixing spline generators itself is OK, they are compatible except for the multithread limitation with GPU nodes.

    Splines also had an update just recently, are you seeing this with the latest version?
    We'll give it a go and get back to you on it.

    Yes, we compared GPU / Parallel / Original. Probably wouldn't be bad idea for us to include those results somewhere for reference, though obviously the difference with your GPU and CPU power affect the results.


    For quick reference:
    GPU - mainly for sculpting at the editor, freezes the GUI thread white calculating.
    Parallel - faster / optimized nodes. Very quick on single map tile generation, smaller gains on multi-tile generation but still more optimized algorithms than vanilla.
    Original - slow in single tile, gains most out of multithreading+multiple tiles.

    If you want to run MapMagic on multiple map tiles and generating on the go, then you get a lot out of MapMagic's multithreading. In those cases adding few parallel beyond nodes will give you a some boost but the GPU are best used for designing and pre-rendering.
     
  7. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Gotcha!

    Yes using 0.5 version of splines, let me know when you check, that would be useful.

    BTW, What happens is that the scattered items are placed under the terrain (parallel mode). I use full beyond terrace, voronoi and errosion nodes. And if I use Beyond scatter it throws an error in splines.

    Error with beyond scatters:

    Error generating chunk: MapMagic.Coord x:1 z:1: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at MapMagic.SpatialHash.GetCellByPoint (UnityEngine.Vector2 point) [0x00032] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\SpatialHash.cs:94
    at MapMagic.SpatialHash.Add (MapMagic.SpatialObject obj) [0x00001] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\SpatialHash.cs:262
    at MapMagic.SplitGenerator.Generate (MapMagic.CoordRect rect, MapMagic.Chunk+Results results, MapMagic.Chunk+Size terrainSize, System.Int32 seed, System.Func`2[T,TResult] stop) [0x002b5] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Generators\ObjectGenerators.cs:470
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, MapMagic.CoordRect rect, MapMagic.Chunk+Results results, MapMagic.Chunk+Size terrainSize, System.Int32 seed, System.Func`2[T,TResult] stop) [0x000ae] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\GeneratorsAsset.cs:687
    at MapMagic.GeneratorsAsset.GenerateWithPriors (MapMagic.Generator gen, MapMagic.CoordRect rect, MapMagic.Chunk+Results results, MapMagic.Chunk+Size terrainSize, System.Int32 seed, System.Func`2[T,TResult] stop) [0x00043] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\GeneratorsAsset.cs:675
    at MapMagic.GeneratorsAsset.Generate (MapMagic.CoordRect rect, MapMagic.Chunk+Results results, MapMagic.Chunk+Size terrainSize, System.Int32 seed, System.Collections.Generic.HashSet`1[System.Type]& changedTypes, System.Func`2[T,TResult] stop) [0x00199] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\GeneratorsAsset.cs:317
    at MapMagic.GeneratorsAsset.Calculate (MapMagic.CoordRect rect, MapMagic.Chunk+Results results, MapMagic.Chunk+Size terrainSize, System.Int32 seed, System.Func`2[T,TResult] stop) [0x00007] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\GeneratorsAsset.cs:232
    at MapMagic.Chunk.ThreadFn () [0x00029] in C:\Unity Projects\2019.2.5f1 PC\Assets\MapMagic\Main\Chunk.cs:235
    UnityEngine.Debug:LogError(Object)
    MapMagic.Chunk:ThreadFn() (at Assets/MapMagic/Main/Chunk.cs:238)
    MapMagic.ThreadWorker:ThreadFn() (at Assets/MapMagic/Main/ThreadWorker.cs:533)
    System.Threading.ThreadHelper:ThreadStart()
     
    Last edited: Sep 27, 2019
  8. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    We couldn't immediately reproduce that, could you send nodes files or the scene to us?
    You can contact us at: support@codersfrombeyond.com
     
  9. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    Hi!
    Q1: What about Voxeland?
    Q2: And does this asset bring more fps ?
    THX
     
    Last edited: Oct 21, 2019
  10. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20

    1: We haven't tested it with Voxeland. Normal MapMagic add-ons should work together though, since we only offer custom nodes.
    2: Yes, but the GPU nodes are best suited for pregenerating the map because they run on the main thread. If generating runtime maps with GPU nodes a custom loading screen should be used. Alternatively you can still use the optimized parallel nodes that will perform faster than equivalent mapmagic nodes at runtime, the size of the benefit depends on the situation.
     
    Nihilus0 likes this.
  11. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    Heads up, we released version 1.3 with several tweaks and fixes, as well as two new features.
    We gave Textures node a beyond-makeover as well as added completely new Sculpt node: We're pretty exited about this one, with Sculpt-node you'll be able to manually sculpt and modify terrain and save the results to the sculpt node. Compatible with Unity Terrain tools and Gaia!
     
  12. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    With Map Magic 2 due very shortly (end March I believe) are there plans to make Beyond compatible with the new version?
     
  13. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    Hi Bodyclock,

    Map Magic 2 is pretty major rework so we probably won't. Let's see how the new Map Magic takes off though.
     
    Last edited: Mar 16, 2020
  14. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    That's a pity. In that case, I take it there's no objection me trying to modify the code to get it work?
     
  15. CodersFromBeyond

    CodersFromBeyond

    Joined:
    Apr 14, 2019
    Posts:
    20
    Sorry it took a bit.

    When you are just working on your project you are of course free to do whatever you like with the asset code to make it work for you. Obviously we wouldn't like you to redistribute our asset, original or modified.
     
  16. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    This may not be your issue but Unity has started locking up on playmode since updating to 2019.4.13. It only happens with certain combinations of node values. Changing a value from 0.5 to 0.8 will cause a lockup but 0.7 will not. This behaviour does not occur in 2019.4.12.

    Since I am using only Beyond nodes in my graph I thought I would come here first.

    https://unity3d.com/unity/whats-new/2019.4.13

    EDIT: Sorry forgot to mention, this only happens on the blend node.

    EDIT 2: Well, I may be wrong. I deleted an unrelated script in the scene and now it's working again. Why changing a node value affects it, I have no idea.
     
    Last edited: Oct 26, 2020