Landscape Grass Array WPO distance limit does not work for me.

So in landscape material I can add landscape grass to which I connect array of objects that get scattered realtime. Now in that array there is setting called “Instance world position offset disable distance”. In description it claims to disable WPO at certain distance. I can set it to 1 and I still get animation on grass. So why it does not work for me?

Hi kotlet,

It’s a “distance” value - set it to something like 10000 and see if that works…

Well yes, it is a distance cutoff value for WPO and it does nothing, even at setting as low as 1. Everything still moves and I have no idea why.

Had to check :slight_smile: I just tested here and it seems to be working correctly - are you using 5.2? Is there anything out of the ordinary about your project?

Well it does not work here. I tested in different project, starter content. I created landscape, with landscape grass, array with distributed cube with simple_grass_wind. I set “instance world position offset disable distance” to 10 and effect is that cubes (grass) still gets WPO movement. Unreal 5.2.1. I have no idea what I am missing.

Alright, this seems to work fine with Nanite only. It does not work with LODs. Maybe a bug or something.

2 Likes

I was just about to ask if you had Nanite enabled :slight_smile:

Not a bug probably. Its a new nanite addition because you can’t manipulate the material as you would normally.

For your non nanite project, just disable WPO based on either size on screen or LOD value or whatever you feel like setting up directly within the material.
To be honest though, even with trillion instances it doesnt affect a GFX (better than or equal to a 1080ti) all that much…

1 Like

As MostHost_LA states, it’s new to nanite.

I would suggest trying with it enabled with nanite and working with virtual shadow maps first - if that is too slow, try going back to LODs - you can set later lods to use a non-WPO material while the closer LODs use WPO.

I remember nanite grass was working funky last time I tried it with WPO. Went blurry and crazy, and I think it was in 5.2. Someone mentioned it on forums with screenshot of the same behaviour so I will skip it for now.

I knew about material switch with LODS. But how do you disable WPO based on screen size?

As a side-note, that can be fixed by using PivotPainter meshes (I don’t get that behaviour with MS grass with it’s default settings any more).

You have access to the object bounds, which could be used to calculate the approximate size based on distance.
However since each instance has the value, it sould also be possible to create a shader which has direct access to it…

Realistically it will be faster to just calculate a diatance, which is practically directly related…

Sorry to not be more specific. What I was wondering is how would you use to disable those WPO calculations off in material based on whatever condition. I was looking both inside Unreal and googling it and was not aware of any node that would allow to “switch off” WPO component based on some condition, hence why the common solution is entire material swap in LOD.
I get that I could use some distance fade that would not show the WPO movement but I guess still would calculate them, hence entire performance benefit being non existant. Unless there is some WPO OFF node that I missed.

All you have to do is output 0 instead of a proper value, so an IF, a Branch, a custom node or even the result off a lerp would all be able to “switch it off”.

To be clear
WPO is an offset value you give to each vertex of the mesh.

Thats why 100 x vertexnormalWS fed into WPO will bloat up a mesh by 100 units.

Grass wind/anything for that matter, including ocean waves, can therefore be turned “off” by feeding a value of 0.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.