Home Unreal Engine

Using Vertex Color with Decals?

hghtch
node
Offline / Send Message
hghtch node
I'm trying to understand how they made the footprints and wagon trails adhere so good to the terrain in RDR2. On moist muddy parts of the road they spawn with a water surface material applied, and when it's just regular mud there is no water. I figured that they use POM decals, but I have no clue on how the decals "knows" where it should have which material applied.
My wishful newbie thinking is "it would be great to use project the vertex colors of mesh the decal is projected on back to the decal in order to use them". But I see absolutely no way to do that.
Does somebody have another idea? It doesn't have to be the same information, even though this would be nice, it would be no problem to paint the wet areas a second time.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Can you show an example of this? Cuz this is usually done by drawing into a render target that is centered on the player, and moves with him. So this kind of effects can only appear around the player.
  • hghtch
    Options
    Offline / Send Message
    hghtch node
    If you need more perspectives I'll make some more shots later. Actually, this is quite a bad example as the trails in the back aren't filled with water even though they go through a puddle, and the trails coming from the bottom left cross a hoof print filled with water, but aren't filled themselves. But if you walk around and look a the footprints, they usually are coherent with the surface they were made on.
    You can also see the POM at work here really well.
  • jStins
    Options
    Offline / Send Message
    jStins interpolator
    I think @Obscura is correct. Check out this GDC talk from 2014. It's about the snow in Arkham Asylum, but I think a similar approach could be used for the effect here. I've done something similar in Unity with an orthographic camera that renders a specific layer to a render texture. Then that render texture is piped into a shader's displacement channel. It could also be used to mask roughness. 

    https://www.youtube.com/watch?v=87rg95XBalE
  • hghtch
    Options
    Offline / Send Message
    hghtch node
    Thanks, I'll take a look at it. I found a pretty good tutorial on that matter already in terms of real displacement using render targets, but didn't realize the same system could be used with POM (I tested it, they don't occlude each other and have no displacement). In my research on the matter I just saw people spawning decals and wondered how they could adapt to the surface in a way going beyond normal and heightmap. But I have to follow the tutorial first and learn how they work before I can ask anything else. Thank both of you for the hint.
Sign In or Register to comment.