ron2812 Posted September 17, 2020 Share Posted September 17, 2020 Hi there! What would be the best approach to iterate over all available heightfield layers and combine them? E.g. I have layers like: - rocks - path1 - path2 - dirt - dirtabc - various erosion layers - .... The user can enter a custom layer name in my HDA and I won't know exactly how many layers are in the final heightfield. Now i need one layer that combines every other layer (to create a layer for all areas that don't belong to any other layer). What would be the best way to approach this? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
anim Posted September 17, 2020 Share Posted September 17, 2020 not sure if there is a node for this, I'm not that familiar with hfields but you should be able to do it in Volume Wrangle string pattern = "rocks path* dirt*"; // pattern matching layer names you want to combine float combinedlayers = 0; for (int i=0;i<nprimitives(0); i++){ string name = prim(0, "name", i); if (match(pattern, name)){ float value = volumesample(0, name, @P); combinedlayers = max(combinedlayers, value); // combining layers using maximum } } f@mask = fit01(combinedlayers,1,0); // mask will contain complementary areas to combined layers Quote Link to comment Share on other sites More sharing options...
ron2812 Posted September 18, 2020 Author Share Posted September 18, 2020 Awesome Tomas! This is exactly what i was looking for. Thank you! Quote Link to comment Share on other sites More sharing options...
vinyvince Posted February 18, 2021 Share Posted February 18, 2021 (edited) Hi all. Im Looking to combine all my tiles into one large terrain, and blend the border of each according to the surrounding tiles so there is no break. I could do a Xform or copy to point, and obviously blending is okay for two layers , but to do automate this to a full large mosaic? Cop , could be one i guess, but i don't know, maybe it's only me, buthe old beast feels so slowww , unstable and heavy Also, speaking of syntax here, this is an easier question, just can't remember how to ... Let's say i have 10 variantes heightfield generated on my disk saved in this folder structure "/var00x/craterterrain.tif" _and i want to attribute a piece variant to each of then to scatter each terrain , do you remember what will be the proper way to load each tile from the different folder , assign a variant number and feed the scatter? Here's if an heightfeild file input to read... PDG will be a good way, not sure how, is there a more simple way? ________________________________________________________________ Vincent Thomas (VFX and Art since 1998) Senior Env and Lighting artist & Houdini generalist & Creative Concepts http://fr.linkedin.com/in/vincentthomas Edited February 18, 2021 by vinyvince Quote Link to comment Share on other sites More sharing options...
vinyvince Posted February 18, 2021 Share Posted February 18, 2021 Would be great if we could combine the patch tool with scattering ... Will be a nice feature upgrade Quote Link to comment Share on other sites More sharing options...
vinyvince Posted February 19, 2021 Share Posted February 19, 2021 I guess it's possible by building a 2d array with u,v translation values to give to the patch translate, then for each iteration to load a different heightfield. Have to look how to do that, especially as i said in my previous post for loading a different heightfield from disk for each iteration pass, if someone knows, please drop a line For now it's semi manual 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.