Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Addon to generate interactive grass with Path2D (Curve), group of interactive objects, change the grass texture, blur, wind direction and force, height grass, random "leaf" rotation, colour array to random leaves, and several other parameters.*The addon is in continuous improvement, version 1.0 can be used with GLES2, GLES3 and Android (mobile)
Godot - TBP_GrassPath2D
- Developed and tested on Godot 3.2
- Portuguese documentation
- Tested with GLES2 and GLES3 (PC and Android)
- FPS varies a lot according to the configuration of the interval between the "leafs" and the parameter "maxProcess" which is the maximum number of physics processes for the grass segment.
Interactive grass generator through a Path2D (Curve).
Plugin parameters
CAUTION!!! interval: this parameter if less than 15 can significantly lose performance in conjunction with the "interactive" parameter if enabled.
For better performance, increase the value of "interval", which is the interval between the "leafs", and adjust the process limit to "maxProcess" physics
interval
: Space between "leafs"interactive
: If enabled, interact with objects in the group "groupInteractive"maxProcess
: Maximum processes for leaf physics that interact at the same timecolorGrass
: Color array for "leafs" - Textures reported in "grassTextures" must be whiteblur_samples
: Blur sampleblur_strength
: Blur strength - 0 à 1colorTerrain
: Terrain color, if generatedgenerateTerrain
: Generates a StaticBody terrain with collisionmaxHeightTerrain
: Maximum height in pixels for the generated terraininteractiveArea
: A pixel "width" for the "leaf" area to interact with the objectfollowAngle
: Whether the "leaf" should follow the rotation of the terrain curveheightGrass
: Grass heightrandomGrassMin
: Minimum range to randomize leaf rotationrandomGrassMax
: Maximum range to randomize leaf rotationwindForce
: Power to the windwindDirection
: Wind direction, -1 to the left and 1 to the rightgrassZIndex
: Index for the Z Index of the leafsgrassYOffset
: Y offset for leafsmaxLeafRotateDegree
: Maximum (º) degree for leaf rotationgrassTextures
: Array that will be randomized between leafsgroupInteractive
: String array with the name of the group that the "leaf" should interact with, that same group must be in the object
Demonstration Video (PT-BR)
Example
- In the project example, I show how to use the plugin, to move the "player" on the PC, use the arrows keys, and the space to jump.
- It is also possible to run on Android, just click and drag to move the "player", and with the analog stick tap with a second finger to jump.
Configure the Addon
- Download the folder addons/TBP_GrassPath2D
- Put it in your project's "addons" folder
- Go to Project Settings > Plugin and enable the "TBP_GrassPath2D" plugin
AnimationPlayer
You can use an AnimationPlayer or GDScript to change some parameters at run time, for now, you can change the following parameters:
- heightGrass
- windDirection
- windForce
...
Will you use this code commercially? Rest assured you can use it freely and without having to mention anything, of course I will be happy if you at least remember the help and share it with friends, lol. If you feel at heart, consider buying me a coffee heart -> https://ko-fi.com/thsbruno
Addon to generate interactive grass with Path2D (Curve), group of interactive objects, change the grass texture, blur, wind direction and force, height grass, random "leaf" rotation, colour array to random leaves, and several other parameters.
*The addon is in continuous improvement, version 1.0 can be used with GLES2, GLES3 and Android (mobile)
Reviews
Quick Information
Addon to generate interactive grass with Path2D (Curve), group of interactive objects, change the grass texture, blur, wind direction and force, height grass, random "leaf" rotation, colour array to random leaves, and several other parameters.*The addon is in continuous improvement, version 1.0 can be used with GLES2, GLES3 and Android (mobile)