• Welcome, Guest. Please login.
 
December 19, 2024, 04:15:33 AM

News:

Kart Racing Pro release13e available! :)


How was the terrain/grass texture at Zuera done?

Started by [SATD] pl4sma2389, February 01, 2023, 11:18:19 PM

Previous topic - Next topic

[SATD] pl4sma2389

Hello all,

By now I've worked on many different tracks for KRP and other games/sims, such as AC. I've gotten a handle on what the things are that are difficult for me to do, and the things that would make track creation easier (or the outputs more consistent, realistic, and performant). One of those things is the creation of the grass surface shader and textures, as well as the asphalt shaders and textures. I'm not talking about 3D grass and the various maps, I've figured that out-- what I want to know now is how to get a "multilayer" style effect in KRP.

So far, when I create the terrain texture, I use a massive 8192x8192 texture. I do this instead of tiling a smaller texture as it allows me to vary the color over a large area, as well as keep detail in the close-up. However, this causes the file size of the track to be very large, even if the texture is compressed to a DXT1 .DDS.

The way other games (Assetto Corsa) appear to work around this issue is by using what Kunos calls a "multilayer" shader. The shader uses a mask texture to control the appearance of four detail maps. The mapping texture controls the appearance of the detail maps through the value of its R, G, B, and Alpha channels. Each channel controls one detail texture. The detail textures' UV mapping is multiplied a preset number of times (an improvement on it would be to make that configurable, but I believe other Kunos shaders support that and probably should be used instead for that application). In total, the "Multilayer" shader supports a diffuse texture, a mask texture, and four detail textures.

Now, as far as the KRP Documentation on the Wiki says, a similar shader is not usable in KRP.

My question, then, is this: How was Zuera's grass texture made? It appears to use a large, low resolution diffuse texture and then a number of detail textures that show up based on the color of the diffuse texture-- or possibly a mask texture.

You cannot see attachments on this board.

It's possible that this is also just a very large texture. Zuera's .map file is the same size of my NTK's .map file (available on my server, link in signature) (104mb), which uses the single, monolithic texture approach. However, my NTK track is still very much a work in progress, and as buildings and such with more textures are added, the size of that file will grow.

Are there more as-of-yet undocumented shader options for hard surfaces? I know that deformable surfaces such as are supported in MX Bikes can use much more complicated shader profiles and such, but hard surfaces can't to my knowledge.

My current workaround for this issue to get some level of detail on the small scale, asides from using a very large texture (which with larger tracks isn't enough sometimes), is to utilize the normal/spec map UV multiplication feature along with a fairly high-contrast normal map to "simulate" the blades-of-grass texture I would like to be able to repeat decoupled from the main diffuse texture.

(On a side note, I wish we could further decouple the normal and spec maps from each other in terms of UV multiplication-- I would like to have a high number of multiplications of a normal map but to keep the spec map at 1x mult, though that's a separate issue entirely)

Any ideas or knowledge anyone?
Join discord.gg/9cv8aeQr6S for updates on my projects and to make requests.

Cory_Hayes

I'll message you on discord, will be easier to explain there.

[SATD] pl4sma2389

Thanks to Cory's explanation to me over Discord, I was able to deduce that this process is actually the same as what is described on the KRP Documentation as "Tyre Mark Overlay". The explanation there is a bit vague, so here's a better one (for Blender specifically):

Assign a texture to the alpha channel of the Principled BSDF of your shader you want to add the detail map to (ignore that color information is going to a scalar value, it still works as color)
     - This texture, if it does not have an alpha channel, will be multiplied with whatever your diffuse color texture is
     - If it does have an alpha channel, that will act as the mix control and it will be mixed between the diffuse color texture and the detail map
Create a second UV map on the object and scale it up (or whatever) to scale up the repetitions.
Name this UV map exactly the same as the texture you assigned to your alpha channel (without extension).
Export to FBX, FBX2EDF, and enjoy!

https://cdn.discordapp.com/attachments/913301511684108358/1070522670698999938/image.png
Join discord.gg/9cv8aeQr6S for updates on my projects and to make requests.