Texture based version of A.N.T

I’m a big fan of the A.N.T. Landscape add-on. Written by @Jimmy_Haze, it’s been shipped with Blender for what seems like forever! I’ve used it quite a bit (and there’s even a little of my code in the current version), but I often think it would be good if instead of creating geometry and vertex weights, it produced a height map, normal map and texture masks. It would be more flexible and save fiddling with high density meshes and baking.

I’ve had a go at doing this. With Jimmy’s permission, I’ve made a version called TXA Landscape (TeXtured Ant). It’s at an alpha stage in that not all of the original ANT functions are supported, but I think it’s at a stage where it’s useful.

I also thought it would be handy if it provided sample procedural materials using the erosion masks generated by the add-on. It’s quite a lot of work to do this, so I asked the author of the NodeCustomBuilder add-on - @HaiKalle - if I could use the import part of his add-on, and he generously agreed. This allows materials to be supplied with the add-on in JSon format, which is very neat! There are a few materials supplied with this alpha version, and I’ve tried to structure them a little, but there’s lots of scope for improvement. Please feel free to post better ones!

The add-on is only suitable for Blender Versions 2.81, 2.82 and 2.83 at this stage.

The GitHub page for the the add-on is
https://github.com/nerk987/txa_ant

The zip file can be downloaded there, or the direct link is:
txa_ant_2_81_5.zip
(V2.81.3 included island materials, V2.81.4 has a desert material and presets )

For a quick start introduction:

  • Install the addon
  • 3D View ‣ Add ‣ Mesh menu ‣ TXA Landscape
  • Note that the landscape is a simple plane with subdivision and displace modifiers
  • Set Viewport Shading to Material Preview mode
  • Locate the Eroder Params panel in the TXA Landscape Sidebar tab
  • Change Preferred Material to Alpine, Volcano or Forrested
  • Click the Landscape Eroder button

Alternatively, watch the meandering video below…

29 Likes

Briliant work !!

ahh thank you very much :smile:

In order to make this work in Linux, I had to search out and replace “\\” with “/” in two or three files. After that, it worked great.

1 Like

Is it possible to download your corrected files, please?

txa_ant.zip (152.8 KB)

Here you go.

2 Likes

I’m going to try this out. :slight_smile: looks cool, thanks.

An add-on to combat Automatic Negative Thoughts, interesting. :wink:

Thanks, I should have realised that would be an issue. I’ll try to improve that next update.

Thanks a lot…I will try on my linux! Ciao.

Here’s a revised version. Hopefully that fixes the pathname issues when running on linux. If you could give it a try, that would be great.

txa_ant_2_81_2.zip

There are a few other changes as well relating to the ‘water plane’ option, although this is very much still a work in progress…

This image made by specifying a water plane at 0.1 in the re-do panel, then doing erosion with a forrested texture.

4 Likes

Still A.N.T. related but more game engine oriented: do you think it’s possible to make chunks and lods from a selected A.N.T. land? Looks like someone made a patch (automatic process) for this specific request years ago, I wonder why it’s not bundled within the ‘official’ addon [Addon][WIP] Ant Landscape XY Offset

@Nerk hi, I’ll give this a run shortly. thanks. Currently built in ant needs some repairs. It might be worth considering Would you be interested in taking on some of the issues? We could certainly look at incorporating your new features or once you have everything done, update built in ant with your version.

Current issues with built in ant:

  1. In the addon I’ve disabled the smooth and removed a ui button. This was causing issues with the mesh drawing black in the viewport. this stopped the issue but did not fix it.

  2. In the presets the default is different to the first run landscape defaults. Partly the smooth shading issue but some other parameters and noise types are mismatched. The Preset>Default works far better than the actual default.

  3. There’s an issue when you raise the subdivision x and y to 512 and then adjust the random seed. This is causing artifacts and lines across the mesh.
    Edit: At first tests it seems the Perlin type is causing the issues with lines.

https://developer.blender.org/diffusion/BA/history/master/ant_landscape/

Thanks. Keep up the great work. If your interested we could catch up in https://blender.chat #python room.
Your most welcome to participate in the future development of ant.

1 Like

Your update for Linux worked great with Linux Mint. :slight_smile: Please continue, this is awesome work. Can you use an existing mesh with it, or does it require a height map?

Control over level of detail wass one of the main drivers to move from creating geometry to creating height maps and textures.

I’ve been more into making movies than games, but many of the issues are the same. I’m pretty sure Unity and UE have features similar to cycles micro-displacement. This means you can create a detailed height map and the game engine will display more detail on nearby parts of the landscape if you set it up right. I could be wrong!

You have made me think about UDIM’s however. I haven’t really looked at this, but it might be cool to specify UDIM dimensions, and generate an array of height maps in UDIM format for large landscapes.

By the way, speaking of cycles micro-displacement, it’s easy to change the landscape txa generates from a displace modifier.

  • Change to cycles
  • Delete the displace modifier
  • Enable adaptive subdivision on the subD modifer
  • On the material, under settings, change the displacement to displacement only
  • In the shader editor, connect the ‘ErodedHeight’ texture to the displacement on the output via a displacement node.

It works pretty well if the texture had enough resolution.

1 Like

Happy to have a look at the issues in the current A.N.T. version!

I have some thoughts already on the first two issues.

The third issue is still a problem in the txa version, and does seem to be a bug in Perlin mathutils.noise and can be avoided with New Perlin noise. It could be made default, but it seems a shame to lose the fairly iconic shape of the default landscape.

I’ll be in touch…

1 Like

Thanks for testing!

You can’t use an existing mesh I’m afraid. (And the addon itself doesn’t really generate a mesh as such unless you apply the modifiers). You can probably bake a height map from an existing mesh.

You can use your height map fairly easily. Just generate a landscape with the same texture resolution, delete the generated height map and rename yours to match. Then you can erode with the associated procedural materials. You can also edit the height map with the image editor.

1 Like

The original approach. Thanks

Another update…

txa_ant_2_81_3.zip

I’ve finished with the ‘water plane’ or ‘island’ function including materials, and the add-on is more or less feature complete. I haven’t done ‘mesh displace’ - it wouldn’t be hard to do using the vector displace node, but it seems better just to use built in blender noises with that. I’m also not sure how I could do the ‘sphere’ or ‘planet’ function with height maps and no seams. I might try to re-instate the existing ANT geometry function for that. I’ll now work fixing various issues, and perhaps improving the materials. If anyone wants to send me a good material, I’d be interested!

With the island materials, I initially did the foam area as a material on the water function. The downside was the water had to move with the island, and multiple islands were tricky. It’s now done all in the main landscape texture, using transparency. That way the island hovers just over the water and you can have as many islands as you want over the same water pane.

The following image was made by just the following steps:

  • Add a TXA Landscape
  • In the redo panel, select ‘Water Pane’
  • From the TXA Landscape>Eroder Params panel, select the material ‘Forrested’
  • Select ‘Landscape Eroder’
  • View in Eevee or Cycles

There are island versions of all the materials. Keep in mind that once a material is generated, the add-on wan’t overwrite it (in case you’ve improved it). So if you make a non-island version of ‘Forrested’ for example, you have to delete or rename the ‘antxx_forrested’ material before using the eroded function to make another.

The erosion panel has a few parameters is there is a water pane:

  • Beach Height specifies how high above the water the beach starts to slope.
  • Beach Slope is 1.0 is flat, and 0 is unchanged
  • Foam Depth controls how far out the foam and colouring goes
  • Beach Erosion (0-1) sets whether the river erosion cuts through the sand and foam

Depending on the settings, the resulting material may have to be tweaked to make sure the foam/shallow is transparent at the edges.

BeachErosionParameters

4 Likes

Hi, the first thanks for the addon but on 2.82.6 & macos 10.13.6 there is an issue when you push Landscape button, this is the console message:

Error: Traceback (most recent call last):
  File "/Users/User/Library/Application Support/Blender/2.82/scripts/addons/txa_ant/add_mesh_ant_landscape.py", line 610, in invoke
    return self.execute(context)
  File "/Users/User/Library/Application Support/Blender/2.82/scripts/addons/txa_ant/add_mesh_ant_landscape.py", line 816, in execute
    bpy.ops.mesh.txa_ant_landscape_regenerate('EXEC_DEFAULT')
  File "/Applications/Blender/BLENDER 2.82/Blender.app/Contents/Resources/2.82/scripts/modules/bpy/ops.py", line 199, in __call__
    ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Error: Traceback (most recent call last):
  File "/Users/User/Library/Application Support/Blender/2.82/scripts/addons/txa_ant/ant_functions.py", line 423, in execute
    nodedict = SaveImageNodes()
  File "/Users/User/Library/Application Support/Blender/2.82/scripts/addons/txa_ant/eroder.py", line 57, in SaveImageNodes
    for node in nt.nodes:
AttributeError: 'NoneType' object has no attribute 'nodes'

location: /Applications/Blender/BLENDER 2.82/Blender.app/Contents/Resources/2.82/scripts/modules/bpy/ops.py:199



location: <unknown location>:-1