Remove foliage under mesh

Hello,i’m trying to optimize the foliage in my game.Right now im placing grass using grass types in the landscape material. To place trees and rocks im using procedural foliage.What i’m trying to achieve is deleting the grass that intersects with the rocks since they occupy a big area and there is no reason to have grass grow under them.I’ve been thinking about creating a blueprint utility to do this(get the overlap of the rocks from the procedural foliage and delete the individual instances of grass),but im not exactly sure if it would work. I havent seen an option to do such thing by default,but maybe im wrong.If anyone knows a way to do this please tell.

delete the individual instances of
grass

Hi, if you use the landscape grass type, then you don’t have individual instance transforms, you only have grass maps. Therefore you cannot remove individual instances but would need to have a texture that specifies where you want to remove the grass.

The easiest way would be to just manually paint a new layer onto the landscape and subtract that from what you put into the landscape grass node.

Otherwise you could use a rendertarget (I don’t know what resolution the grass maps are, but I would guess they have the same resolution as the landscape like the landscape layers, therefore the rendertarget should have the same resolution as the landscape which will give you a precision of one pixel per square meter). Then draw a white spot (radial gradient exponent for example) onto the rendertarget wherever you have a rock. Ofc they might not be of cirular shape and the precision of the grass maps is not very great, therefore I would just paint it by hand onto a landscape layer.

delete the individual instances of
grass

Hi, if you use the landscape grass type, then you don’t have individual instance transforms, you only have grass maps. Therefore you cannot remove individual instances but would need to have a texture that specifies where you want to remove the grass.

The easiest way would be to just manually paint a new layer onto the landscape and subtract that from what you put into the grass layer.

Otherwise you could use a rendertarget (I don’t know what resolution the grass maps are, but I would guess they have the same resolution as the landscape like the landscape layers, therefore the rendertarget should have the same resolution as the landscape which will give you a precision of one pixel per square meter). Then draw a white spot (radial gradient exponent for example) onto the rendertarget wherever you have a rock. Ofc they might not be of cirular shape and the precision of the grass maps is not very great, therefore I would just paint it by hand onto a landscape layer.