stonegrange Posted December 30, 2021 Share 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 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted December 31, 2021 Share 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 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 31, 2021 Share 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 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 31, 2021 Share 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 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted December 31, 2021 Share Posted December 31, 2021 Also see: Labs Lot Subdivision Sop (labs::lot_subdivision::2.0) Quote Link to comment Share on other sites More sharing options...
Librarian Posted January 1, 2022 Share Posted January 1, 2022 (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, 2022 by Librarian Quote Link to comment Share on other sites More sharing options...
stonegrange Posted January 1, 2022 Author Share Posted January 1, 2022 wow thanks for all the solutions guys massive help! Quote Link to comment Share on other sites More sharing options...
Keshaw singh Posted May 23, 2022 Share Posted May 23, 2022 man this save alot of time for level designs thanks for this tips Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.