Search Unity

MapMagic 2 - infinite procedural land generator

Discussion in 'Assets and Asset Store' started by Wright, Apr 24, 2020.

  1. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    Is it possible to pull map data from open street map and import it into mapmagic?
     
  2. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    If you are talking about heightmaps - as far as I know OSM doesn't contain direct elevation data. Some OSM-based projects using SRTM heights together with OSM. You can get SRTM heightmap and import it in MM using Import node.
     
  3. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    1) Is there a Tutorial to mapmagic using custom Base Shape? example: have specific island Shape then use MM to create all the terrain inside the Shape bounds?
     
    Last edited: Apr 11, 2023
  4. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    I started to make a custom node that takes a Vector3 array, but am having trouble working through the UI. Using DrawPositionsGenerator as a model, Draw.Field doesn't seem to support anything like an array reference. I tried using an object reference, but seem to be blocked by the object field not registering Right Clicks in order to be Exposed. Could you suggest an easier approach?

    Ultimately I do not care about editing these arrays directly in Map Magic; I just want a way to Expose an array of points to the generator and have it work just like the Positions node.

    Thanks!
     
    Last edited: Apr 11, 2023
  5. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Not sure what you mean under base shape exactly - but here I'm using Simple Form in a shape of Cone and build an island based on this shape:


    May I ask why you need an array exposed? Exposing is usually used for mathematic expressions, and it not designed to work with arrays. Maybe it would be easier to access array in the node directly?
     
  6. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Sure - I feed in spawn points to the graph, and flatten the terrain under every spawn point; the number of spawn points varies by number of players, and spawn positions are parameters.

    Could you explain how to access the array in the node directly? That sounds promising.

    Thanks!
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    You can access the node by it's id - here is FAQ link.
    Btw GetGeneratorById works already.
     
  8. R0dluvan

    R0dluvan

    Joined:
    Nov 16, 2016
    Posts:
    10
    Am I correct in assuming that MapMagic 2 does not support hierarchical map scales? E.g. 1 km x 1 km tiles overlaid by 2 km x 2 km tiles (at a coarser resolution) overlaid by 4 km x 4 km tiles, etc. - or anything of that sort?
    If it doesn't, can I implement it myself by e.g. maintaining several MapMagic instances and feeding data from one to the next? Or are there technical limitations against that?
     
  9. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Don't you have an example where it's implemented and how it works?
    MapMagic has Draft tiles - coarser resolution mode for LOD and faster generate to see the results. However it's the same tile, it's not changing it's size
     
  10. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    104
    Hi there,

    I am dealing with the issue of grass, in URP, rendering as white billboards after the first tile. I have read that this was an issue that was introduced in unity 2021.2 so I backported my project to 2021.1 but the issue is still there. This is kind of a major issue and I'm wondering why people aren't talking about it, I'm guessing there is a solution that I have not found yet? Anyone have some input?

    upload_2023-4-19_19-38-35.png

    EDIT1:
    Can confirm it also does not work for builds made in editor 2022.2.15 the newest non Beta

    EDIT 2:

    Also why can't I seem to get mapmagic 2 to spawn Mesh grass at all, 'Mesh vertex lit' and 'Mesh unlit' both seem to not work at all.
     
    Last edited: Apr 19, 2023
    TheSniperFan and dequevedo like this.
  11. R0dluvan

    R0dluvan

    Joined:
    Nov 16, 2016
    Posts:
    10
    I haven't any particular example to point at, but I'm looking to create a world on a scale closer to realistic, and would like to try using MapMagic to both generate (the layout for) large-scale features like mountain ranges and swamps, and generate finer-level features that depend on the former, such as individual cliffs and crags.
    I suppose even small tiles can support large scale (slowly varying) noise generation, but other operations like erosion or custom operations may be too expensive to run on a fine scale it you want large scale effects (e.g. eroding a whole valley that might cover whole tiles in width). Tile edges might also interfere, for operations that require a lot of surrounding context.
    Don't know if I'm explaining myself here. Anyway it sounds like this is not supported natively. Don't know how hard it would be to hack around. Thanks for replying in any case.
     
  12. R0dluvan

    R0dluvan

    Joined:
    Nov 16, 2016
    Posts:
    10
    I wrote a long reply to this but the site seems to have eaten it.
    Briefly, imagine a system that generates large-scale terrain features at a low resolution, using expensive operations with a lot of context, like erosion. Then finer-grained, cheaper operations add high resolution detail.

    I gather this is not supported, but I'd be interested to hear how hard you think it would be to hack together.
     
  13. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Hi Dennis!
    I'm curious is there's a way to apply a custom splatmap into MapMagic and have it overwrite the texturing that already exists where it's placed? I was able to get height maps to stamp into the terrain using the import node as shown in the MM2 documentation and I was wondering if there is a similar approach for textures.
    My use case is to have small hand made playable areas be stamped into my mapgraph.
    Hopefully, this makes sense.
    Thanks!
    B
     
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Splat maps are actually nothing but just a several regular grayscale maps combined together so that the total intensity of each pixel is not exceed 1. You can use Import to add these maps to MapMagic, and then Normalize node to modify intensity based on sum.

    When I was creating MapMagic 1, I initially assumed that all of the nodes should work with their own resolution. However it's kind of a nightmare to maintain such a system. Especially when it comes to working with objects. So it might seem that it's a good idea, but when comes to it's implementation it turns into hell. Needless to say that most of the nodes work way faster and consume less memory then map scaling itself. Except maybe erosion - but it would be easier to just add "downscale factor" to erosion node then implement multi-resolution tile system.
     
    protopop likes this.
  15. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    217
    I think grass doesnt always respect ground normal

    im using newest LTS and mesh vertex lit mode with instancing turned on

    now this isnt important because it probably wont be noticed from the height of player's perspective and his camera but i thought id report it

    Unity_ArFKzanA3l.png Unity_n4i5X8bsHP.png Unity_Ir4obtHSEe.png
     
  16. Zaba_Dev

    Zaba_Dev

    Joined:
    Feb 27, 2018
    Posts:
    18
    Hey, I get seams when using the beach node, at terrain connection. This doesn't happen if I lower the contour relax to 0 but I can't really do that. Is there something I'm missing?

    Screenshot 2023-04-23 155425.png Screenshot 2023-04-23 155651.png
     
  17. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Does Microsplat work with Locking? I can get locks to work just fine with vanilla HDRP. However, with Microsplat it seems to flip around the textures and sometimes Microsplat will start adding duplicate layers which I can remove with sync/sync all. However, this doesn't fix the obvious issue where the painted textures are simply removed or inverted.
    I've tried this on a clean Unity 2021.3.9f1 with latest Microsplat v3.9 with MapMagic 2.1.12.

    If someone can get this to work please let me know.
    Thanks!

     
    Last edited: Apr 24, 2023
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Unfortunately there's not much I can do about it. It's the way Unity works. MapMagic is a land generator that generates data to be used on standard Unity terrain with standard grass.

    Try increasing the Main Margins value in MM object - Tile Settings. More information why this happens.

    If something happens with MicroSplat - it's worth trying to enable Apply Type - Both in MicroSplat Output node -> Advanced.
     
  19. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    104
    I have successfully made a map with biomes, and I get the system for doing so, I make my biomes, (all the same 'height') and then I blend them together with noise masks. That's all great. I then overlay an 'Ocean' biome which I cut all the biomes with. I can play around with the setting and I'm sure I can find something that will suit my needs. However, I am having huge issues trying to get trees to stop spawning under the water level.

    To me it would make sense to take the output of the biomes, which I am satisfied with, and then pass the output of a specific biome through a 'selector' node set to world and then say that trees and such cannot spawn under a given range established by the selector. This does not happen at all, so I am guessing the selector does not work the way I am assuming it does. Which I read here:

    From docs "Selects (masks) the values interval at a specified level. In simple terms if the value is within From-
    To range it becomes 1, otherwise it becomes 0 (if not taking transition into account)."

    In the picture below you can see what I mean - The land mass your seeing is all above 15 (the level of the water plane) so I pass the biome data through a selector set to 15 to 20, the expected result for me is that the Mask should be all along the coast, but it runs through the water. I'm assuming it has something to do with the 'ocean' biome pulling certain areas of the biome down, but then it's quite unintuitive to use that node.

    How do you suggest I fix this in the smart way to enable to me to successfully apply a mask for anything underneath a certain level, when mixing biomes. I have tried editing the 'biome blend' in the Trees output, which doesn't help, and as you can see here, I am simply trying to make a mask match the coastline of the biome in this segment.

    Thank you.



    upload_2023-4-27_18-9-31.png
     
  20. yzaroui

    yzaroui

    Joined:
    Nov 23, 2014
    Posts:
    24
    Hello,

    Using Unity 2022.2.15 (so not beta) with URP, I am getting hard time to have grass appear, even with graphs provided with the package.

    When I open the provided `Tutorial` scene, everything seems correct, with lots of grass.
    When I create a new scene and drag the provided `SimpleGraph` graph (that is used in the `Tutorial` scene), the same terrain shows, but with zero grass.
    I tried all the provided graphs in a new scene and no one shows a single blade of grass.

    Do you have any idea about this issue. Why does the graph behaves as expected with the provided scenes and not with a new scene?

    Edit:
    If I copy the MapMagic gameobject from a provided scene to my new scene, the grass shows. And I can even change to another graph and get it to behave as expected.
    So the issue is with newly created MapMagic objects.
     
    Last edited: Apr 29, 2023
  21. Tim-Wiese

    Tim-Wiese

    Joined:
    Jul 7, 2012
    Posts:
    77
    Yea actually setting it to “Textures” was the fix. Which was unexpected because I always have it set to Both as that usually fixes other issues.
     
  22. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    What biome set node does with the outputs - it blends them layer by layer, like photoshop, and normalize them in a way that total intensity is always 1. This is exactly the same thing Normalize node does. So you probably can use Normalize - Selector - Biomes nodes.

    The other question is why do you get trees at the ocean. It might happen if your ocean opacity is not 1, but slightly lower. Anyways, try experimenting with biome blend of tree/object output - it might help.

    It seems that new MM object has no proper shader assigned, while original one (even from non-URP) has. Honestly I would rather expect it to be vice versa. Thanks for letting me know, I will look into this issue!

    Also textures work faster because bypasses MicroSplat control map generation in main thread. Possibly here is an issue.
     
  23. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    How can we have a 16x16 Heightmap Import Node, with biomes? Let's say we have 4 biomes which each is 8x8, so all 4 together is 16x16 and is this same heightmap. So we can have predefined maps and biomes

    BTW is there a Debug view like in MM1? So we can see generator times etc

    Edit: it seems import can be in each graph and it works out, is this the right approach?
    Edit2: Is there an equivalent generator to Blob since I dont see something similar and I d like to make an object have some area as a safe zone and export it to a map portal, used to do it with Blob in MM1. I ve seen Stamp and Flatten but These want to add Height which is not my intention

    Also, is there plans to have a manual scatter for splines? so you connect POI A with POI B which might be in a different tile
     
    Last edited: May 5, 2023
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Yes, you can enable Debug mode in Window - MapMagic - Settings. After that each node in graph will have Debug tab, where you can see various debug data, including generate time (for preview tile) for both main and draft modes.

    Not sure what do you mean by that. You have to use one Import node for each map you want to import. I recommend not to split maps by tile, but keep whole world in one map.

    Take a look at the Stroke node.
    BTW Stamp node does not oblige you to use it's output as height - you can use it as any mask, including biome mask or textures mask.

    No, unfortunately. The main problem here is not because it's not possible to do, but because this spline still will behave differently on different tiles. The reason is that each of the tiles will have it's own instance of this spline. When you modify it with pathfinding, avoid or other nodes (I guess you won't leave it directly straight) these instances will be different and won't be connected.
     
  25. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Thanks for the answers, about the Import node, where would you put the one import node in a 4 biome graph? In the parent graph? and if yes, how would you handle it? Thank you
     
  26. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    104
    Hi,

    What's the best way to identify islands generated by Mapmagic2 in order to place AI movement grids on each island using Aron Granberg's A* pathfinding? I can see that Mapmagic2 outputs how many islands it generated so is there a way to get a world position of the islands?
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    It depends on where you are going to use this node. If it is importing biome mask - it should be in parent graph, if it defines some map inside biome - it should be inside. Treat it like a regular node, like Noise for instance.

    It's a bit unclear what data exactly do you need. Should it be island borders for movement grids (map)? Or center of each island (vectors)? Something else maybe?
     
  28. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    104
    Either or, I'm still unsure how I will go about doing it, but I'm wondering if it was possible to get any information on island creation, center of island would be great. Is that possible?
     
  29. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    It depends on the way you create your islands. Most universal solution might be to scatter objects, mask those that are on the surface, use Slide node with inverted blurred mask, and reduce objects density with Rarefy node. This will place objects on top of your heights - however that won't guarantee one object per island.
     
  30. dequevedo

    dequevedo

    Joined:
    May 31, 2013
    Posts:
    9
    I`m having the same issue, but only after building my project, in the Editor it works fine.
    Tried many unity versions... 2020, 2021, LTS, latest Beta and Alpha. In some versions grass is rendered white, some versions there`s no grass at all.

    I don`t know what to do anymore.
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Unfortunately it's Unity issue, reported and confirmed. Here (FAQ) you can find more information about it. It worked in 2019, and I had report it was working again in 2023.2 alpha, but since you checked last alpha it might be a regression. Hope they will fix it one day.
     
  32. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    Hi!Im Using MapMagic 2. And Unity 2022.2.16f + Build-In Rendering . Im following tutorials but my Grass not appearing ...Why its like that?I have Draw checked....Render Defered..Cant see grass...I can paint grass manual but when i following tutorial and seting up nodes and Grass ..There is no grass ....
     
  33. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Does this happen in editor (or in build)? Can you please paste a screenshot of your graph?
     
  34. Aress28

    Aress28

    Joined:
    Dec 12, 2015
    Posts:
    100
    Its Happen in Editor and play mode...I just follow your tutorial in youtube "make island in minute" i i get different output than yours when it comes to grass...
     

    Attached Files:

    Last edited: May 24, 2023
  35. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    Hi, when i disable output node/remove connection in my graph, mapmagic throws "Thread failed: System.NullReferenceException: Object reference not set to an instance of an object" , this always can reproduce when Function node used. when not use Function node, mapmagic do not throws, but it will not remove objects that pools.

    after some dig, i found that `data.area` is null when clearing/generating , the only way to recover from this is start a fresh new generate, this make design graph so frustrating.

    edit:
    seems this error only happens when Function node reads from tiledata
     
    Last edited: May 27, 2023
  36. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    @Wright Hi. Unity added some new settings for terrains at some point (I'm on 2022.2 - I don't know when it was added).

    upload_2023-5-26_19-20-51.png

    Settings like "detail density" and "affected by density scale" are new. It would be nice if those would be exposed to the grass output node.
    The detail density one is particularly important to me, because right now MM can't generate sufficiently dense grass for my use case. Regardless of what numbers I put in density and res/patch, it just doesn't get dense enough. I have to go to the terrain and edit the detail density of the grass. Then I can get it right, but MM overwrites it again.

    There's also a new "Detail Scatter Mode" setting on the terrain. It has a significant impact on how painted details are applied to the terrain. So it would also be good to expose that on the MM component.

    ------

    Another thing Unity did was add certain terrain quality settings to the Unity quality presets. That way you can change terrain details, tree draw distance, etc. with your high/medium/low graphics presets. MM tries to overwrite these.
    upload_2023-5-26_19-30-51.png

    The Unity Quality settings win (MM values get overwritten), but this might be confusing for users. If you use this feature, the MM sliders don't do anything. Maybe you can disable them in that case?

    -----
     
    Last edited: May 27, 2023
    protopop likes this.
  37. Zaba_Dev

    Zaba_Dev

    Joined:
    Feb 27, 2018
    Posts:
    18
    Hi Denis, quick question just for clarity.
    With the brush tool, is that for post terrain generation? If I paint textures, and then full refresh the graph, my paint is gone. There's no way of storing that paint, or am I missing something?
     
  38. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    I found another bug.

    Wind Speed/Bending/Size aren't applied correctly.
    In MM:
    upload_2023-5-27_19-56-20.png

    Terrain component:
    upload_2023-5-27_19-56-46.png

    Size and speed are flipped. Bending is correct.

    Changing your code like this makes the MM and Unity Terrain inspectors match:
    Code (CSharp):
    1. // TerrainSettings.cs
    2. terrain.terrainData.wavingGrassStrength = windSpeed;
    3. terrain.terrainData.wavingGrassAmount = windSize;
    4. terrain.terrainData.wavingGrassSpeed = windBending;
     
    protopop likes this.
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Might it be that you are lowering intensity a bit while increasing contrast in Contrast node, so map becomes empty? Can you please try assigning Constant node with value 1 just for test?

    Thank you, will try to look if it has null check. I will appreciate if you can make some instructions to reproduce the issue, but I will poke into it myself.

    Detail Density is already exposed in MM Object -> Trees, Detail and Grass Properties. Detail Distance can also be found here. Pixel Error and Base Map Dist are in Terrain Properties.

    Thanks for the info, will look into what is it and how it could be used!

    MapMagic Brush is a tool that can edit any terrain with MM graph - and it's not only MM terrain. It's like partial iterative applying MM to some region. While MM generates terrain from scratch and erases all of the previous terrain information, even if it was created with MM Brush. It does not keep brush strokes or something. If you want some edited areas to remain untouched you can lock them with Lock feature.

    Yes, I've noticed these variables are switched in Unity: waving grass speed is wind bending, and waving grass strength is wind speed, probably by mistake. I decided to avoid reproducing this mistake in MM in case it will be fixed.
     

    Attached Files:

  40. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    as i said, it happens when i disable node/remove connection in graph (make sure you have function nodes in graph), this is quit easy to reproduce, just like this:

    upload_2023-5-31_16-45-11.png
    the test function is just simple as:
    upload_2023-5-31_16-45-32.png
     

    Attached Files:

  41. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    That's different.
    The grass detail density I mentioned is a new setting in newer Unity versions (and actually very important). You're talking about the global density scaling factor. It reduces grass density usually to improve performance on lower end machines.
    I'm talking about a new setting Unity added to the grass textures themselves.
    upload_2023-6-1_21-56-38.png
    1. It's a separate value for each grass layer/texture, so it has to go on the grass output node
    2. It goes above 1, which is necessary to make really dense grass (global grass density doesn't change anything above 1)
    3. The "Affected by Density Scale" determines whether the grass layer ignores the global grass density (the one you're talking about that's already in MM)
    4. It is false by default, which means that if people use MM with a new Unity version, your grass density setting is broken. It doesn't do anything.
     

    Attached Files:

    protopop likes this.
  42. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    @Wright I looked into the issue where grass is broken when you create it at runtime (white billboards). I'm on URP 14/Unity 2022.2 btw.
    What's happening is that Unity renders the grass with the "Universal Render Pipeline/Lit" instead of the "Hidden/TerrainEngine/Details/UniversalPipeline/WavingDoublePass" shader. It also renders them before the terrain (wrong pass).
    On top of that, "GraphicsSettings.currentRenderPipeline.terrainDetailGrassShader" is null in builds.

    I don't know if you can add this to your bug report, but I'm not optimistic, because apparently Unity has decided that they won't fix it.

    I'm impressed by this response. I guess Unity won't support procedural terrain generation anymore. :confused:

    Anyway, I made my own workaround. If you don't want me to post your source code (and the changes I made to it) here in the open, you can send me a private message and I can show you how I fixed it there.
     
    protopop likes this.
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Core MM2 is free and source-available, so there's no problem in publishing your changes here. I would love to see how it could be worked around, and I appreciate your findings!

    Thanks for keeping me updated! I'm adding this to my to-do list, and will try to implement it for next release.

    Thanks for a clear instruction, I will look into this issue soon.
     
    protopop likes this.
  44. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    The issue is that creating a new TerrainData object is buggy. The solution is to copy a known good one.
    1. Create a new terrain
    2. Reduce all the resolutions to the minimum
      upload_2023-6-5_21-0-40.png
    3. Take the TerrainData asset and put it somewhere safe
    4. You'll need a reference to it. I added a field to MapMagicObject
      upload_2023-6-5_21-1-50.png
    5. Change TerrainTile.CreateTerrain():
      Code (CSharp):
      1. // Old
      2. //TerrainData terrainData = new TerrainData();
      3. // New
      4. UnityEngine.Assertions.Assert.IsNotNull(mapMagic.terrainDataTemplate);
      5. TerrainData terrainData = Instantiate(mapMagic.terrainDataTemplate);
    6. Details now work correctly on procedurally generated terrain

    I found two more bugs (and solved one).

    Problem 1: In Unity 2022.2/URP 14 the preview shader is broken. You get an error when you want to preview a node.
    Solution: Line 118 in TerrainPreviewURP.shader is incorrect. (Unity probably refactored things at some point).
    Code (CSharp):
    1. // Old
    2. //half4 src = SplatmapFragment(IN);
    3. // New
    4. half4 src;
    5. SplatmapFragment(IN, src);

    Problem 2: Locking is half broken when using Microsplat. No matter what I do with the output settings, I can't get my hand-painted textures to persist. I get the closest to it working using the following settings:
    • Apply Type: Both
    • Use Custom Texture: true
    • Set Component: true
    upload_2023-6-5_21-18-40.png

    Those settings allow me to paint, but as soon as I generate, the entire area turns black. That happens even if I don't paint any textures. Just generating with the lock active is enough. My changes to the heighmap lock fine.

    Is there anything I can do to help you fix this? This is a complete showstopper. I can't finish my work unless this gets fixed.
    One thing I found out that's weird is that the custom splatmaps never get assigned. I added it to the MicroSplatOutput.cs file in the ApplyCustomData() function. This fixes the black terrain, but now I can't paint anymore.
     
    Last edited: Jun 5, 2023
    protopop likes this.
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Oh, instantiating already existing one. That can work. Thank you for sharing an idea and details!
     
    protopop likes this.
  46. Draganovaaa

    Draganovaaa

    Joined:
    Nov 18, 2021
    Posts:
    13
    Hello, I am using HDRP pipeline and I have been trying to figure out a masking problem related with the grass output. Using a blend node with multiple noises I have created a mask for where I want grass to spawn, and I have combined that with a stroke node around bigger rocks to isolate them from the grass. The output I use is vertex lit with instancing on. If you have some insight on the topic let me know! :)
    PS: I've tried different grass meshes and a different mask with just one noise and grass output and the issue still occurs.
    upload_2023-6-9_9-35-17.png
    Mask around rocks, so that no grass spawns there, but instead the mask looks to be offset to the left and grass spawns below the rock but not next to it.
     

    Attached Files:

    Last edited: Jun 9, 2023
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    This is odd - I'm not sure that it's related with HDRP. Could you please paste a screenshot of your graph - at least the part related with Grass output so I could reproduce this?
     
  48. Draganovaaa

    Draganovaaa

    Joined:
    Nov 18, 2021
    Posts:
    13
    Yes, absolutely!
    upload_2023-6-9_17-15-3.png
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Oh, I see now. You are using res/patch value 83. I recommend setting POT value here (64 or 128). It corresponds to Resolution Per Patch value in standard Unity terrain. Unity documentation says: "This value is squared to form a grid of cells, and must be a divisor of the detail resolution." - so your terrain resolution-1 should be devisable with this value to work properly.
     
  50. Draganovaaa

    Draganovaaa

    Joined:
    Nov 18, 2021
    Posts:
    13
    Oh, I would not have thought of this at all. Thanks a bunch for the quick reply, it fixed the issue!