IcterusGames / SimpleGrassTextured

Plugin to make grass on Godot 4
MIT License
170 stars 16 forks source link

SimpleGrassTextured

This plugin for Godot 4 allows you to add grass and plants to your scene in a simple way

https://icterusgames.itch.io/simple-grass-textured

Preview Image

How to install

Using the AssetLib on Godot

Manual installation

Upgrade from previous version

How to use

Add a SimpleGrassTextured node to your terrain scene

Your terrain scene must have a StaticBody3D in order to draw grass on top of the terrain

  • Preview scene

Select the SimpleGrassTextured node on your scene and draw on the terrain

How to enable interactive mode

  1. In the _ready function of your game scene you must enable the interactive mode by calling the function SimpleGrass.set_interactive(true)
    • Preview set interactive code
  2. Next you must enable the character to be detected by the SimpleGrassTexture collision system, for this it is recommended to add a MeshInstance3D to the character (for example a sphere) at the height of the ground

    you can adjust the size of the sphere so that the collision be detected more accurately

    • Preview character collision mesh
  3. In the render layers of the MeshInstance 3D, only layer 17 should be enabled
    • Preview character collision visual layers

      Note: this same procedure can be done for each character or object that must interact with SimpleGrassTextured

  4. In the active camera disable display layer 17 so that objects that are only interactable with SimpleGrassTexture are not visible
    • Preview camera cull mask
  5. In your character's _process or _physics_process function update SimpleGrassTextured by calling SimpleGrass.set_player_position(global_position)
    • Preview code character position

How to use a custom mesh

Optimization

Disable shadows

Bake height map

LOD optimization

Licence

MIT

Assets Copyright/Attribution Notice:

Texture grassbushcc008.png, Licence CC0, by FabinhoSC https://opengameart.org/content/stylized-grass-and-bush-textures-0