-
Notifications
You must be signed in to change notification settings - Fork 64
Home
Robert Yang edited this page Jul 9, 2019
·
31 revisions
![](https://user-images.githubusercontent.com/2285943/60858537-c1559800-a1dc-11e9-81c6-495bf4ea13f6.gif)
Hedera is a 3D ivy painting tool for Unity. Here's the general workflow:
- Paint the initial ivy and seed some plants, like a small clump or a long strand of ivy.
- (optional) Run the growth simulation, where ivy "AI" will automatically try to explore and climb nearby colliders.
- Generate 3D mesh based on your paint stroke and the growth simulation. You can tweak the generation settings to try different styles of ivy, while keeping the same core ivy structure.
- (optional) Merge multiple ivy plants or export the ivy to .OBJ
- download the .unitypackage and import it into your Unity project
- in menu bar, go to
Hedera > Open HederaExampleScene.unity
- select an ivy game object, click
Start Painting Ivy
, and paint in scene view - once you're comfortable, try creating your own Ivy Profiles
(Hedera > Create > Create New Ivy Profile...)
and customize the settings
avoid making ivy objects into prefabs
- I tried to support this as best as I could, but in Unity 2018.3 or later, the new prefab workflow makes this pretty difficult
- anyway, you can only paint in the scene with actual prefab instances; I have to disable all functions when editing the core prefab asset, at least until Unity 2020.x maybe ships with "in-context prefab mode"
- if you need to re-use ivy across multiple scenes, it's much cleaner to export to .OBJ and use the OBJ as the prefab
- if you export OBJ into your project assets, Hedera can detect it and ask if you want to replace your ivy mesh with the OBJ mesh
avoid painting ivy on non-convex mesh colliders
- it's (mathematically, computationally) difficult to find the closest point on a non-convex mesh collider... Hedera just picks the closest mesh vertex, which will be glitchy on mesh colliders with sparse topology or long triangles
if ivy painting runs very slowly in the editor, try this:
- paint only one stroke at a time
- turn off
Make Mesh During Painting During Growth
, and manually generate the meshes after growth simulation is done - increase
Ivy Step Distance
,Ivy Leaf Size
, orSimplify %
- decrease
Length
,Max Branches
,Smooth #
, orLeaf Density
to file a bug report, create an Issue and include:
- your operating system and Unity Editor version
- what you were trying to do / how to reproduce the bug
- the bad thing(s) that happen, any console messages or editor logs or screenshots
There are a lot of settings. It's very customizable, but it can seem overwhelming at first. My advice: just play with it. And remember, all the settings have very detailed tooltips in the inspector.
![](https://user-images.githubusercontent.com/2285943/60859566-3d51df00-a1e1-11e9-804e-028fa32db8ca.png)
- Length: minimum and maximum growth length for a branch
- Branch Chance %: how likely a branch will branch, higher % means more frequent branching
- Max Branches: hard limit on total branches each plant can have
- Step Distance: how far ivy will try to move for each tick of the simulation, smaller values use more memory and produce higher polycount meshes, while larger values make more "jagged" ivy with fewer vertices
- Float Length: how much a branch can "dangle" without any surface to cling to
- Cling Distance: how far a branch can detect a surface to cling to
- Collision Mask: which collision layers you can paint on, and which layers the ivy will collide with / cling onto... note that ivy ignores triggers
- Random Spread %: how much ivy should randomly spread out and explore
- Plant Follow %: how much ivy should follow the general direction of your paint stroke / its own growth
- Gravity Weight %: how much gravity should pull down floating or dangling branches
- Surface Cling %: how much ivy should prioritize clinging onto surfaces
- Branch Thickness: how thick the diameter of the branch mesh should be
- Leaf Size Radius: the radial size of each leaf, smaller leaves mean more leaves (because it needs to generate more leaves to maintain the same ratio of Leaf Density)
- Leaf Density %: how much of each branch should be covered with leaves? higher values mean very bushy ivy plants
- Vertex Colors: generates random vertex colors for each leaf quad, but make sure your shader supports vertex colors (fortunately, the default Hedera leaf shader does!)
- Branch Material, Leaf Material: Hedera generates two meshes, a branch mesh and a leaf mesh, and these are the materials to apply to each mesh... if left blank, then it will use default Unity materials
- Name: the template for naming ivy mesh objects, {0} means "branch count" and {1} means "seed position"
- Batching Static: set ivy meshes as batching static, so Unity can batch similar ivy meshes together
- Lighting Static: set ivy meshes as lighting static, so Unity can lightmap the meshes... when enabled, will also generate lightmap UV2s for the ivy mesh... note that this usually looks pretty bad unless your lightmap resolution is high enough, consider using direct lighting or light probes instead
- Mesh Compress: compress ivy meshes when building out, can save you a lot of file size but high compression can introduce glitches in the mesh, especially if you want to preserve small details
- Cast Shadows: sets the "Cast Shadows" setting on the ivy mesh renderers... setting this to "Off" can be a great framerate optimization, especially if you have a lot of ivy meshes
- Receive Shadows: sets the "Receive Shadows" setting on the ivy mesh renderers
- Smooth Count: how many subdivisions for Catmull-Rom smoothing, higher values basically multiply your branch mesh's vertex count, so make sure you use this in conjunction with Simplify %
- Simplify %: how aggressively to optimize the mesh's vertex count / polycount while preserving the general shape... high percentages will result in glitching and loss of small details -- or even whole branches!
- Taper %: branches generally "taper" and become thinner as they progress, which looks great on organic objects, but less on artificial or mechanical objects
- Leaf Sunlight %: approximates how ivy wants to be in the sunlight, so redistributes more leaves on top of objects and fewer leaves underneath objects... also affects the facing of leaves, higher % means leaves face upwards more