stonegrange 0 Posted December 30, 2021 I am trying to make a procedural meadow with fields within that are 'chunked' off into groups (like the example pic) and the number of fields altered randomly with a seed. Any help or pointers would be appreciated. My current method creates groups that are too 'stringy' and feel like there is a bit of a simpler way that I am not seeing meadowHDA.hip Share this post Link to post Share on other sites
AntoineSfx 42 Posted December 31, 2021 Are you looking for something like this: If so, this is really easy to achieve with Scatter, enumerate those points, and attribute transfer the Index attribute on the grid, attribute promote from point to prim, then primitiveSplit on that attribute After that, you have a clean set of non overlapping primitives built on the initial grid, and it's trivial to find center points, build roads, fences and whatnot. 1 Share this post Link to post Share on other sites
konstantin magnus 1,190 Posted December 31, 2021 (edited) To get overlapping tiles, you could measure and randomly multiply the straight distance to random positions. tiles_overlapping.hiplc Edited December 31, 2021 by konstantin magnus Share this post Link to post Share on other sites
konstantin magnus 1,190 Posted December 31, 2021 (edited) For non-overlapping tiles there are interesting examples on shadertoy like this: https://www.shadertoy.com/view/3styzn tiles_variegated.hiplc Edited December 31, 2021 by konstantin magnus 1 Share this post Link to post Share on other sites
AntoineSfx 42 Posted December 31, 2021 Also see: Labs Lot Subdivision Sop (labs::lot_subdivision::2.0) Share this post Link to post Share on other sites
Librarian 871 Posted January 1 (edited) //regular boxes copy int dim = 50; int bls[]; int bool; int pt; int max_s= 15; int min_s = 3; int size; int area; int dist; vector ori_pos; vector pos; for(int i;i<dim*dim;i++){ ori_pos= set(i%dim,i/dim); addpoint(0,ori_pos); if(removevalue(bls,i)){ append(bls,i); continue; } dist = 0; int k = i; while(1){ if(k%dim== dim-1){ dist ++; break; } if(removevalue(bls,k)){ append(bls,k); break; } dist++; k++; } size = min(dist,floor((max_s-min_s)*rand(i+ch("seed"))+min_s)); area = size *size; for(int j;j<area;j++){ pos = ori_pos+set(j%size,j/size); pt = pos.y*dim+pos.x; append(bls,pt); setpointattrib(0,"class",pt,i); setpointattrib(0,"Cd",pt,vector(rand(i))); } } @stonegrange Grid partion.hiplc Edited January 1 by Librarian Share this post Link to post Share on other sites
stonegrange 0 Posted January 1 wow thanks for all the solutions guys massive help! Share this post Link to post Share on other sites
Keshaw singh 4 Posted May 23 man this save alot of time for level designs thanks for this tips Share this post Link to post Share on other sites