Home Technical Talk

How would you achieve these border details on road textures?

Easton
vertex
Offline / Send Message
Easton vertex
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

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    There's probably a lot more geometry there than you'd expect. 

    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 
  • Easton
    Offline / Send Message
    Easton vertex
    Is this usually game engine specific or could it be done in a modeling software? How would someone do this in Unity or UE4?

    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?
  • RN
    Offline / Send Message
    RN sublime tool
    Reminds me of the height-map based blending that Eric explains in here:
    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.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    It would be an in engine thing if I were making it,  I wouldn't want to be storing the track as real geometry.

    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
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    You would probably just do this with a fairly complex shader and some loose geometry. I would put the stripe on with a second UV channel and some masks. I'd use vertex color for the blend between the dirt and the road. Making proceedural splines seems like it make the level load time really long. But it might be worth it to test it.
  • Easton
    Offline / Send Message
    Easton vertex
    So when you say procedural splines you mean by using geometry right? So something like a 4 inch wide spline then the decal would get placed in it and follow the spline?
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Yeah, but you'd generate the geometry and UVs on the fly. 

    It might not work like that in forza,  without confirmation from the developers we're just guessing. 
  • Easton
    Offline / Send Message
    Easton vertex

    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.

  • Easton
    Offline / Send Message
    Easton vertex

    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.

  • Eric Chadwick
    This is an older article (PlayStation 2!) but the pics and text are great, worth a read.
    https://www.gamasutra.com/view/feature/2987/tool_postmortem_climax_brightons_.php?page=2
  • codyaq2
    Offline / Send Message
    codyaq2 greentooth
    More than likely they are overlay meshes created from the road/road edges as a spline, then made into a mesh and uv mapped accordingly based of alpha textures. In the shader the same detail normal map used on the road would be applied to the road line and road edge and some other maps as well to make it consistent.

    Blue wire frame would be the base mesh, green are the overlay meshes.



  • SebastianBielecki
    Offline / Send Message
    SebastianBielecki polycounter lvl 4
    This is probably achieved with vertex paint of 2 materials. Check out how env artists are making those blendings in UE4. There are cool breakdowns on YT from CG society.
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    codyaq2 said:
    More than likely they are overlay meshes created from the road/road edges as a spline, then made into a mesh and uv mapped accordingly based of alpha textures. In the shader the same detail normal map used on the road would be applied to the road line and road edge and some other maps as well to make it consistent.

    Blue wire frame would be the base mesh, green are the overlay meshes.



    Using alphas like this is super expensive. And would make the ground draw pretty slowly. Shader vertex blending, or just multi-material blends in the shader, are the way to go. 
  • codyaq2
    Offline / Send Message
    codyaq2 greentooth
    Using alphas like this is super expensive. And would make the ground draw pretty slowly. Shader vertex blending, or just multi-material blends in the shader, are the way to go.



    I dont know where you got that information from but that is incredibly incorrect, especially on those next gen console devices.

    If that was the case, then artists would have to cut in geometry to the ground with supporting edges for the vertex painting/blending. Imagine having to cut in that bicycle logo pattern, and then having to move it to the other side of the road because design wanted to shift it. I don't think that would be plausible, but then again i could be wrong.




  • RN
    Offline / Send Message
    RN sublime tool
    If you're playing Forza 3 on the PC then it's using DX12.
    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
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    The painted markings are probably decals,  probably using the deferred buffers,  the cost of putting one or two layers on the ground would be minor.
    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. 

  • Easton
    Offline / Send Message
    Easton vertex


    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.
  • Mr Whippy
    Offline / Send Message
    Mr Whippy polycounter lvl 7
    Did you get any further with this Easton?


    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.
Sign In or Register to comment.