Jump to content

Compensate UV and noise value on piece with very different aspect ration


Recommended Posts

Dealing with thousand pieces , some with extreme aspect ration and a quick weird shape as start... Just wondering, what will be the best way to distribute the noise and UV to compensate this?

something like orient the bounding box as best as possible, measure the max and min of bounding box, get the ratio from the two, use this as a attribute... ?

 

cheers

 

________________________________________________________________

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

 http://fr.linkedin.com/in/vincentthomas

ringstation_Houdiniprocedural_cracksedges_Rnd.PNG

ringstation_Houdiniprocedural_detailpieces_variantes3_edges_Rnd2.PNG

styleB_patern_B_mergedfragment_for_tileA_unwrapped_5.PNG

Link to comment
Share on other sites

int dim = chi("dim");
int npt = chi("npt");
vector pos ;
vector prev_pos;
int  prev_prim;
vector dir;
vector uv;
vector prim_pos;
float dist;
float min_dist = 0.5;
float max_dist = length({0.5,0.5,0});
int pt;
int prim;

for(int j;j<dim*dim;j++){
    prim_pos = set(j%dim,j/dim);
    prim = addprim(0,"polyline");
    
    for (int i;i<npt;i++){
    pos=lspline(i/float(npt-1),{0,0,0},{0,1,0},{1,1,0},{1,0,0},{0,0,0});
    dist = length(pos-{0.5,0.5,0});
    dist= smooth(min_dist,max_dist,dist,ch("rolloff"));
    dist =fit01(dist,0.5,0);
    dir = normalize ({0.5,0.5,0}-pos);
    pos += dist *dir;
    pos += prim_pos;
    uv = pos/(dim-1);
    pos = uvsample(1,"P","uv",uv);
    
    
    dist = distance(pos,prev_pos);
        if(dist>1 && prev_prim == prim){
        
                prim = addprim(0,"polyline");
                }
                
                else {
                
                pt = addpoint(0,pos);
                addvertex(0,prim,pt);
                prev_pos = pos;
                prev_prim = prim;
                
                }
                
        }
        
        
 }       

attribtransferbyuv

  • Like 1
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.

Guest
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...