Skip to content

Incorrect leaf placement on concave meshes (with solution discussed) #13

@alexjhetherington

Description

@alexjhetherington

First, thanks for this tool! It's incredible.

I am building a blocky environment out of mesh colliders. Painting Ivy works correctly, but ivy that grows around corners (say across a roof then down a wall) fails to respect the new surface and does not calculate the new adhesion normal.

It results in unrealistic looking growth, and leaves that only respect the initially painted normal.

leaf_flat

It's because of the "find closest point on a mesh collider" logic. It is looking at vertices, and in my case the nearest vertex is very far away (big blocks!).

I have coded a dirty solution for my case : to find the closest point on a mesh collider I send many ray casts outwards from the start point in a rough sphere.

It seems to fix the issue! But obviously it's even slower (by how much I'm not sure).

If you want me to make a PR with my dirty solution let me know :)

leaf_angle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions