Search Unity

[FREE] Procedural Terrain Painter

Discussion in 'Assets and Asset Store' started by StaggartCreations, Feb 12, 2021.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Paints terrain layers through a rule-based modifier stack. Making it easy to quickly, and non-destructively, texture entire terrains and achieve natural results, without any manual painting.

    Core features
    • Stackable and re-orderable modifiers, with blend modes
    • GPU-accelerated, parameter changes are fast and instantly visible
    • Heatmap visualizer to highlight the areas where a layer takes effect.

    Modifiers:
    • Height range
    • Slope range
    • Curvature range
    • Noise
    • RGBA Texture mask

    Limitations:
    • Manual texture painting will be overridden when respawning
    • Only supports square terrains, laid out in a grid.
    • Component can't be prefabbed (serialization limitation)

    This is not a terrain shader, but modifies the terrain splatmap data directly. As a result, this'll work with any asset store or custom terrain shader. MicroSplat integration is included, to sync the terrain layers to its texture array

    Included terrain layers are for demo purposes and fall under the CC0 license. Text file includes source links.
     
    Last edited: Mar 11, 2023
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Submitted v1.0.1

    Added:
    - Auto repaint option in Settings tab. Repaints a terrain when its height is modified.
    - Option to refresh Vegetation Studio Pro when terrain is repainted

    Changed:
    - Renamed namespace to "sc.terrain.proceduralpainter" for consistency between other terrain tools

    Fixed:
    - Heatmap preview highlighting wrong terrain layer in some cases
     
    Last edited: Feb 27, 2021
  4. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Looks interesting.. thank you..
    Great timing.. will have weekend to play with it.. and can see what it looks like with some of your other assets.
     
  5. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Hi, i just wanted to make sure it's not user error.
    It looks like in 2020.3.3f1 some things are not working as they should;
    when i select a modifier, no controls are shown below, the space only resizes, but nothing else happens:
    upload_2021-4-9_15-15-24.png

    And when i toggle Heatmap, the terrain seems to render the sceneview including toolpanel ontop of it:
    upload_2021-4-9_15-16-34.png

    Is this to be expected (does it require a lower unity version) ?
     
  6. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Ok, the first issue seems to come from an incompatibility with Odin Inspector (thirdparty asset), excluding your namespaces/types in its settings makes the editors show up.
     
    StaggartCreations likes this.
  7. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Some one else had the same issue, where the settings aren't drawing. It's unfortunately something I haven't been able to reproduce. It's possibly related to the angle of the sun and position of the planets, and what you had for breakfast.

    The scene view GUI drawing into the heatmap can happen sometimes, a bit of a matter of timing since the heatmap also renders along with it. It nudges back into place whenever you select a different layer, or change any settings.
     
    Flavelius likes this.
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    If anyone has the issue where settings for the selected modifier aren't showing, this is due to a conflict with Odin. A workaround is to exclude the namespace, so Odin will let the default inspector draw:

    upload_2021-4-18_11-39-8.png

    I've meanwhile implemented a fix for this, but currently have a hefty workload, so will probably get around to including in this in an update in 1-3 weeks.
     
    Flavelius and firstuser like this.
  9. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Submitted v1.0.2

    Added:
    - Callback event for when a terrain is repainted (TerrainPainter.OnTerrainRepaint)
    - A warning is now displayed if any terrain references have gone missing

    Changed:
    - Adding a new modifier now automatically selects it

    Fixed:
    - Texture modifier not aligning correctly if a terrain had a large negative position
    - Modifier settings not drawing when Odin is installed
     
    Fibonaccov likes this.
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    This is really really great! I would love to switch to it (since what I've been using, Terrain Composer 2 and GAIA, each have some significant flaws)....but any chance you're planning to add a few more filters?

    1) Blur: This is extremely valuable in general, and especially for blurring the noise patterns.
    2) Better noise options: Simplex creates fairly artificial QR-codelike shapes. And Gradient just seems to make a polka dot pattern, but I might be doing it wrong... But any chance for other noise patterns that would look more natural?

    thanks!
    Dave
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Thanks for the suggestions, Dave!

    Blurring has implications for seamlessly applying a filter across neighboring terrains, so the result would be that the filter on edges of a terrain turns into a blurred black edge. The "radius" parameter from the Curvature filter suffers from the same issue. However, most filters have a "falloff" value, which largely achieves the same as a blur, since it smooths out the ranges.

    I'll see if I can expose more options for the noise, such as depth. You can combine multiple noise modifiers, each with a different tiling size, then set the blending mode to "Max", in order to achieve more complex and less repetitive patterns.
     
    gecko likes this.
  12. hauwing

    hauwing

    Joined:
    Dec 13, 2017
    Posts:
    69
    Hi, I want to say this is a great tool. May I know it is possible to save the layers setting into a config file or something that can be used later on? since after the procedural texture, most likely it needs to be manual paint for details, so need to "disable" the procedural painter. Also how to disable the procedural painter properly as it seems like it is always hooked to the terrain even though I have disabled the painter gameobject and unchecked auto repaint. Thanks.
     
  13. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Glad you like it! It wasn't until I had pretty much finished everything that it occurred to me that saving everything into an asset file may have been more beneficial. But it would require the entire data structure to change and I wasn't willing to throw out two weeks of work, so that's a lesson learned

    It however only repaints whenever you change a parameter in the inspector, so once you start using the terrain tools it won't interfere. The auto-repaint option only applies if the terrain height is modified.

    But the TerrainAPI synchronizes the terrain data only once you save the scene or project. So it's possible if you use the Terrain Painter component, manually paint something, then save, the changes are going to be overwritten with the painting data that was still queued for saving.

    A way around this is to use File-Save Project after you're done using the Terrain Painter component. Not entirely sure, but if I automatically do this once the Terrain Painter loose focus, it should get around such issues.
     
  14. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm trying this in my game scene now (8x8 grid of terrain triles) but two issues, small and big:

    Small: The "layers" subpanel on the Terrain Painter inspector is so short, shows only four layers. Can that be enlargeable? I have 12 layers and the short panel is pretty annoying.

    Big: I'm using Microsplat, and already set up all that, so manually added layers to Terrain Painter by selecting the existing layers. Then I can see those on each terrain, all good...until as soon as I click a modifier for one of the layers and suddenly those 12 layers are added *again* to each terrain. So now I have 24 layers on each terrain, and the terrain turns black because...well, I'm not sure exactly why the terrain turns black, but presumably because there are these 12 new layers on the loose. No console errors (though earlier the error below appeared, but not sure when).

    Presumably I'm doing something wrong, but I have no idea what.... any ideas/suggestions?

    Note: I did not do the TP>Microsplat Copy action, because I didn't want to alter the MS config setup. I just matched the order of the layers in TP and MS Config.

    thx
    Dave


    ArgumentException: Getting control 10's position in a group with only 10 controls when doing ExecuteCommand
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at <fe7ee1881b524b0d9443f74417fb598b>:0)
    UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <fe7ee1881b524b0d9443f74417fb598b>:0)
    UnityEngine.GUILayoutUtility.GetRect (System.Single width, System.Single height, UnityEngine.GUILayoutOption[] options) (at <fe7ee1881b524b0d9443f74417fb598b>:0)
    UnityEditorInternal.ReorderableList.DoLayoutList () (at <7d90b28560b644ce87b8263efcc36eed>:0)
    sc.terrain.proceduralpainter.TerrainPainterInspector.DrawLayerModifierStack () (at Assets/ProceduralTerrainPainter/Editor/TerrainPainterInspector.cs:801)
    sc.terrain.proceduralpainter.TerrainPainterInspector.DrawLayers () (at Assets/ProceduralTerrainPainter/Editor/TerrainPainterInspector.cs:490)
    sc.terrain.proceduralpainter.TerrainPainterInspector.OnInspectorGUI () (at Assets/ProceduralTerrainPainter/Editor/TerrainPainterInspector.cs:233)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <7d90b28560b644ce87b8263efcc36eed>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    In the TerrainPainterInspector script at line 398 you can increase the x4 multiplier to allow more layers to show. I could simply add a slider for this in the future!

    As far as MicroSplat goes, the component is designed to handle terrain painting and layer management, so it won't be possible to do this the other way around without creating conflicts or unexpected behavior.

    The error about GUI is tricky, haven't found the exact cause. Went over the entire scope, but I assume the error is because adding a new layer alters the GUI while it's still drawing, which usually isn't an issue. So it's unfortunately a minor nuisance.
     
  16. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for the reply and tip about the subpanel! Ideally, it would be great if it was drag-expandable like some other inspector subpanels.

    Okay, so....I'm unclear on how I should proceed. Remove Microsplat from the terrains until I'm completely done with the painting? (I hope not, because MS affects the splat texture appearance and I do a lot of tweaking to the splat rules due to that.)
     
  17. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Yes, that would be the ideal scenario. The combination of this tool with Microsplat unfortunately remains finicky, since they both describe terrain layer data differently, hence there is no "Copy from" button. The documentation has more details on this.
     
  18. jarosss78

    jarosss78

    Joined:
    Feb 26, 2016
    Posts:
    2
    Hi,
    your tool is great but I cannot make the CURVATURE modifier work. It just blends the complete layer in and does not take any curvature of the terrain into consideration. Whats fun is that in the sample file it works fine. What am I doing wrong?
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    The curvature filter is something that depends on the resolution of the terrain's heightmap. If its too low (eg. 512px for a 2x2km terrain) the accuracy of the modifier suffers and tends to result in very broad strokes. But if the terrain is relatively flat (very shallow dents/crevices and no edges/peaks) it won't be much use either.
     
  20. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    I am testing your tool and can't use it at all with Microsplat. Any idea?

    Unity 2020.3.17 HDRP, the terrain was made using MapMagic2.

    upload_2021-9-22_10-44-0.png upload_2021-9-22_10-45-1.png
     
  21. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    I also get this error as soon as I add the script on an empty object. upload_2021-9-22_10-48-13.png


    Edit: I have the same problem on the demo scene.
     
    Last edited: Sep 22, 2021
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    I can't tell what would cause these errors I'm afraid. The first one is a null-ref on something that's created the moment the inspector is opened, before any GUI is drawn, so that's particularly puzzling.
     
    mick129 likes this.
  23. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    322
    Hello @StaggartCreations , I really like this asset, that I've discovered a little late. :oops:
    Anyway I have some problem with the noise, indeed my idea would be to create bit "patch" with grass to spawn forest over it, but modifying the Noise size wouldn't change too much, indeed that the maximum size that I've been able to achive.

    The red circle is my player. any advice to have a noise about the double of that size? :D
    Indeed if you try a noise scale of 5 and a scale of 250 will looks about the same.

    The only alternative that I can think about is to create some masks like for biomes.

    upload_2021-10-11_14-14-22.png
     
    Last edited: Oct 11, 2021
  24. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    This looks really nice! This is apparently the first layer-based tool for terrain texturing in Unity, right?
     
  25. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Ah yes, that's a little quirk, if the size value is over 100 it will actually appear to mirror and the noise gets smaller. So a value of 10 would actually result in the noise spanning over a larger area than with 5.
     
    MaximilianPs likes this.
  26. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    322
    I have another doubt, about the Slope, is Min and Max Falloff in meters or is just a procedural value?
    I would like to achive sharp blend between rock cliff and the grass on the ground, but if I lower the Falloff (1 and 1.1), MinMax angle value for the cliff need to have very low decimal, like from 3 to 90. o_O
     
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    The slope modifier works with angles in degrees. You can see the falloff parameters as a way smooth out harsh borders. With a minimum slope of 45º and a falloff of 15º, a smooth gradient is created between 45º-60º. So for a sharp transition, the falloff should ideally just be 0º.

    How aggressive the modifier responds to parameters is largely dependent on how much elevation changes the terrain has. For a relatively flat terrain, a few degrees will appear to make drastic changes.
     
  28. jarosss78

    jarosss78

    Joined:
    Feb 26, 2016
    Posts:
    2
    Thanks for your reply but I cannot make Curvature to work at all. All other modifiers work fine but Curvature is not. It doesn't matter if the terrain is 1000x1000 meters or 50x50 meters tall or if its steap of flat. I used a 512x512px and a 1024px RAW file from photoshop btw (clouds filter).
     
  29. jason0663

    jason0663

    Joined:
    Dec 4, 2020
    Posts:
    36
    Hi, when i load terrain painter into unity I get this error......

    The .meta file Assets/ProceduralTerrainPainter.meta does not have a valid GUID and its corresponding Asset file will be ignored. If this file is not malformed, please add a GUID, or delete the .meta file and it will be recreated correctly

    .....no files are placed in the asset folder in unity. If i delete the original meta file it fixes the error but it leaves a blank folder in assets. As well, is this runtime or real-time? Are changes seen automatically. How it is, i see no changes real time and if I run it unity crashes.

    If I delete it from unity and redownload into unity from the site, I get an error.......

    InvalidCastException: Specified cast is not valid.
    sc.terrain.proceduralpainter.TerrainPainterInspector.OnEnable () (at Assets/ProceduralTerrainPainter/Editor/TerrainPainterInspector.cs:95)


    UPDATE: was able to download a copy that loads in unity and works. However, whenever I hit play unity immediately crashes always. Is there anyway to temporarily disable it for runtime or is there a fix or something on my end? Using unity 2019.3. As well, if I attempt to use the heatmap at all, it crashes. Is there such a thing as too many layers in relation to splatmap size? Right now its at default setting for splatmap size and Im using a dozen layers. Anyhow, I like how this paints and find it very usable "IF" I can stop it from crashing at runtime and or using heatmap.
     
    Last edited: Nov 10, 2021
  30. maldewar

    maldewar

    Joined:
    Dec 21, 2016
    Posts:
    52
    Hi Staggart!!
    I've stumbled up your tool, it is really cool! great work!!
    I'm most surely having an issue using the modifiers, the only time I get them to work is by using them in the substract mode. Even when using the demo scene... it looks fine recently opened, but if I modify any layer or modifier parameter, as it repaints each layer covers the whole terrain. Here's the image for the demo scene:
     
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Had a look at your URP stuff. I haven't bought anything but I think the quality of your stuff is pretty nice. Do you have any trials for your assets? I'm cautious as I tend to build for weird hardware.
     
    Teila likes this.
  32. maldewar

    maldewar

    Joined:
    Dec 21, 2016
    Posts:
    52
    Hi! The problem has solved switching the player frol OpenGLCore to Vulkan (I'm on Linux by the way).
    Now all blending modes all working great!! :D
     
  33. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Thanks for the screenshot! OpenGL caught my eye immediately, it's not something I had tested since there isn't anything going on that's usually different between graphics API's. But I get the exact same result when using OpenGL. It seems the "multiply" blend mode in particular is breaking.

    Apparently that's a known limitation, but that's definitely news to me. I don't think anyone would assume a simple multiply operation isn't supported :p Ironically, the solution the Unity manual proposes doesn't actually exist. But Vulkan/Metal have otherwise previously worked fine.

    Trials aren't practical beyond C# code I'm afraid. But if something doesn't work as advertised on any given supported platform, a refund is always possible. Though I'd be quick to investigate as to why and how, in order to land on a fix.
     
    maldewar and hippocoder like this.
  34. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    322
    After upgrading the project to 2021.3.2f1 and URP the terrain visibility is gone :oops:
    Any idea to fix it?

    upload_2022-5-18_11-51-18.png

    [EDIT]
    Never mind, I've fixed it, by setting the TerrainLit as material in the TerrainSettings :D
    upload_2022-5-18_13-23-13.png
     
    Last edited: May 18, 2022
  35. rglennbarker

    rglennbarker

    Joined:
    Dec 2, 2018
    Posts:
    1
    Thanks for this great tool! I was able to pretty quickly fill in a mountainous terrain using the slope & height modifiers. But I have to give a +1 to the others having trouble with the Curvature modifier. I haven't found a single combination of slider values to make it produce anything other than a uniform effect across the whole terrain.
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    The curvature modifier is strongly dependent on the resolution/detail of the terrain's heightmap. If you were to create smooth hills using the brush tools the terrain wouldn't have any sharp enough features to represent ridges or crevices. In such a context, a mere <1% change on the min/max slider can result in completely flooding or removing the result. Because the differences in curvature is so small over the span of the surface.

    You can see this terrain has fine features, due to hydraulic erosion being applied:
    upload_2023-2-21_15-13-12.png

    Resulting in the ridges being picked up as convex curvature (slider at 0.25-1)
    upload_2023-2-21_15-14-34.png
     
  37. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Version 1.0.4 is now available!

    upload_2023-3-11_17-58-26.png

    Changelog:
    For anyone familiar with the asset, please consider writing a quick review on the store page, this'll go a long way towards continuity of it.
     
  38. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Ha, finally figured out what's really happening here. The curvature modifier itself works as intended, however if instanced rendering isn't enabled on a terrain, the terrain doesn't contain a normal map. Which in turn the curvature modifier relies on.

    So it comes down to this checkbox:

    upload_2023-3-14_14-28-15.png

    It's the first thing I enable on any new terrain, hence was never able to reproduce any issues :p
     
    Malerouille likes this.
  39. PrawnJeremy

    PrawnJeremy

    Joined:
    Aug 20, 2013
    Posts:
    35
    @StaggartCreations

    Thanks for the tool, it's been extremely helpful. I did run into an issue with it not properly calculating terrain bounds. I'm using 9 5kx5k terrains. In any case, I used ChatGPT to write a method that works for me and wanted to share in case you find it useful.

    Code (CSharp):
    1.         public static Bounds RecalculateBounds(Terrain[] terrains)
    2.         {
    3.             if (terrains == null || terrains.Length == 0)
    4.             {
    5.                 Debug.LogError("Terrain array is null or empty.");
    6.                 return new Bounds(Vector3.zero, Vector3.zero);
    7.             }
    8.  
    9.             Vector3 min = terrains[0].transform.position;
    10.             Vector3 max = min + terrains[0].terrainData.size;
    11.  
    12.             for (int i = 1; i < terrains.Length; i++)
    13.             {
    14.                 Vector3 terrainMin = terrains[i].transform.position;
    15.                 Vector3 terrainMax = terrainMin + terrains[i].terrainData.size;
    16.  
    17.                 min = Vector3.Min(min, terrainMin);
    18.                 max = Vector3.Max(max, terrainMax);
    19.             }
    20.  
    21.             Vector3 center = (min + max) / 2f;
    22.             Vector3 size = max - min;
    23.  
    24.             return new Bounds(center, size);
    25.         }
     
  40. AlwaysBaroque

    AlwaysBaroque

    Joined:
    Dec 20, 2014
    Posts:
    33
    @StaggartCreations

    Procedural Terrain Painter and Vegetation Spawner both outstanding assets thanks for both of them.

    Im currently writing my own terrain streaming code and working with rather large tile sets,
    Terrain painter bogs down when I throw a large number of terrains at it and iteration times
    would be tedious doing them one by one.


    Presuming that TerrainPainter is set up as a scene object and the ModifierStack is configured from a
    template terrain, would it be possible to change the TextureMask as I iterate through each terrain prefab.
    If so what bould be the general sequence and methods involved?

    Thanks in advance.
     
  41. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Happy to hear they're to your liking :)

    Every terrain layer (texture) configured on the TerrainPainter component has its own ModifiedStack (a List<> of Modifier classes). Which could contain a Texture Mask modifier. So it would be possible to grab it, alter it, then repaint the layer in question on all the terrains.

    So it could be:
    Code (CSharp):
    1. TerrainPainter painter = TerrainPainter.Current;
    2.  
    3. int layerIndex = 0; //Simply assuming the first layer on the component
    4.  
    5. //Find the first TextureMask modifier in the stack
    6. TextureMask mask = painter.layerSettings[layerIndex].modifierStack.Find(x => x.GetType() == typeof(TextureMask)) as TextureMask;
    7.  
    8. if (mask)
    9. {
    10.     mask.texture = Texture2D.blackTexture; //Some texture!
    11.  
    12.     //Now repaint the specific layer
    13.     foreach (Terrain terrain in painter.terrains)
    14.     {
    15.         ModifierStack.Configure(terrain, painter.bounds, painter.splatmapResolution);
    16.         ModifierStack.ProcessSingleLayer(terrain, layerSettings[layerIndex]);
    17.     }
    18. }
    Untested code though, but it does follow the correct trajectory.
     
    AlwaysBaroque likes this.
  42. maximalniq

    maximalniq

    Joined:
    Feb 25, 2014
    Posts:
    46
    Hey, I am trying to use your package to paint a terrain that is procedurally generated on quest 3. I call RepaintAll() on Start. It works in the Editor, but on device it does not. What could be possibly wrong ?
     
  43. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    One possible explanation is that the OpenGL rendering API isn't supported. Best to use Vulkan on the Quest.

    Another is that the modifier/filter shader isn't being included in a build, this will be the case if the Terrain Painter component is solely being created at runtime. If so, move the "Modifier.shader" into a folder called "Resources".
     
    maximalniq likes this.
  44. maximalniq

    maximalniq

    Joined:
    Feb 25, 2014
    Posts:
    46
    It was by default on Vulkan, i tried OpenGL, still no progress on device. I also moved the modifier shader to the Resources folder, still no progress. I moved my project to use URP, still nope. Heightmap, control texture and base texture. Are all the same. I see some small spots with the other texture, but the terrain is painted with the main texture only on device. In Editor it works. Auto Repaint is turned off and I am calling from script painter.RepaintAll(); painter is a reference to a TerrainPainter object with the Terrain Painter script.

    I made my own simplified Terrain Painter script, and it works, but I want your package as it seems very well built and have a lot of features.
     
  45. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    After a little digging I found out that Vulkan doesn't support 16-bit render textures, just like OpenGL, which is the format of a terrain's heightmap. It results in much of the painting coming out garbled.
     
    maximalniq likes this.
  46. maximalniq

    maximalniq

    Joined:
    Feb 25, 2014
    Posts:
    46
    So I need to modify your script to convert the heightmap to 32 bit? Can you show me where I need to do that, I will buy your stylized water package :D
     
  47. Morseliot

    Morseliot

    Joined:
    Jan 10, 2015
    Posts:
    71
    Hi,

    I've encountered an issue with the tool twice already, and it's quite frustrating. While the tool itself is good, these bugs are really annoying because they require recreating the entire setup from scratch. Even saving the settings to the preset doesn't seem to help.

    Here's what happened:

    I have two terrains in the scene, each with its own painter. However, at some point, the tool seems to be missing its settings.




    Unfolded.





    Update:
    I've realized why this happened. The terrain that was using the painter was copied to another scene. So, if you try to manipulate the copied terrain from another scene (not the original one), it's missing its settings.
     
    Last edited: Feb 9, 2024
  48. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    I can't see any of the images you posted, but I take you have figured out what the issue was. Copying an object from one scene to another should be fine, but cross-scene references to terrain objects may pose an issue.
     
  49. J_Price

    J_Price

    Joined:
    Mar 26, 2017
    Posts:
    2
    Really cool asset, but how am I supposed to texture multiple terrains and keep their respective setups for future adjustments?
     
  50. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    You could a separate Terrain Painter component, and assign a specific set of terrains to it. The component will only target the terrain objects assigned to it.