Switch on/off 3D grass in blueprints

Here are the material parts responsible for 3D grass:



Here is the function where I try to switch:
2024-07-29_17-31-51
But, this just does nothing. How to fix this?

Bump. The topic is actual.

Double bump.

Triple bump.

Quadruple bump.

Quintuple bump.

Sextuple bump.

Septuple bump.

Create a Dynamic Material Instance.

I guess there is no way easier than iterate all landscape proxies in the loop and filter those which can have 3D grass (they are not all landscape proxies) to manually set MID on each of them, after checking if it was not set earlier?

What is it you are trying to do exactly?

Turn off actual meshes (despawn them)? Do something in a material to make the grass ‘disappear’ (like change it’s opacity/mask)?

Your graphs make no sense to me.

If you want to feed a number into the landscape-grass node that you can zero-out (turn-off), skip the first two graphs and just multiply whatever you were going to feed into the landscape grass by the MPC reference. When 0, it will multiply out to 0 feeding no grass to the output-node. You don’t need a distinct function for this; make it easier on yourself :face_exhaling:

You can use it as a throttle.

Curious if this is for all instances on the LS proxy or specific instances? If this is for specific instances you need a entirely different approach. I’ve got 99% of the code for this just ask.

The problem is that I have two landscapes, the “upper” one and something like dungeon, and both have World Partition, so this is for the “upper” landscape. Also I have tried to create MID, and it was created but wasn’t assigned to the “LandscapeMaterial” variable. The node “SetLandscapeMaterial” does nothing.

On the upper are you changing “Every” instance of foliage, say grass. Or specific clumps.
e.g. you throw a fireball and it burns a section of grass. Deforestation of an area etc.

I have not experimented with fireballs yet but who knows what will change in the future… As for now, it is the full switching off the 3D grass as the graphics setting, to reduce the resources consuming.

Mines working fine using MPC. Toggling Opacity 0 → 1

This is Implemented in the GRASS Material, not in the Landscape material. You have to apply it directly.

Unfortunately this is not a solution. Grass switches on and off but the resource consuming does not change.

Well, no of course not. The grass is still there it’s just being masked out.

Just having the grass (potentially) exist at-all will incurr overhead. The engine still needs to know what mesh(es) might be displayed, where they might be displayed, etc. The stuff is still ‘there’ being culled and whatnot before passing to the GPU so you are really only saving (generally) GPU-overhead when using material-tricks.

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