Obi Official Forum
Obi Softbody on SpeedTree - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: Obi Softbody on SpeedTree (/thread-1340.html)



Obi Softbody on SpeedTree - JordanSliz - 01-09-2019

Hey there.  I'm looking to incorporate softbody physics into our environment pipeline, to replace a few overlapping systems that don't all affect each other fluidly.

A simple question:  Does Obi Softbody work on SpeedTrees in Unity?


RE: Obi Softbody on SpeedTree - josemendez - 02-09-2019

(01-09-2019, 02:34 AM)JordanSliz Wrote: Hey there.  I'm looking to incorporate softbody physics into our environment pipeline, to replace a few overlapping systems that don't all affect each other fluidly.

A simple question:  Does Obi Softbody work on SpeedTrees in Unity?

Just replied to your PM.

The answer is not directly. Softbodies only work on SkinnedMeshRenderers. However nothing stops you from using the mesh asset generated by a Tree component, on a SkinnedMeshRenderer. Tried it and works like a charm.

A word of warning though: If your intention is to get soft body physics on all trees in your game, this is a very bad idea ™.

Trees usually are simulated via procedural functions affecting vertex displacement in the vertex shader (wind, simple repulsive forces against spheres, etc). This is much faster and works well with LOD systems.

kind regards,


RE: Obi Softbody on SpeedTree - JordanSliz - 08-09-2019

(02-09-2019, 07:18 AM)josemendez Wrote: Just replied to your PM.

The answer is not directly. Softbodies only work on SkinnedMeshRenderers. However nothing stops you from using the mesh asset generated by a Tree component, on a SkinnedMeshRenderer. Tried it and works like a charm.

A word of warning though: If your intention is to get soft body physics on all trees in your game, this is a very bad idea ™.

Trees usually are simulated via procedural functions affecting vertex displacement in the vertex shader (wind, simple repulsive forces against spheres, etc). This is much faster and works well with LOD systems.

kind regards,

Does this system replace the vertex displacement shaders of the tree object? Or displace it on top of the existing shader?  

Seems like something I could manage with quality settings and LODs to control physics near to player only.  What do you mean by "simple repulsive forces against spheres"; is this a feature of Speedtrees?


RE: Obi Softbody on SpeedTree - josemendez - 09-09-2019

(08-09-2019, 04:04 AM)JordanSliz Wrote: Does this system replace the vertex displacement shaders of the tree object? Or displace it on top of the existing shader?  

Neither. It skins the mesh to a bone hierarchy. This happens in the CPU, before any shaders kick in.

(08-09-2019, 04:04 AM)JordanSliz Wrote: Seems like something I could manage with quality settings and LODs to control physics near to player only.  What do you mean by "simple repulsive forces against spheres"; is this a feature of Speedtrees?

When I said "simple repulsive forces against spheres", I was referring to a very commonly used way of approaching procedural animation using the vertex shader. In unity they're implemented as spherical wind zones:
https://docs.unity3d.com/Manual/terrain-WindZones.html


RE: Obi Softbody on SpeedTree - JordanSliz - 29-09-2019

(09-09-2019, 08:09 AM)josemendez Wrote: Neither. It skins the mesh to a bone hierarchy. This happens in the CPU, before any shaders kick in.


When I said "simple repulsive forces against spheres", I was referring to a very commonly used way of approaching procedural animation using the vertex shader. In unity they're implemented as spherical wind zones:
https://docs.unity3d.com/Manual/terrain-WindZones.html

So then, while we want to be careful about using softbody physics on too many trees, it does work.  They bend with wind, via the vertex shader, but then bend to physics with bones?  Effectively, both types of bending work as they should?