-
Notifications
You must be signed in to change notification settings - Fork 64
Home
Robert Yang edited this page Dec 12, 2021
·
31 revisions
Hedera is a 3D ivy painting tool for Unity. Here's the general workflow:
- Paint the initial ivy on anything with a 3D collider. (Box, Sphere, Capsule, Terrain, and Mesh Colliders are all supported.)
- (optional) Run the growth simulation, where ivy "AI" will automatically try to explore and climb nearby colliders. Keep in mind, it's not very "smart", it's just a plant.
- Generate 3D mesh based on paint stroke and growth simulation. Tweak mesh settings to try different styles while keeping the same core ivy structure.
- (optional) Merge multiple ivy plants or export the ivy to .OBJ
- copy this URL:
https://github.com/radiatoryang/hedera.git
- in Unity menu bar, go to
Window > Package Manager
(info / help for Unity Package Manager) - in Unity Package Manager, click
(+ button) > Add package from Git URL...
(info / troubleshooting Git URL packages in Unity) - paste URL from step 1 into the URL box and click
Add
- Hedera will now automatically update from GitHub
- IMPORTANT: if installing via Unity Package Manager, make sure you click
Samples
and import the default ivy profiles and textures - in Unity 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 modding an existing ivy profile, or create your own ivy profile
(Hedera > Create > Create New Ivy Profile...)
- if you want full control over where the ivy goes, disable the ivy simulation (uncheck the box below the "Paint" button)
- if you want a specific shape, create a collider and paint ivy on it... and then delete the collider
- you can paint bare branches, wires, ropes, and cables if you set Leaf Density to 0
visit the full troubleshooting and workflow page for details, but in summary:
- avoid making ivy objects into prefabs; to reuse ivy meshes, export to OBJ instead
- avoid painting ivy on non-convex mesh colliders, favor primitive colliders when possible
- if painting runs slowly in the editor, there are ways of optimizing performance
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.
- 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