Bending grass

so i have a sphere in my BP_thirdpersoncharacter and it bends the grass nearby.
but whenever I make the sphere’s material a transparent material, the grass doesn’t bend anymore.

Rather than making it transparent, just make it ‘hidden in game’?

3 Likes

Classy and awesome solution suggested above by @ClockworkOcean here @RaidRider

1 Like

thank you both!
I did already try that. Sadly, it doesn’t work.
;-;

What method are you using? Have you tried this?

1 Like

Ah, you used this?

Yes, you can’t turn off visibility, because it won’t generate distance fields.

And the sphere has collision?

1 Like

Yes, that is the exact tutorial I used.
When I press play game and turn on View collision, the collision for the sphere on my character doesn’t show up only when it is invisible but it does have collision when it is not invisible.

Do I have to rewrite all of my code? Or do I just need to find out How to add collision to an invisible sphere

By default, the sphere doesn’t have mesh distance fields on. Have you tried turning it on?

1 Like

No I haven’t tried that. Thank you for the suggestion!

1 Like

hidden_in_game

it shows it’s collision now, but the grass isn’t doing anything…

uncheck render in main pass and depth pass, disable collision

1 Like

No. Turn on mesh distance fields on the sphere, and don’t hide it!

Go back to the transparent material.

1 Like

it works!
thank you so much to all who helped!!!

1 Like

hey all!! sooo i had the same issue, followed allll the advice on here And it still wont work lol…any ideas? i am on ue5.1 if that could factor into it :slight_smile:

I have been using using custom textures with pivot based calculations for a long while now.
I have yet to see anyone doing anything remotely alike.
Maybe I should publish it as a gpu gem article or something.

You don’t need a shape to generate the fields, you just write into a texture at runtime with a custom brush that can change at runtime.
This means footprints, boat keel shapes, stars, blender suzanne, and whatever else you want to use to move ghe grass blades.

How you bend the grass is the important bit.
Each blade has a pivot point. You can’t simply shift the grass around without considering that pivot point.

When you do consider the pivot, you get some sort of effect similar to this (What you see is a single mesh of rectangles).

In short.
The mesh reads the same texture and allows the grass to animate/bend.

The texture (a runtime texture) holds the information written to it by just about anything (up to 10 near concurrent write events doesnt even cause a slowdown).

The meshes (even water) use that image information to react and do what you code them up to do.

The size of the texture can actually - with virtual texturing - provide near infinite “memory”.
Howver half UE4 has to be re-written to merge images down into a VT at runtime…

Looks cool, but how are you generating directional data from this shapes to bend grass in right direction? maybe brush with normal map? I’m using the same pivot based render target with brushes (from uncharted paper), but with simple sdf shapes (ok for vehicles boat and chars, but fails with more complex shapes)

What are vectorfields: Vector field - Wikipedia

Mostly because like for the sphere, you can force the engine to output other things into the texture without having to use a scene capture.

The reason behind that is that scene captures, however low res, will end up rendering stuff in a separate pipeline, and the MS cost adds up, even if you strip it to bare bones.

The question you should be asking isn’t how the data is generated, but how the pivots for individual grass blades (boxes in the image) are stored and retrieved for each vertex of the mesh (and by saying this I gave the answer away :P)