Splat Terrain Texturing

Show off your mod creations or just a work in progress.
Post Reply
User avatar
King of Worms
Posts: 3397
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: High Resolution Terrain Textures

Post by King of Worms »

Very good job on the water shader, finally its not static :)

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

Re: High Resolution Terrain Textures

Post by TheLacus »

Beta 3
Includes animated water and adjustments to smoothness to simulate a simple wet effect when it's raining. Also edited textures so they look more like classic Daggerfall.
Spoiler!
splat_temperate_beta3.jpg
splat_temperate_beta3.jpg (1017.83 KiB) Viewed 632 times
splat_mountain_beta3.jpg
splat_mountain_beta3.jpg (1.04 MiB) Viewed 632 times
splat_rain.jpeg
splat_rain.jpeg (353.14 KiB) Viewed 632 times
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

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

Re: High Resolution Terrain Textures

Post by King of Worms »

Great job mate. Im glad u managed to simulate wet surfaces, that was a thing I wanted for quite some time. Lovely mod!

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

Re: High Resolution Terrain Textures

Post by pango »

I love it!

Question, I used it with Realtime Reflections, and the water didn't look reflexive. That helps a lot identifying water as water, can it be fixed?
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
DolorousJohn
Posts: 19
Joined: Sat Aug 15, 2020 1:53 pm

Re: High Resolution Terrain Textures

Post by DolorousJohn »

Popped into the editor with it to take a look, absolutely beautiful, cant wait to see the finished product.

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

Re: High Resolution Terrain Textures

Post by TheLacus »

An early test in the editor with a reflection probe...
Attachments
water.jpg
water.jpg (538.11 KiB) Viewed 459 times
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Nystul
Posts: 1470
Joined: Mon Mar 23, 2015 8:31 am

Re: High Resolution Terrain Textures

Post by Nystul »

pango wrote: Mon Aug 17, 2020 6:05 am I love it!

Question, I used it with Realtime Reflections, and the water didn't look reflexive. That helps a lot identifying water as water, can it be fixed?
if you use a custom shader (instead of the standard shader, and outdoor tilemap shaders are custom shaders) then we need a variant of this shader in the realtime reflections mod that blends in the planar reflections.
the mod computes the planar reflections automatically by injecting into the scriptable render pipeline (2 reflection textures, one for the floor level and the sea level), for all materials with Standard shader the blending is done automatically but for custom shaders the blending in the final shader has to be done by the shader (just lerping the normal texture with the reflection texture). This last step is the reason my mod replaces e.g. normal terrain shader with a variant of it which does this blending. The variant has some additional shader variables (e.g. the reflection textures) that it needs to perform the blending. That is also the reason that I feel it should be done in the realtime reflections mod since it does only make sense there imo.

update: ok, I took a look - your mod uses a Standard-heightblend shader - I will take a look and see if I can make my mod compatible with this shader - might take some time though

@TheLacus: is there a version of your mod's code on github somewhere? would help to see how this Standard-heighblend shader is set up - is one of unity's build-in shaders? do the ground textures come with metallic gloss maps? (or did you just add them for the tests with the reflection probes? if so can you provide a dfmod package for me with ground textures with metallic gloss map textures included)

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

Re: High Resolution Terrain Textures

Post by TheLacus »

Hi, thank you for your answer!

I'm using an edited version of standard terrain shader, which combines layers using a splatmap. Specifically, i changed the blending step to perform heightmapping and made some other modifications, mostly to the water layer. Each layer uses two textures, albedo+heightmap (on alpha channel) and normal map, for a total of 6 layers per terrain.

Due to performance concerns i haven't used additional metallicgloss maps. As an alternative, i re-use the heightmap as a sort of roughnessmap to simulate wet terrain. However, the easiest way to retrieve water position is to use the channel reserved to water in the splatmap. It's how smoothness and metallic parameters are assigned in shader (water is red channel here, mixedDiffuse.a is inverse heightmaps combined and scaled for current weather):

Code: Select all

o.Smoothness = max(splat_control.r, mixedDiffuse.a);
o.Metallic = dot(splat_control, half4(_Metallic0, _Metallic1, _Metallic2, _Metallic3));
I tested it with a reflection probe that refreshes cubemap from player position every frame as well as with screen space reflections. In both cases it works just by setting metallic and smoothness parameters.

If it's not too complex to make it work with your approach, it would be the the best option for quality. I'll send you the source code and a test build within the next few days. :)
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Nystul
Posts: 1470
Joined: Mon Mar 23, 2015 8:31 am

Re: High Resolution Terrain Textures

Post by Nystul »

thanks for explaining!
TheLacus wrote: Tue Aug 25, 2020 7:07 pm I'll send you the source code and a test build within the next few days. :)
looking forward to try it out

User avatar
Hazelnut
Posts: 2497
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: High Resolution Terrain Textures

Post by Hazelnut »

Hi TheLacus, this looks great and after suggestion from MasonFace I took a look at the code and saw it's post processing the shader tilemap before using a new shader so i figured it would be compatible with the road painting into tilemap I'm using.. and it is. Roads look fantastic, but unfortunately as you can see in the screen below, dirt tracks look really derpy!
dirt.JPG
dirt.JPG (141.2 KiB) Viewed 261 times
This is kinda down to the tiles I had to use for a diagonal track which have this kinda shape but with the classic tiles it's sortof hidden so in game looks okay. You can still see it from above as shown below, but it's less clean and pronounced.
dirtDF.JPG
dirtDF.JPG (218.88 KiB) Viewed 261 times
Non diagonal dirt tracks look fine, although you can see they appear a lot wider than with the default tiles - too wide in my eyes, almost filling the entire tile instead of only half.
dirt2.JPG
dirt2.JPG (324.26 KiB) Viewed 261 times
I don't have enough understanding of what you're doing here to even conjecture what may be able to be done to make the splatmap version look more like the default shapes or to improve the road appearance. FYI cardinal tracks use double tile 11 and diagonal a combination of 12 and 51 to keep the path roughly the same width, rather than using a full block down the centre and half/half diagonals to fill in, which looks far wider than the cardinal tracks if I do that.

So, is there anything you can tweak in the splatmap code, or will I need to detect it and change the tiles I'm using? Or maybe its the hires tileset you're using? Is there any way for splatmapping the default tiles for comparison?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply