# How handle this mushroom shape procedurally ?

## Recommended Posts

Hey guys !

I've been struggling for a while now on this guy... That's why I'm hopping finding a hero among all of you !

I want to model produrally this mushroom shape.
I try different approaches, but so far nothing successfull.
The thing Im struggling the most is to get those smaller leaves along those organics kinda veins... The overall veins structure and the small leaves are all connected.

I join the hip file in the post

So if any of you have some guidance feel free to share it

Edited by Tonhiox

##### Share on other sites

Combine this 2 Sample and Have Fun

Edited by Librarian
• 1

##### Share on other sites

I tried.

I couldn't think of a clever way to do it, but I hope it helps.

Edited by satoru
• 7

##### Share on other sites

Daaamn thank you so much guys !!!!

I see the convert VDB being the solution here for most of the case.   I will probably get  sharper edges by playing with the curvature mask and more vdb resolution !

I come back to you once I will have proper animation and render !

You guys rock ! What an amazing community

##### Share on other sites
17 hours ago, konstantin magnus said:

Project a distorted grid on a displaced torus.

Hello, Konstantin!
Can you please explain the magic happening in the "skin" wrangle?

```v@uvw = relbbox(0, v@P);
@uvw.y = fit01(@uvw.z, 0, 1);
v@P = primuv(1, 'P', 0, @uvw);```

As I understand, in general, you are wrapping a grid around the torus with primuv, and with a fit01, you define where the wrap starts/ends.
But in detail... What is the @uvw attribute, why it's used in primuv function and what this function is doing? Why the fit modifies Y attribute relying on Z?

##### Share on other sites

Hello @kiryha,

first of all the torus is a NURBS surface, meaning it's treated as one single primitive which is also already unwrapped in UV space. This makes it an easy target for the primuv-function that is returning the position (or any other attribute) on a primitive at an primitive's intrinsic UV location.

Here is what primuv() does to a grid based on a mesh (left) as opposed to a NURBS surface (right):

Now when you want to apply a geometry (mesh, points, curves) onto a primitive, it needs to have UV coordinates first. In this case the UVs are based on the grid points positions in relation to the bounding box:

`v@uvw = relbbox(0, v@P);`

Because the grid lay on the XZ plane (for no reason in this case) I had to exchange the Z with Y coordinate:

`@uvw.y = fit01(@uvw.z, 0.2, 0.5);`

The Z coordinate should then be set to 0  for correctness:

`@uvw.z = 0.0;`

So in other words: if the grid was set to the XY plane right away, it's sufficient to transfer the position attribute from the NURBS torus like this:

```vector UV_grid = relbbox(0, v@P);
v@P = primuv(1, 'P', 0, UV_grid);```

Edited by konstantin magnus
• 2

##### Share on other sites

Here's another plant generator this time growing from crevices / occluded areas.
It's essentially blending the volume gradient with some curl noise based on distance.

mushroom_grow_out.hipnc

• 6

##### Share on other sites
On 06/10/2020 at 1:11 AM, konstantin magnus said:

Here is my take on the schizophyllum commune:

1. Project a distorted grid on a displaced torus.
2. Iterate over remeshing and relaxing the grid.
3. Scatter random points along the outer edges.
4. Find their shortest paths across the mesh.
5. Convert the curves into a signed distance field.
6. Offset the SDF contour based on curve orientation.

The gills can be flipped by negating the orientation along the path curves.

Magnus shines again.  Adding some few iterations of differential mesh grow

##### Share on other sites

Master Magnus has spoken, hard to add something after

You might want to add inner veins details for SSS effect inside or whatever using the shortest path with origin from the center.

Magnus alrealdy did few iterations of remeshing and point relax with pscale , but you could eventually add few more difference mesh grow steps at the end on the "tips" parts

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

##### Share on other sites
On 06/10/2020 at 8:03 PM, konstantin magnus said:

Hello @kiryha,

first of all the torus is a NURBS surface, meaning it's treated as one single primitive which is also already unwrapped in UV space. This makes it an easy target for the primuv-function that is returning the position (or any other attribute) on a primitive at an primitive's intrinsic UV location.

Here is what primuv() does to a grid based on a mesh (left) as opposed to a NURBS surface (right):

Now when you want to apply a geometry (mesh, points, curves) onto a primitive, it needs to have UV coordinates first. In this case the UVs are based on the grid points positions in relation to the bounding box:

```
v@uvw = relbbox(0, v@P);```

Because the grid lay on the XZ plane (for no reason in this case) I had to exchange the Z with Y coordinate:

```
@uvw.y = fit01(@uvw.z, 0.2, 0.5);```

The Z coordinate should then be set to 0  for correctness:

```
@uvw.z = 0.0;```

So in other words: if the grid was set to the XY plane right away, it's sufficient to transfer the position attribute from the NURBS torus like this:

```
vector UV_grid = relbbox(0, v@P);
v@P = primuv(1, 'P', 0, UV_grid);```

If you don't want to deal with VEX and have iteractive feedback, you could do that with Creep considering you have a NURB surface. Just need to change the plane orientation

##### Share on other sites
2 hours ago, vinyvince said:

Master Magnus has spoken, hard to add something after

You might want to add inner veins details for SSS effect inside or whatever using the shortest path with origin from the center.

Magnus alrealdy did few iterations of remeshing and point relax with pscale , but you could eventually add few more difference mesh grow steps at the end on the "tips" parts

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

Maybe forget my comments, just open the Magnus file and actually he did exactely what i was suggesting, but in different order Lol

I was more thinking of starting with a skin surface after extracting the curves, cut in sections or whatever, running diff mesh grow on the tip, running shortest path there to get the then veins and sculpting the noise of the surface using vdb avoid VDB from particles which i m not a big fan of instead if i have to ...

Edited by vinyvince

##### Share on other sites

@vinyvince Abs Right.
When someone like you Have so much experience (just wish for you That you Make your own Studio why NOt) what you waiting  ..Take the Credit  And Have FUn ,give the Job  the some Talented Guys and Have Fun ..just mine  wishful thinking For YOU.
.who knows ....

FLOWER_MUSHROOM_AND_FUN.hiplc

• 1

##### Share on other sites

Just gave the gills a little update.

• 4

##### Share on other sites

I have updated the plant generator a bit. It contains a few examples of modeling growth.

seashell.hiplc

• 3
• 1

## Create an account

Register a new account