I play Forza Horizon 3 sometimes and love to stroll around every now and then and check out the textures and models. I am going to start working on some roads and such and was wondering how they probably did it.
Mostly I am interested in the edges or borders of the roads where it goes from a tiled texture to a nice looking seamless edge of a road.
Also, I know the line is a decal, but how would you make it curved like that?
Replies
The edge of the road will just be a blend between the road material and ground material.
I expect they use some sort of procedural geometry for the track/decals etc. so they can have loads of detail on the curvy bits
So how would the decal seemingly repeat like a tiled texture, and they would have to create a separate piece of geometry to put the decal inside of?
http://polycount.com/discussion/comment/2490402/#Comment_2490402
You can use a channel like the alpha (which is left unused on opaque albedo textures) to store some sort of noise or height representation, and use that as an additional blending factor to get that fuzzy transition between dirt and asphalt. In this case the textures act as decals, being layered in your shader.
You'd have to write something specific for ue4 or unity if you wanted to procedurally tessellate and uv a mesh derived from a spline. But
You could set it up with spline meshes in ue4 without to much trouble. I'm not sure on whether it's possible without code in unity
It might not work like that in forza, without confirmation from the developers we're just guessing.
Hmm, for now I am just trying to think about what their workflow may be, I would like to try to use their quality as a goal on my projects, their buildings, roads etc are low poly and blend really well into the environment. I am going to have to make some road sections and try different methods I guess
I don't know if they just blend the two tiled materials together all the time, sometimes it looks like there is a border on some roads where it's really natural, like when the road is paved and you can see that the asphalt is higher than the ground to the side and it is a bit curvy.
I bumped into this, you don't think they use something similar to that do you?
https://www.youtube.com/watch?v=Wvt9LvHZBDA
Im going to have to look into how you would make a road like that further, but I think that looks like the best workflow.
https://www.gamasutra.com/view/feature/2987/tool_postmortem_climax_brightons_.php?page=2
Blue wire frame would be the base mesh, green are the overlay meshes.
I think you can use Intel's GPA tool to see the geometry wireframe of a moment in time in the game, it could give you some clues on what's behind the visuals.
https://software.intel.com/en-us/node/597258
edit: oh, render-state overrides are only available for DX 9/10/11, not 12.
From a post by @radianceF0rge, there's another tool called renderdoc (not sure if it supports showing the wireframe or textures under DX12):
https://renderdoc.org/docs/index.html
I suspect the blend at the edge of the road is height based and done within a material, another mask or vertex color is probably used to offer unique locational variation or blend between sub materials.
These are perfectly standard techniques in wide use on current hardware.
I think the top picture was not exactly what I should have used, this one has a road with more of what I was talking about. See how it looks kind of random and more like what roads are IRL? Its kind of wavy. I'm guessing they made the entire road as a section and tiled it, not sure how they would have done this as they have their special game engine.
The white lines will be simple decals, so colour info, mask for the shape, and then a global mapped detail effect that's shared across the asphalts, so the patterns tie into each other.
It looks like the detail effect is also doing something in the alpha mask too, as the white line edges have detail that matches the asphalt aggregates.
The edges, imo, would be just poly strips encompassing the road side.
So road-proper, an edge strip wide enough to cover the variation you want in the transition, then the terrain.
You'd then have all the edge variants you'd need in a big look up texture sheet. Just do random offsets to the UV, less wavy sets, more wavy, whatever.
The vert density isn't there on these edges to do interesting blending like you see in your example, where it's clear there is high definition details at the blending edge in the asphalt itself. Like individual chunks of asphalt aggregate sticking up through the sand.
The interface is then essentially a blend between the two materials (road and the terrain), with a mask, then normal and albedo on the asphalt side that are matched to the mask, so give interesting high definition details (like the cracks, chunks missing etc on the blend edge).
Then that same global detail effect for the asphalt is mixed over too, to tie the road into the transition road material.
I'm sure if you were desperate to figure it out for definite then driving around very slowly in varying conditions may give the game away.