Interactions
Interactions are sway animations generated by interactors.
There are included two types of interactors:
Interactor Projector
First of all, you need a projector on your scene that will collect nearby interactors and process them.
Projector is defined by volume, that defines frustum for internal camera used to scan, render and process interaction.
Texture Size - quality of projector texture.
MSAA - texture multisampling. Increasing will also improve quality significantly, but at lower cost than texture size.
Type - type of projector:
Local - projector stays where it is, you simply define width and height of it.
Infinite - projector of square shape attached to camera (you can override this behaviour with Attach To option), you will use it mostly for larger areas that you cannot cover with local one
Lower & Upper Clip - define frustum size for internal camera that will be used to render interactors. It's displayed as white wireframe on scene gizmo. Configure it so frustum can cover your entire area. Ideally, with extra margin.
Scan Interval - time in seconds between scanning for new interactors inside projector. You can always disable it by putting high value and do it manually throguh script by calling ScanInteractors()
function.
Interactors
NOTE: Whenever you create new interactor, it will force its game object to be on separate, dedicated for this feature layer.
Due to this, it is recommended to always have interactors as separate game objects in your hierarchy (e.g. child objects).
Read more: Dragon Foliage Config
Primitive Interactor
This is simple, mesh-based interactor that acts like a collider for grass to animate it down.
\
There are two ways to create them:
Method #1:
Method #2:
Create empty game object.
Add Primitive Interactor
component.
Configure it according to instructions in inspector - use generic box, sphere or custom mesh.
By default primitive interactor will animate grass down towards current direction it moves.
You can offset it or force to use direction pointed by forward vector (blue one on gizmo in local mode).
Wind Interactor
Makes wind blow effect that can be generated by e.g. fan or rotor.
To create it:
Wind Interactor has a bit more advanced shape that is visualised as gizmo when you have selected it in hierarchy.
Also, Wind Interactor is always aligned to XZ plane and only rotation along Y axis makes difference if you would like to move it.
Shape configuration:
Radius - size of area.
Inner Radius - radius multiplier to define inner radius that will be used to blend from maximum to zero wind power.
Cone - 360 is full circle, reduce to make a cone that will point forward vector.
Offset Height - main Y position offset for entire area, usefull if you attach this to some moving object.
Thickness - shape thickness below offset height. Surface inside this area will be influenced by this wind with maximum power.
Blend Height - height below thickness area. Surface inside this area will be influenced by this wind reduced power, depending on distance to thick area.
Wind configuration:
Assign Projector to Surface
Final step to have projector actually working is assigning it to your Foliage Surface in Sway tab.
You can set projector in two modes:
Stiffness parameters:
Bend - how fast plant will go down if has to.
Recovery - how fast plant will go up to its original position when there is no more interaction.
Direction - how fast plant will change its' sway direction when direction of interaction changes. Works only if plant is not at its full sway level.
Just like surfaces, you can have multiple projectors on your scene but you can assign only one to surface.
You can, however, have just one projector and assign it to multiple surfaces at the same time.