Distance Field Touch Bend

So for a project I’m working on for myself I wanted to try and get the vegetation touch bending effect that the CryENGINE has. Started working on it the other night after seeing this thread: Distance Field Flow Map - Rendering - Epic Developer Community Forums After putting a few hours into the material, this is the result:

And the material itself:

It seems you beat me to it. I was planning on doing similar thing in 4.9, I just haven’t bothered to compile it myself. My plan was to attach two invisible meshes to the legs of a character and have them push away grass on ground. But I worry that doing that also causes anomalies with the actual DFAO rendering, making the character legs look black or otherwise shadowed.

Yeah, it’s entirely possible. Unfortunately, at the moment you can’t disable DFAO and still keep the distance field calculations for materials going, doing so broke this material immediately for me. Hopefully in a future version we’ll be able to separate the two for instances like that. Not every project that would benefit from materials like this would necessarily benefit from DFAO.

One cool variant on the material that I stumbled across when working on this makes it so the grass actually doesn’t get back up after the distance field is far enough away, and stays like that. Kind of reminded me of that Nvidia Turf Effects video.

This is great!! :slight_smile:

Hello,
i have tested this “Distance Field Touch Bend”-Function with one of my own materials but there is no effect:


Can someone help me please?
Kind regards,
halobungie

@halobungie - You might have to increase the strength parameter a lot - to get the effect in the video below I had to put strength up above 6000.

@Daniel.Wenograd - Thank you very much for this effect, looks awesome!

Hello n00854180t,
i get no such Effect - I have change the Strenght to 6000 but there is no such Effect. Have i to do something else to get this Effect?
Kind regards,
halobungie

Are you doing it on grass or on a flat ground or something? The effect doesn’t show up exactly the same when not used on grass.

That sounds awesome (the grass staying down part). How does that work and could it be replicated in multiplayer?

Yes i have tried it out with the Kite-Demo-Grass but without success…

Is it possible that someone can give me a small Content with this Grass-Bending-Effect inside, PLEASE?

Kind regards,
halobungie

As much as I wish I did, I didn’t make a backup of that iteration. It’s not that far off, I just forget exactly what I did for that specifically.

I don’t see why it wouldn’t work in multiplayer, unless distance fields have a culling limitation I’m unaware of.

Very interesting :slight_smile:

How would the staying down part work in theory? I mean when the object moves then the distance field approximation is not there anymore :confused:.

Very interested in this. I have no idea how it could be done but if you end up remembering how you did it I would love to hear about it.

Works fantastically! I had to place a transparent mesh attached to my character mesh since it isn’t large enough to make a noticeable movement, but everything else has worked out perfectly! Thank you so much for sharing!!

Make sure you have distance field AO enabled, following the instructions below.

This is outstanding. I really love to see all these small details get involved in games, really adds to the immersion.

If I remember right, it was something along the lines of adding the deformation to the mesh without actually subtracting it again when the object left its range. The final effect was, effectively, the distance field vertex painting the mesh. Really wishing I made a backup of that manually, couldn’t find it in any of the autosaves/backups for the project.

I’ve been trying to work out how to add the deformation w/o taking it away again, real head-scratcher. Thank you very much for sharing this, seriously!

Thank you hippowombat!!! Now i have the Effect!!
Kind regards,
halobungie

can u make the bend permanently ?