Jump to content

biological modelling methods


Recommended Posts

Here is one way to add UVs to those lines. It does not convert to VDB, it uses a sweep to loft the mesh along the line. If you need VDB output, you can do that at the end and use an AttributeInterpolate to transfer the UVs to your final mesh.

This setup drops in an attribute VOP to add a secondary displacement map along the length of each spline. This means mesh displacement is happening prior to render, but you can still add more normal maps or bump maps to the surface when you get to adding materials.



Edited by Atom
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Thanks a lot for your answers, i will dig the two options you propose tonight.

Konstantin, your solution would work for pure procedural shading, or with triplanar maps, but you could not generate UV out of it right?

Meanwhile i was playing with super simple polar UV projection and got nice results, here is a test render, but it will not do the trick for more detailed image based displacement.


Edited by nicolas.schlafer
  • Like 5
Link to comment
Share on other sites

On 8/19/2019 at 1:52 PM, konstantin magnus said:

Great stuff, Nicolas. This is starting to look Giger-like already!
You don't necessarily need to create UVs in SOPs, though. To project textures on those VDB meshes it's arguably more efficient to do in a shader:


1) Transform position to world space.   2) Curve IDs shown as random colors.       3) U value from curves in HSV colors.
4) Direction to nearest curve position.   5) Tangents from curves set to absolute.  6) Direction to curve oriented along tangents.
7) V coordinate enclosing each wire.     8) UV coordinates in red and green.            9) UV mapping an image texture.

10) Texture based displacement along curves or at least what happens when mandrills do the job ; )

The material snippet:

string geo = 'op:/obj/curves/OUT';
P = ptransform('space:current', 'space:world', P);

int prim = -1;
vector uvw = vector(0.0);
float dist = xyzdist(geo, P, prim, uvw);
vector pos = primuv(geo, 'P', prim, uvw);
float u = primuv(geo, 'u', prim, uvw);
vector tangent = primuv(geo, 'tangentu', prim, uvw);
matrix3 rot = dihedral(tangent, {0,1,0});
vector dir = normalize(P - pos);
vector dir_mod = dir * rot;
float v = fit( atan2(dir_mod.z, dir_mod.x), -M_PI, M_PI, 0.0, 1.0 );

P = set(u, v, 0.0);



This is super cool Thanks!!!

  • Like 2
Link to comment
Share on other sites

  • 2 years later...

This one is really really cool, probably you will love it @konstantin magnus



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



Edited by vinyvince
  • Like 1
Link to comment
Share on other sites

On 02/10/2021 at 11:34 AM, konstantin magnus said:

Transferring curl noise curves into volumes along with displacements based on principal curvature is another way to shape organic sculptures.



We could also advect and grow few frames . I totally forgot the existence of the softpeak , thanks to refresh my memory :)


  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

For UV unwrapping a mesh based on underlying curves1, you can also use this code inside a Point or Vertex Wrangle:

// INPUT 1: CURVES with 'tangentu'-attribute 

int prim_crv;
vector uvw_crv;
float dist = xyzdist(1, v@P, prim_crv, uvw_crv);

vector tangent = primuv(1, 'tangentu', prim_crv, uvw_crv);
matrix3 rot = dihedral(tangent, {0,1,0});
vector pos = primuv(1, 'P', prim_crv, uvw_crv);
vector dir = normalize(pos - v@P) * rot;
float angle = fit11(atan(dir.z, dir.x) / M_PI, 0.0, 1.0);
float perim = primintrinsic(1, 'measuredperimeter', prim_crv);

float u = (angle * 2.0 * M_PI * dist);
float v = uvw_crv[0] * perim;
v@uv = set(u, v, 0.0);

1 https://forums.odforce.net/topic/43213-biological-modelling-methods/?do=findComment&comment=204915

Edited by konstantin magnus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...