Archive 17/01/2023.

Terrain Color and Detail map

rasteron

Some small stuff here as I was just messing around with the default terrain, I got a bit of detail and color map added to improve the terrain visuals up close and from a distance. Still a work in progess with the height or elevation modified to shorten the process and generate a 2048x2048 color map.

Color and Detail map only

Terrain Weights texture as Color map for testing and aligning uv scale

Imgur Set

johnnycable

Well, surely it looks better than default ones! :grin:
Proposed for entering next release!

KonstantTom

It looks really cool! :+1:
I think, this terrain should replace default one in Urho3D samples.

smellymumbler

Holy crap, that’s awesome! :smiley:

Can the detail map be added on a per channel basis? I mean, one detail for grass, another for rock, another for sand, etc.

johnnycable

With some modifications to the cubes, could take on a eerie, alien look…

Modanung

Our Flintstone-mobile would maybe require an upgrade then. I agree it’s prettier, but quite a bit more hilly too.

rasteron

Thanks guys! :slight_smile: As for other media like these replacement diffuse textures, it was a quick test so I have used L3DT to generate color maps out of its base textures and the modified heightmap. I have used the Temperate climate set on this setup and apparently the license prohibits redistribution of its base textures, so I’ll just find other alternatives that has either Public Domain or CC license when it is ready for PR or release.

rasteron

haha nice one :smiley:

rasteron

Thanks @smellymumbler! :slight_smile: Yes with some tweaks I think this is also possible.

Sinoid

Can the detail map be added on a per channel basis? I mean, one detail for grass, another for rock, another for sand, etc.

You can pack grayscale maps into channels of an RGBA texture and get the mixed value pretty easily.

vec4 blend = texture2D(BlendMap, texCoords).rgba;
vec4 detVal = texture2D(PackedDetailTextures, texCoords * DetailScalingFactor).rgba;
float dotValue = dot(detVal, blend);
float sVal = 1.0 - (dotValue * 2.0);
oColor += (-sVal);

Light-weight enough that you could also get an analytic normal from it with additional samples.

smellymumbler

Where would PackedDetailTextures come from? I imagine i have a single texture, a splatmap, where each channel contains a different material definition: sand, grass, rock and snow (R, G, B, A). I use those as masks to apply 4 different channels in my terrain. Each material contains 4 textures: diffuse, specular, normal and detail.

Sinoid

They’re grayscale detail-texture maps for each blend channel, not materials - completely different thing from detail-mapping.

smellymumbler

Like that? So, if i want specular/normal, i just have to load up more texture units and load the respective maps?

Victor

You can also use texture arrays to allow for more textures. :wink: You can do this manually (send a large texture to the shader which contains multiple textures), or using the TextureArray feature.