Realtime landscape and vegetation modifications (grass masking)


Recommended Posts

Is there a good way to have realtime vegetation masking?
Basically what I'd like to do is this:

As you can see if the player places 4 sticks in a square the game masks the terrain and grass under it.

I tried it with a Landscape Layer map in Unigine and it updates the landscape realtime but not the vegetation.

The vegetation is placed via ObjectMeshClutter and it's mask is set to the grass landscape mask.

I did it in unity via render targets.

Once the player places 4 sticks it creates a new quad mesh with the edges of the sticks and renders it into a rendertarget with a uniform unlit color.

The grass and terrain shader then uses the rendertarget to determine where to render grass or no grass.

As far as i read i could do the same (shaders and rendertarget) but I'm courious if there's a better way to do it in unigine.
Is there a way to explicitly update the ObjectMeshClutter's mask?

Is it fast?
Can field spacers be used realtime with custom masking shapes?
Is there a better way to do this?

Any ideas would be welcome, thanks for reading :D 

Link to post

Looks like I just figured it out :D 

Turns out this is in the decal system like by default you just need to set the interaction mask and tick a box (wich is just so cool!).

Leaving this here in case anyone looks for this in the future.


  • Like 6
Link to post