Splat Terrain Texturing

Show off your mod creations or just a work in progress.
Post Reply
User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: High Resolution Terrain Textures

Post by TheLacus »

No ETA or promises on the final result, but i'm working on terrain texturing using splat maps. The advantage of this approach is that is should remove or alleviate almost any kind of bad tiling or misplacement. Of course this is only for modded textures, the current solution does a great job at recreating original Daggerfall terrain.

For those unaware, Daggerfall terrain is composed of tiles: there are a few main materials (grass, mud/ground, water) and a bit less than 60 textures for transitions (i.e. half grass - half ground). They are combined to create a specific terrain layout, but the result is not always perfect and you can tell if you play with high resolution screen and textures.

Texture splatting is a more modern approach. As a start, the following screenshot was taken with only grass and ground full tiles, plus a recreation of half-half transition. All predefined transitions need to be recreated with this approach.

EDIT removed old screenshots

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: High Resolution Terrain Textures

Post by MasonFace »

Excellent! I wish I had time to pursue my heightmap blended splatmap shader, but I got bogged down trying to figure out how to convert the generated tilemap into splatmap.

What are the white sections in your pictures? Oh I see, the white parts are the sections of the splatmap where tilemap transitions haven't been created yet.

Also, are you limited to just four textures corresponding to the splatmap's RGBA channels or are you doing a multi-pass approach?

The transitions look fantastic. Thank you for pursuing this!
Last edited by MasonFace on Fri Jul 10, 2020 12:51 pm, edited 1 time in total.

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: High Resolution Terrain Textures

Post by King of Worms »

Im also very glad you still working on this, as I was not able to add normal maps on my own.

Only - quite major - issue I had with this mod when I tested it few month back was, that the textures are too bright. It looks ok until the sun is full, than its way too much and I reverted back to my textures.

This can be corrected tho, no big deal. Im looking forward to the new splat map shader.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: High Resolution Terrain Textures

Post by TheLacus »

MasonFace wrote: Fri Jul 10, 2020 12:17 am Excellent! I wish I had time to pursue my heightmap blended splatmap shader, but I got bogged down trying to figure out how to convert the generated tilemap into splatmap.

What are the white sections in your pictures? Oh I see, the white parts are the sections of the splatmap where tilemap transitions haven't been created yet.

Also, are you limited to just four textures corresponding to the splatmap's RGBA channels or are you doing a multi-pass approach?

The transitions look fantastic. Thank you for pursuing this!
Hi!

It's mostly a manual process of creating corresponding alpha maps for all tiles. It's quite boring, but it should be a one-time process. I'm using a resolution of 512x512, which means that each tile has 4x4 pixels of splatmap. I'm storing this information inside an array of floats for every layer, organized as an atlas of 4x4 matrices, one for each tile, with the same layout as the tilemap atlas (only one of the four rotations). It's simple enough to parse visually and make changes and has been enough to get me started by filling it with 0.25f, 0.75f and so on. Many tiles reuse the same pattern so i'll probably migrate to a different approach eventually. It will also be simple enough to export this data as greyscale textures for further edits, if i make the jump to 8x8.

During terrain promotion, the tilemap is used to create a splatmat on the C# side using the float atlas/matrix (with the required rotation), which is then assigned via Unity API. I'm relying on the built-in shader, at least for the moment. It supports multi-passes so i'm not worried about that, what it really misses is height blending. It's actually supported on HDRP and URP pipelines, but not by the shader for the default pipeline. This alone makes your approach a very interesting one! I don't think is a top priority, but maybe the idea will come back in the future.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: High Resolution Terrain Textures

Post by TheLacus »

King of Worms wrote: Fri Jul 10, 2020 10:36 am Im also very glad you still working on this, as I was not able to add normal maps on my own.

Only - quite major - issue I had with this mod when I tested it few month back was, that the textures are too bright. It looks ok until the sun is full, than its way too much and I reverted back to my textures.

This can be corrected tho, no big deal. Im looking forward to the new splat map shader.
Thanks. I believe is related to gamma vs linear but i haven't properly investigated this yet.

User avatar
pango
Posts: 3358
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: High Resolution Terrain Textures

Post by pango »

This looks really good!
Could it be possible to add some noise in the alpha maps? I imagine that at the border of, say, grass and road, you'd find patches of grass/road that deviate from the theoretical straight frontier.
I assume the difficulty would be to make that noise also tile seamlessly...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: High Resolution Terrain Textures

Post by King of Worms »

Looks great with this light! Yes I hope we get that new lighting some day. Gamma vs linear it is. Than I switch to your version for sure.

Have u tryed to match/compare the brightness/saturation to originals? Originals are quite dark actually.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: High Resolution Terrain Textures

Post by TheLacus »

pango wrote: Sun Jul 12, 2020 1:30 pm This looks really good!
Could it be possible to add some noise in the alpha maps? I imagine that at the border of, say, grass and road, you'd find patches of grass/road that deviate from the theoretical straight frontier.
I assume the difficulty would be to make that noise also tile seamlessly...
This is a valid point, right now edges are very uninteresting. I'll see what i can do, but resolution of the splatmap is the limit and i wouldn't want to increase it too much.


I changed idea on height blending and decided is worth to work on it before doing further improvements to alpha maps.
I edited the standard terrain shader to read height information from the alpha channel (created as greyscale of main textures) and use it for blending. I think the result it promising, at least for solid materials.

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: High Resolution Terrain Textures

Post by MasonFace »

The height blending looks fantastic!

I really think this splatmap technique is going to make certain types of future mods such as Roads of Daggerfall much easier and better looking, since they should be able to simply draw lines or bezier curves onto the splatmap to draw roads or dirt paths.

User avatar
DigitalMonk
Posts: 111
Joined: Sun Nov 10, 2019 8:01 pm

Re: High Resolution Terrain Textures

Post by DigitalMonk »

TheLacus wrote: Tue Jul 14, 2020 9:25 pm I'm not really happy with water. It looks great up-close, but i can't fully avoid the "floating" look from a distance...
Water is hell to display, and really needs pixel shaders to pull off. Looking at it from a distance, you'd have to support mixtures of reflection (sky, nearby objects) and refraction (you'd tend to see the the far shore tinted slightly "projecting" quite a ways out into the body of water). Not sure how to even approximate that with a flat texture replacement...

OTOH, the height-map-based blending is awesome! Stuff from the nearby surfaces collects in the pockets of the material, just like it would. Brilliant idea!

Post Reply